blob: df0b26901271c9e39ba9befff3146ca2f3092b53 [file] [log] [blame]
Sergiusz Bazanski5f9b1ec2019-09-22 02:19:18 +02001workspace(
2 name = "hscloud",
3)
4
Sergiusz Bazanskide061802019-01-13 21:14:02 +01005load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
Serge Bazanski146c99e2021-03-18 19:15:38 +00006load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
Sergiusz Bazanskide061802019-01-13 21:14:02 +01007
Serge Bazanski97b5cd72023-07-28 17:14:50 +00008# Load skylib
Patryk Jakuszew28742b82022-11-26 21:33:38 +01009http_archive(
10 name = "bazel_skylib",
11 sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
12 urls = [
13 "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
14 "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
15 ],
16)
17
18load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
19
20bazel_skylib_workspace()
21
Serge Bazanski97b5cd72023-07-28 17:14:50 +000022load("@bazel_skylib//lib:versions.bzl", "versions")
23
24versions.check(minimum_bazel_version = "5.4.1")
25
26# Protobuf deps (shared between many rules).
27# Load this as early as possible, to avoid a different version being pulled in by deps of something else
28http_archive(
29 name = "com_google_protobuf",
30 sha256 = "76a33e2136f23971ce46c72fd697cd94dc9f73d56ab23b753c3e16854c90ddfd",
31 strip_prefix = "protobuf-2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a",
32 urls = [
33 "https://github.com/protocolbuffers/protobuf/archive/2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a.tar.gz",
34 ],
35)
36
37http_archive(
38 name = "rules_proto",
39 sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
40 strip_prefix = "rules_proto-5.3.0-21.7",
41 urls = [
42 "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
43 ],
44)
45
46load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
47
48rules_proto_dependencies()
49
50rules_proto_toolchains()
51
52rules_python_version = "0.24.0"
53
54http_archive(
55 name = "rules_python",
56 sha256 = "0a8003b044294d7840ac7d9d73eef05d6ceb682d7516781a4ec62eeb34702578",
57 strip_prefix = "rules_python-{}".format(rules_python_version),
58 url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/{}.tar.gz".format(rules_python_version),
59)
60
61# Download Go/Gazelle rules
62http_archive(
63 name = "io_bazel_rules_go",
64 sha256 = "51dc53293afe317d2696d4d6433a4c33feedb7748a9e352072e2ec3c0dafd2c6",
65 urls = [
66 "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
67 "https://github.com/bazelbuild/rules_go/releases/download/v0.40.1/rules_go-v0.40.1.zip",
68 ],
69)
70
71http_archive(
72 name = "bazel_gazelle",
73 sha256 = "29d5dafc2a5582995488c6735115d1d366fcd6a0fc2e2a153f02988706349825",
74 urls = [
75 "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
76 "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.31.0/bazel-gazelle-v0.31.0.tar.gz",
77 ],
78)
79
80load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
81load("//third_party/go:repositories.bzl", "go_repositories")
82
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020083# Python rules
Bartosz Stebelf21ca382023-02-04 23:57:59 +010084load("@rules_python//python:repositories.bzl", "python_register_toolchains")
85
86python_register_toolchains(
87 name = "python3_10",
88 python_version = "3.10",
89)
90
91load("@python3_10//:defs.bzl", "interpreter")
Serge Bazanski4e534cc2021-06-29 19:16:45 +000092load("@rules_python//python:pip.bzl", "pip_parse")
Serge Bazanski50e987c2021-07-11 12:32:36 +000093
Serge Bazanski4e534cc2021-06-29 19:16:45 +000094pip_parse(
Serge Bazanski1572e522020-12-03 23:19:28 +010095 name = "pydeps",
Bartosz Stebelf21ca382023-02-04 23:57:59 +010096 python_interpreter_target = interpreter,
Serge Bazanski4e534cc2021-06-29 19:16:45 +000097 requirements_lock = "//third_party/py:requirements.txt",
Patryk Jakuszew30f9d032020-06-05 23:37:34 +020098)
Serge Bazanski50e987c2021-07-11 12:32:36 +000099
Serge Bazanski4e534cc2021-06-29 19:16:45 +0000100load("@pydeps//:requirements.bzl", "install_deps")
Serge Bazanski97b5cd72023-07-28 17:14:50 +0000101
Serge Bazanski4e534cc2021-06-29 19:16:45 +0000102install_deps()
Patryk Jakuszew30f9d032020-06-05 23:37:34 +0200103
Serge Bazanski194b1c82020-09-25 20:24:17 +0000104# Setup Go toolchain.
Serge Bazanski50e987c2021-07-11 12:32:36 +0000105
Serge Bazanski97b5cd72023-07-28 17:14:50 +0000106# gazelle:repository_macro third_party/go/repositories.bzl%go_repositories
107# gazelle:repository go_repository name=hscloud importpath=code.hackerspace.pl/hscloud
108go_repositories()
Serge Bazanski194b1c82020-09-25 20:24:17 +0000109
Serge Bazanski97b5cd72023-07-28 17:14:50 +0000110load("@bazel_gazelle//:deps.bzl", "go_repository")
111
112go_repository(
113 name = "org_golang_x_mod",
114 build_external = "external",
115 importpath = "golang.org/x/mod",
116 sum = "h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=",
117 version = "v0.10.0",
118)
119
120go_rules_dependencies()
121
122go_register_toolchains(go_version = "1.20.5")
123
Bartosz Stebelcae27ec2020-07-03 07:05:15 +0200124http_archive(
125 name = "com_github_grpc_grpc",
Serge Bazanski97b5cd72023-07-28 17:14:50 +0000126 patch_args = ["-p1"],
127 patches = [
128 "//third_party:grpc_extra_deps.patch",
129 ],
130 sha256 = "931f07db9d48cff6a6007c1033ba6d691fe655bea2765444bc1ad974dfc840aa",
131 strip_prefix = "grpc-1.56.2",
132 urls = ["https://github.com/grpc/grpc/archive/v1.56.2.tar.gz"],
Bartosz Stebelcae27ec2020-07-03 07:05:15 +0200133)
134
Serge Bazanski194b1c82020-09-25 20:24:17 +0000135# Load grpc deps after Go, to prevent overriding Go toolchains/SDK.
Bartosz Stebelcae27ec2020-07-03 07:05:15 +0200136load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
Serge Bazanski1572e522020-12-03 23:19:28 +0100137
Bartosz Stebelcae27ec2020-07-03 07:05:15 +0200138grpc_deps()
Serge Bazanski1572e522020-12-03 23:19:28 +0100139
Bartosz Stebelcae27ec2020-07-03 07:05:15 +0200140load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
Serge Bazanski1572e522020-12-03 23:19:28 +0100141
Bartosz Stebelcae27ec2020-07-03 07:05:15 +0200142grpc_extra_deps()
Sergiusz Bazanski0c3b9a52020-06-21 01:26:22 +0200143
Serge Bazanski97b5cd72023-07-28 17:14:50 +0000144load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
Serge Bazanski39437442021-10-07 18:45:20 +0000145
Patryk Jakuszew30f9d032020-06-05 23:37:34 +0200146gazelle_dependencies()
147
Serge Bazanski2ce36762019-07-14 16:29:52 +0200148# Docker rules
149
150http_archive(
151 name = "io_bazel_rules_docker",
Serge Bazanski97b5cd72023-07-28 17:14:50 +0000152 sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
153 urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"],
Serge Bazanski2ce36762019-07-14 16:29:52 +0200154)
155
Sergiusz Bazanski356ea8b2019-07-21 23:56:43 +0200156load("@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", docker_toolchain_configure = "toolchain_configure")
Serge Bazanski2ce36762019-07-14 16:29:52 +0200157load(
158 "@io_bazel_rules_docker//repositories:repositories.bzl",
159 container_repositories = "repositories",
160)
Serge Bazanski1572e522020-12-03 23:19:28 +0100161
Serge Bazanski2ce36762019-07-14 16:29:52 +0200162container_repositories()
Sergiusz Bazanski8fe651b2019-07-21 23:50:05 +0200163
Bartosz Stebelf5b1a212023-02-04 23:47:44 +0100164load(
165 "@io_bazel_rules_docker//python3:image.bzl",
166 _py_image_repos = "repositories",
167)
168
169_py_image_repos()
170
Sergiusz Bazanski65865332019-05-18 16:23:45 +0200171# Docker base images
172
173load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
Sergiusz Bazanskia7e26cc2019-06-21 20:38:35 +0200174
Sergiusz Bazanski65865332019-05-18 16:23:45 +0200175container_pull(
Bartosz Stebelf5b1a212023-02-04 23:47:44 +0100176 name = "python-debian",
177 digest = "sha256:cfa3b79333c4e56fc675b6800445b6dcbb3e6cd4d52f2a9ade944ab73dadc6a1",
178 registry = "index.docker.io",
179 repository = "python",
Serge Bazanskidacb7782024-01-15 12:53:30 +0000180 tag = "3.10-bullseye", # use the same version as in python_register_toolchains
Bartosz Stebelf5b1a212023-02-04 23:47:44 +0100181)
182
Bartosz Stebelf5b1a212023-02-04 23:47:44 +0100183container_pull(
Sergiusz Bazanski65865332019-05-18 16:23:45 +0200184 name = "prodimage-bionic",
Serge Bazanski39437442021-10-07 18:45:20 +0000185 digest = "sha256:1cd1f84169b8e1414a5d511b42909f2d540831c67b6799ae9af8cd6a80d75b5f",
Serge Bazanskib2d6b112019-07-30 13:07:04 +0200186 registry = "registry.k0.hswaw.net",
187 repository = "q3k/prodimage",
Serge Bazanskiec71cb52019-08-22 18:13:13 +0200188 tag = "20190822-1227",
Sergiusz Bazanski65865332019-05-18 16:23:45 +0200189)
190
Sergiusz Bazanskia7e26cc2019-06-21 20:38:35 +0200191container_pull(
Serge Bazanskia63c3152021-12-26 10:26:42 +0000192 name = "prodimage-focal",
193 digest = "sha256:fb6159a3ddf2f783092f1169792d1fba6f108714026ad2aa08204e8356825a13",
194 registry = "registry.k0.hswaw.net",
195 repository = "q3k/prodimage-focal",
196 tag = "20211214-0108",
197)
198
199container_pull(
Serge Bazanski2ceb69f2023-10-08 12:27:44 +0000200 name = "gerrit-3.7.5",
201 digest = "sha256:3705f3cb365bf53a8e310dd7e09c8fb44a073e1266dc0e713b6fdc04c91ab9f2",
Sergiusz Bazanskia7e26cc2019-06-21 20:38:35 +0200202 registry = "index.docker.io",
203 repository = "gerritcodereview/gerrit",
Serge Bazanski2ceb69f2023-10-08 12:27:44 +0000204 tag = "3.7.5-ubuntu20",
Sergiusz Bazanskia7e26cc2019-06-21 20:38:35 +0200205)
206
Sergiusz Bazanski48050572020-05-10 21:34:10 +0200207# third_party/factorio
208load("//third_party/factorio:factorio.bzl", "factorio_repositories")
Serge Bazanski1572e522020-12-03 23:19:28 +0100209
Sergiusz Bazanski48050572020-05-10 21:34:10 +0200210factorio_repositories()
Sergiusz Bazanski59786c52020-04-01 02:05:42 +0200211
Sergiusz Bazanski222a00a2020-04-12 18:37:21 +0200212# For devtools/gerrit/gerrit-oauth-provider and gerrit OWNERS plugin
Sergiusz Bazanski573da782019-06-21 19:59:52 +0200213
214git_repository(
215 name = "com_googlesource_gerrit_bazlets",
Serge Bazanski49431e82023-10-27 20:59:04 +0200216 # change 389378, https://gerrit-review.googlesource.com/c/bazlets/+/389378
217 commit = "0c120e55519b103477b6e0b0ce9130cd6f19abff",
Serge Bazanski39437442021-10-07 18:45:20 +0000218 remote = "https://gerrit.googlesource.com/bazlets",
Bartosz Stebel0e2057f2020-12-28 21:40:09 +0100219 shallow_since = "1606931369 -0600",
Sergiusz Bazanski573da782019-06-21 19:59:52 +0200220)
221
Serge Bazanski2ceb69f2023-10-08 12:27:44 +0000222# Force newer version of Gerrit plugin API.
Sergiusz Bazanski0c3b9a52020-06-21 01:26:22 +0200223load("@com_googlesource_gerrit_bazlets//:gerrit_api.bzl", "gerrit_api")
Serge Bazanskidacb7782024-01-15 12:53:30 +0000224
Serge Bazanski2ceb69f2023-10-08 12:27:44 +0000225gerrit_api(
Serge Bazanski49431e82023-10-27 20:59:04 +0200226 acceptance_framework_sha1 = "aa51456eda49f928217de4bd46e4af8fbea8c4f1",
Serge Bazanskidacb7782024-01-15 12:53:30 +0000227 plugin_api_sha1 = "1ea41f95da74045c2cdb30d359041a79b61e72ff",
228 version = "3.7.5",
Serge Bazanski2ceb69f2023-10-08 12:27:44 +0000229)
Sergiusz Bazanski573da782019-06-21 19:59:52 +0200230
Serge Bazanski50e987c2021-07-11 12:32:36 +0000231load("//devtools/gerrit/gerrit-oauth-provider:external_plugin_deps.bzl", gerrit_oauth_deps = "external_plugin_deps")
232
233gerrit_oauth_deps(omit_commons_codec = False)
Sergiusz Bazanski222a00a2020-04-12 18:37:21 +0200234
235# Gerrit OWNERS plugins external repositories
236
237git_repository(
238 name = "com_googlesource_gerrit_plugin_owners",
Serge Bazanski2ceb69f2023-10-08 12:27:44 +0000239 commit = "6db2d3f048f56fa49469d315b716787d21f8393f",
Serge Bazanski2ceb69f2023-10-08 12:27:44 +0000240 patch_args = ["-p1"],
241 patches = [
242 "//third_party:gerrit_plugins_owner.patch",
243 ],
Serge Bazanskidacb7782024-01-15 12:53:30 +0000244 remote = "https://gerrit.googlesource.com/plugins/owners/",
245 shallow_since = "1593642470 +0200",
Sergiusz Bazanski222a00a2020-04-12 18:37:21 +0200246)
Serge Bazanski50e987c2021-07-11 12:32:36 +0000247
248load("@com_googlesource_gerrit_plugin_owners//:external_plugin_deps_standalone.bzl", gerrit_owners_deps = "external_plugin_deps_standalone")
249
Serge Bazanskifaa326a2020-12-17 23:32:42 +0100250gerrit_owners_deps()
Sergiusz Bazanski222a00a2020-04-12 18:37:21 +0200251
Sergiusz Bazanski356ea8b2019-07-21 23:56:43 +0200252# Go image repos for Docker
253
Serge Bazanski97b5cd72023-07-28 17:14:50 +0000254load(
255 "@io_bazel_rules_docker//go:image.bzl",
256 go_image_repos = "repositories",
257)
Serge Bazanski1572e522020-12-03 23:19:28 +0100258
Serge Bazanski97b5cd72023-07-28 17:14:50 +0000259go_image_repos()
Sergiusz Bazanski0037eda2020-06-13 22:43:06 +0200260
Serge Bazanski19c8b602022-02-01 09:36:47 +0000261# //hswaw/site deps.
262load("//hswaw/site:deps.bzl", "hswaw_site_deps")
Serge Bazanski97b5cd72023-07-28 17:14:50 +0000263
Serge Bazanski19c8b602022-02-01 09:36:47 +0000264hswaw_site_deps()
Serge Bazanski39437442021-10-07 18:45:20 +0000265
266# noVNC, used by //dc/drackvm.
267http_archive(
268 name = "com_github_novnc_novnc",
269 build_file_content = """
270filegroup(
271 name = "distfiles",
272 srcs = [
273 "vnc.html",
274 ] + glob([
275 "app/**",
276 "core/**",
277 "vendor/**",
278 ]),
279 visibility = ["//visibility:public"],
280)
281""",
Serge Bazanski39437442021-10-07 18:45:20 +0000282 sha256 = "2c972cca34376dfd2a54939e7e571e466511bf592d03e838440b3c8868441eaf",
283 strip_prefix = "noVNC-1.3.0-beta",
Serge Bazanskid01f9e52021-10-07 19:24:31 +0000284 urls = ["https://github.com/novnc/noVNC/archive/refs/tags/v1.3.0-beta.tar.gz"],
Serge Bazanski1f062302021-06-01 22:24:34 +0000285)
Bartosz Stebel12f176c2021-06-18 13:12:41 +0200286
287# temporarily use upstream binary, see //cluster/tools/BUILD
288http_file(
289 name = "calicoctl_3_15",
290 downloaded_file_path = "calicoctl",
Bartosz Stebel12f176c2021-06-18 13:12:41 +0200291 executable = True,
Serge Bazanski97b5cd72023-07-28 17:14:50 +0000292 sha256 = "f49e9e8d25108f7f22d5a51c756b2fe40cbe36347ad297e31a767376172f2845",
293 urls = ["https://github.com/projectcalico/calicoctl/releases/download/v3.15.5/calicoctl"],
Bartosz Stebel12f176c2021-06-18 13:12:41 +0200294)
Serge Bazanskife94c9b2023-10-10 17:22:11 +0200295
296# viz.js 2.x used by //dc/topo
297load("//third_party:vizjs.bzl", "vizjs_repositories")
Serge Bazanskidacb7782024-01-15 12:53:30 +0000298
Serge Bazanskife94c9b2023-10-10 17:22:11 +0200299vizjs_repositories()
Serge Bazanski960b4342024-01-15 12:52:52 +0000300
301# buildifier and friends
302http_archive(
303 name = "com_github_bazelbuild_buildtools",
304 sha256 = "ae34c344514e08c23e90da0e2d6cb700fcd28e80c02e23e4d5715dddcb42f7b3",
305 strip_prefix = "buildtools-4.2.2",
306 urls = [
307 "https://github.com/bazelbuild/buildtools/archive/refs/tags/4.2.2.tar.gz",
308 ],
309)