hscloud/WORKSPACE

300 lines
8.8 KiB
Python
Raw Permalink Normal View History

workspace(
name = "hscloud",
)
2019-01-13 20:14:02 +00:00
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
2019-01-13 20:14:02 +00:00
# Load skylib
http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
load("@bazel_skylib//lib:versions.bzl", "versions")
versions.check(minimum_bazel_version = "5.4.1")
# Protobuf deps (shared between many rules).
# Load this as early as possible, to avoid a different version being pulled in by deps of something else
http_archive(
name = "com_google_protobuf",
sha256 = "76a33e2136f23971ce46c72fd697cd94dc9f73d56ab23b753c3e16854c90ddfd",
strip_prefix = "protobuf-2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a",
urls = [
"https://github.com/protocolbuffers/protobuf/archive/2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a.tar.gz",
],
)
http_archive(
name = "rules_proto",
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
strip_prefix = "rules_proto-5.3.0-21.7",
urls = [
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
],
)
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
rules_proto_dependencies()
rules_proto_toolchains()
rules_python_version = "0.24.0"
http_archive(
name = "rules_python",
sha256 = "0a8003b044294d7840ac7d9d73eef05d6ceb682d7516781a4ec62eeb34702578",
strip_prefix = "rules_python-{}".format(rules_python_version),
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/{}.tar.gz".format(rules_python_version),
)
# Download Go/Gazelle rules
http_archive(
name = "io_bazel_rules_go",
sha256 = "51dc53293afe317d2696d4d6433a4c33feedb7748a9e352072e2ec3c0dafd2c6",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
],
)
http_archive(
name = "bazel_gazelle",
sha256 = "29d5dafc2a5582995488c6735115d1d366fcd6a0fc2e2a153f02988706349825",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("//third_party/go:repositories.bzl", "go_repositories")
# Python rules
load("@rules_python//python:repositories.bzl", "python_register_toolchains")
python_register_toolchains(
name = "python3_10",
python_version = "3.10",
)
load("@python3_10//:defs.bzl", "interpreter")
load("@rules_python//python:pip.bzl", "pip_parse")
pip_parse(
name = "pydeps",
python_interpreter_target = interpreter,
requirements_lock = "//third_party/py:requirements.txt",
)
load("@pydeps//:requirements.bzl", "install_deps")
install_deps()
# Setup Go toolchain.
# gazelle:repository_macro third_party/go/repositories.bzl%go_repositories
# gazelle:repository go_repository name=hscloud importpath=code.hackerspace.pl/hscloud
go_repositories()
load("@bazel_gazelle//:deps.bzl", "go_repository")
go_repository(
name = "org_golang_x_mod",
build_external = "external",
importpath = "golang.org/x/mod",
sum = "h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=",
version = "v0.10.0",
)
go_rules_dependencies()
go_register_toolchains(go_version = "1.20.5")
http_archive(
name = "com_github_grpc_grpc",
patch_args = ["-p1"],
patches = [
"//third_party:grpc_extra_deps.patch",
],
sha256 = "931f07db9d48cff6a6007c1033ba6d691fe655bea2765444bc1ad974dfc840aa",
strip_prefix = "grpc-1.56.2",
urls = ["https://github.com/grpc/grpc/archive/v1.56.2.tar.gz"],
)
# Load grpc deps after Go, to prevent overriding Go toolchains/SDK.
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
# Docker rules
http_archive(
name = "io_bazel_rules_docker",
sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"],
)
load("@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", docker_toolchain_configure = "toolchain_configure")
load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)
container_repositories()
load(
"@io_bazel_rules_docker//python3:image.bzl",
_py_image_repos = "repositories",
)
_py_image_repos()
2019-05-18 14:23:45 +00:00
# Docker base images
load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
container_pull(
name = "python-debian",
digest = "sha256:cfa3b79333c4e56fc675b6800445b6dcbb3e6cd4d52f2a9ade944ab73dadc6a1",
registry = "index.docker.io",
repository = "python",
tag = "3.10-bullseye", # use the same version as in python_register_toolchains
)
2019-05-18 14:23:45 +00:00
container_pull(
name = "prodimage-bionic",
digest = "sha256:1cd1f84169b8e1414a5d511b42909f2d540831c67b6799ae9af8cd6a80d75b5f",
registry = "registry.k0.hswaw.net",
repository = "q3k/prodimage",
tag = "20190822-1227",
2019-05-18 14:23:45 +00:00
)
container_pull(
name = "prodimage-focal",
digest = "sha256:fb6159a3ddf2f783092f1169792d1fba6f108714026ad2aa08204e8356825a13",
registry = "registry.k0.hswaw.net",
repository = "q3k/prodimage-focal",
tag = "20211214-0108",
)
container_pull(
name = "gerrit-3.7.5",
digest = "sha256:3705f3cb365bf53a8e310dd7e09c8fb44a073e1266dc0e713b6fdc04c91ab9f2",
registry = "index.docker.io",
repository = "gerritcodereview/gerrit",
tag = "3.7.5-ubuntu20",
)
# third_party/factorio
load("//third_party/factorio:factorio.bzl", "factorio_repositories")
factorio_repositories()
# For devtools/gerrit/gerrit-oauth-provider and gerrit OWNERS plugin
git_repository(
name = "com_googlesource_gerrit_bazlets",
# change 389378, https://gerrit-review.googlesource.com/c/bazlets/+/389378
commit = "0c120e55519b103477b6e0b0ce9130cd6f19abff",
remote = "https://gerrit.googlesource.com/bazlets",
shallow_since = "1606931369 -0600",
)
# Force newer version of Gerrit plugin API.
load("@com_googlesource_gerrit_bazlets//:gerrit_api.bzl", "gerrit_api")
gerrit_api(
version = "3.7.5",
plugin_api_sha1 = "1ea41f95da74045c2cdb30d359041a79b61e72ff",
acceptance_framework_sha1 = "aa51456eda49f928217de4bd46e4af8fbea8c4f1",
)
load("//devtools/gerrit/gerrit-oauth-provider:external_plugin_deps.bzl", gerrit_oauth_deps = "external_plugin_deps")
gerrit_oauth_deps(omit_commons_codec = False)
# Gerrit OWNERS plugins external repositories
git_repository(
name = "com_googlesource_gerrit_plugin_owners",
commit = "6db2d3f048f56fa49469d315b716787d21f8393f",
remote = "https://gerrit.googlesource.com/plugins/owners/",
shallow_since = "1593642470 +0200",
patch_args = ["-p1"],
patches = [
"//third_party:gerrit_plugins_owner.patch",
],
)
load("@com_googlesource_gerrit_plugin_owners//:external_plugin_deps_standalone.bzl", gerrit_owners_deps = "external_plugin_deps_standalone")
gerrit_owners_deps()
# Go image repos for Docker
load(
"@io_bazel_rules_docker//go:image.bzl",
go_image_repos = "repositories",
)
go_image_repos()
# //hswaw/site deps.
load("//hswaw/site:deps.bzl", "hswaw_site_deps")
hswaw_site_deps()
# noVNC, used by //dc/drackvm.
http_archive(
name = "com_github_novnc_novnc",
build_file_content = """
filegroup(
name = "distfiles",
srcs = [
"vnc.html",
] + glob([
"app/**",
"core/**",
"vendor/**",
]),
visibility = ["//visibility:public"],
)
""",
sha256 = "2c972cca34376dfd2a54939e7e571e466511bf592d03e838440b3c8868441eaf",
strip_prefix = "noVNC-1.3.0-beta",
urls = ["https://github.com/novnc/noVNC/archive/refs/tags/v1.3.0-beta.tar.gz"],
)
# temporarily use upstream binary, see //cluster/tools/BUILD
http_file(
name = "calicoctl_3_15",
downloaded_file_path = "calicoctl",
executable = True,
sha256 = "f49e9e8d25108f7f22d5a51c756b2fe40cbe36347ad297e31a767376172f2845",
urls = ["https://github.com/projectcalico/calicoctl/releases/download/v3.15.5/calicoctl"],
)
# viz.js 2.x used by //dc/topo
load("//third_party:vizjs.bzl", "vizjs_repositories")
vizjs_repositories()