forked from buildbuddy-io/buildbuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WORKSPACE
290 lines (215 loc) · 8.25 KB
/
WORKSPACE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
workspace(
name = "buildbuddy",
managed_directories = {"@npm": ["node_modules"]},
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Go
http_archive(
name = "io_bazel_rules_go",
sha256 = "8e968b5fcea1d2d64071872b12737bbb5514524ee5f0a4f54f5920266c261acb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
],
)
http_archive(
name = "bazel_gazelle",
sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f",
# Keep version in sync with .github/workflows/checkstyle.yaml
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
],
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("@io_bazel_rules_go//go:deps.bzl", "go_download_sdk", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_download_sdk(
name = "go_sdk_linux",
goarch = "amd64",
goos = "linux",
version = "1.17.2", # Keep in sync with .github/workflows/checkstyle.yaml
)
go_download_sdk(
name = "go_sdk_darwin",
goarch = "amd64",
goos = "darwin",
version = "1.17.2",
)
go_download_sdk(
name = "go_sdk_darwin_arm64",
goarch = "arm64",
goos = "darwin",
version = "1.17.2",
)
go_register_toolchains(
nogo = "@//:vet",
)
load(":deps.bzl", "install_buildbuddy_dependencies")
# Install gazelle dependencies after ours so that our go module versions take precedence.
# gazelle:repository_macro deps.bzl%install_buildbuddy_dependencies
install_buildbuddy_dependencies()
gazelle_dependencies()
# Node
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "4501158976b9da216295ac65d872b1be51e3eeb805273e68c516d2eb36ae1fbb",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.1/rules_nodejs-4.4.1.tar.gz"],
)
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")
# M1 Macs require Node 16+
node_repositories(
node_version = "16.6.2",
)
yarn_install(
name = "npm",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
)
# @bazel/labs (for ts_proto_library)
load("@npm//@bazel/labs:package.bzl", "npm_bazel_labs_dependencies")
npm_bazel_labs_dependencies()
# Docker
http_archive(
name = "io_bazel_rules_docker",
sha256 = "59d5b42ac315e7eadffa944e86e90c2990110a1c8075f1cd145f487e999d22b3",
strip_prefix = "rules_docker-0.17.0",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.17.0/rules_docker-v0.17.0.tar.gz"],
)
load(
"@io_bazel_rules_docker//toolchains/docker:toolchain.bzl",
docker_toolchain_configure = "toolchain_configure",
)
docker_toolchain_configure(
name = "docker_config",
)
load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)
container_repositories()
load(
"@io_bazel_rules_docker//go:image.bzl",
_go_image_repos = "repositories",
)
_go_image_repos()
# rules_foreign_cc
http_archive(
name = "rules_foreign_cc",
sha256 = "e14a159c452a68a97a7c59fa458033cc91edb8224516295b047a95555140af5f",
strip_prefix = "rules_foreign_cc-0.4.0",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.4.0.tar.gz",
)
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
# This sets up some common toolchains for building targets. For more details, please see
# https://bazelbuild.github.io/rules_foreign_cc/0.4.0/flatten.html#rules_foreign_cc_dependencies
rules_foreign_cc_dependencies()
all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
# CPIO
http_archive(
name = "org_gnu_cpio",
build_file_content = all_content,
sha256 = "e87470d9c984317f658567c03bfefb6b0c829ff17dbf6b0de48d71a4c8f3db88",
strip_prefix = "cpio-2.13",
url = "https://ftp.gnu.org/gnu/cpio/cpio-2.13.tar.gz",
)
# Kubernetes
http_archive(
name = "io_bazel_rules_k8s",
sha256 = "51f0977294699cd547e139ceff2396c32588575588678d2054da167691a227ef",
strip_prefix = "rules_k8s-0.6",
urls = ["https://github.com/bazelbuild/rules_k8s/archive/v0.6.tar.gz"],
)
load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_defaults", "k8s_repositories")
k8s_repositories()
load("@io_bazel_rules_k8s//k8s:k8s_go_deps.bzl", k8s_go_deps = "deps")
k8s_go_deps()
k8s_defaults(
name = "k8s_deploy",
kind = "deployment",
)
# Proto
# NB: The name must be "com_google_protobuf".
http_archive(
name = "com_google_protobuf",
sha256 = "7c9731ff49ebe1cc4a0650a21d40acc099043f4d584b24632bafc0f5328bc3ff",
strip_prefix = "protobuf-3.19.0",
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v3.19.0/protobuf-all-3.19.0.zip"],
)
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
load("@io_bazel_rules_docker//contrib:dockerfile_build.bzl", "dockerfile_image")
dockerfile_image(
name = "default_execution_image",
dockerfile = "//dockerfiles/default_execution_image:Dockerfile",
visibility = ["//visibility:public"],
)
dockerfile_image(
name = "executor_image",
dockerfile = "//dockerfiles/executor_image:Dockerfile",
visibility = ["//visibility:public"],
)
dockerfile_image(
name = "nonroot_user_image",
dockerfile = "//dockerfiles/test_images/nonroot_user_image:Dockerfile",
visibility = ["//visibility:public"],
)
load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
container_pull(
name = "buildbuddy_go_image_base",
digest = "sha256:586e10ceb097684dcd3e455dbb6d4141f3dd28986719de487d76d4c7c9da1a35",
registry = "gcr.io",
repository = "distroless/base-debian10",
)
# Base image that can be used to build images that are capable of running the Bazel binary.
container_pull(
name = "bazel_image_base",
digest = "sha256:0b46c354f4f092a54570ece9031f9b780ffb4855d6ba3faf61c05c4cebe8957f",
registry = "gcr.io",
repository = "distroless/java-debian10",
)
dockerfile_image(
name = "ci_runner_image",
dockerfile = "//enterprise/dockerfiles/ci_runner_image:Dockerfile",
visibility = ["//visibility:public"],
)
dockerfile_image(
name = "ci_runner_debug_image",
dockerfile = "//enterprise/dockerfiles/ci_runner_image:debug.Dockerfile",
visibility = ["//visibility:public"],
)
# BuildBuddy Toolchain
http_archive(
name = "io_buildbuddy_buildbuddy_toolchain",
sha256 = "a2a5cccec251211e2221b1587af2ce43c36d32a42f5d881737db3b546a536510",
strip_prefix = "buildbuddy-toolchain-829c8a574f706de5c96c54ca310f139f4acda7dd",
urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/829c8a574f706de5c96c54ca310f139f4acda7dd.tar.gz"],
)
load("@io_buildbuddy_buildbuddy_toolchain//:deps.bzl", "buildbuddy_deps")
buildbuddy_deps()
load("@io_buildbuddy_buildbuddy_toolchain//:rules.bzl", "buildbuddy")
buildbuddy(name = "buildbuddy_toolchain")
http_archive(
name = "cloudprober",
build_file_content = "exports_files([\"cloudprober\"])",
sha256 = "0a824a6e224d9810514f4a2f4a13f09488672ad483bb0e978c16d8a6b3372625",
strip_prefix = "cloudprober-v0.11.2-ubuntu-x86_64",
urls = ["https://github.com/google/cloudprober/releases/download/v0.11.2/cloudprober-v0.11.2-ubuntu-x86_64.zip"],
)
# esbuild
load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories")
esbuild_repositories(npm_repository = "npm")
# Web testing
http_archive(
name = "io_bazel_rules_webtesting",
sha256 = "e9abb7658b6a129740c0b3ef6f5a2370864e102a5ba5ffca2cea565829ed825a",
urls = [
"https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.5/rules_webtesting.tar.gz",
],
)
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
web_test_repositories()
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.3.bzl", "browser_repositories")
browser_repositories(chromium = True)
load("@io_bazel_rules_webtesting//web:go_repositories.bzl", web_test_go_repositories = "go_repositories")
web_test_go_repositories()