forked from buildfarm/buildfarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MODULE.bazel
235 lines (215 loc) · 8.14 KB
/
MODULE.bazel
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
"""Buildfarm build and test"""
module(
name = "build_buildfarm",
repo_name = "build_buildfarm",
)
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "blake3", version = "1.5.1.bcr.1")
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")
bazel_dep(name = "gazelle", version = "0.39.0")
bazel_dep(name = "grpc-java", version = "1.66.0")
bazel_dep(name = "googleapis", version = "0.0.0-20240819-fe8ba054a")
bazel_dep(name = "grpc-proto", version = "0.0.0-20240627-ec30f58", repo_name = "io_grpc_grpc_proto")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "protobuf", version = "29.0-rc1")
bazel_dep(name = "rules_cc", version = "0.0.10")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_java", version = "7.12.0")
bazel_dep(name = "rules_jvm_external", version = "6.4")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_oci", version = "1.7.4")
bazel_dep(name = "rules_pkg", version = "1.0.1")
# Test dependencies
bazel_dep(
name = "container_structure_test",
version = "1.19.1",
dev_dependency = True,
)
# TODO: remove this after https://github.com/bazelbuild/remote-apis/pull/293 is merged
bazel_dep(name = "bazel_remote_apis", version = "6777112ef7defa6705b1ebd2831d6c7efeb12ba2", repo_name = "remoteapis")
archive_override(
module_name = "bazel_remote_apis",
integrity = "sha256-PTtx9Vz9LjLvvUhv/n4QnksoD19BfqoFssrb3QvxcSE=",
strip_prefix = "remote-apis-6777112ef7defa6705b1ebd2831d6c7efeb12ba2",
urls = [
"https://github.com/bazelbuild/remote-apis/archive/6777112ef7defa6705b1ebd2831d6c7efeb12ba2.zip",
],
)
IO_NETTY_MODULES = [
# keep sorted
"buffer",
"codec",
"codec-http",
"codec-http2",
"codec-socks",
"common",
"handler",
"handler-proxy",
"resolver",
"transport",
"transport-classes-epoll",
"transport-classes-kqueue",
"transport-native-epoll",
"transport-native-kqueue",
"transport-native-unix-common",
]
IO_GRPC_MODULES = [
# keep sorted
"api",
"auth",
"context",
"core",
"netty",
"netty-shaded",
"protobuf",
"services",
"stub",
"testing",
]
COM_AWS_MODULES = [
# keep sorted
"core",
"s3",
"secretsmanager",
]
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = ["com.amazonaws:aws-java-sdk-%s:1.12.544" % module for module in COM_AWS_MODULES] + [
# keep sorted
"com.fasterxml.jackson.core:jackson-databind:2.15.0",
"com.github.ben-manes.caffeine:caffeine:2.9.0",
"com.github.docker-java:docker-java:3.3.3",
"com.github.docker-java:docker-java-api:3.3.3",
"com.github.docker-java:docker-java-core:3.3.3",
"com.github.jnr:jffi:1.3.11",
"com.github.jnr:jffi:jar:native:1.3.11",
"com.github.jnr:jnr-constants:0.10.4",
"com.github.jnr:jnr-ffi:2.2.14",
"com.github.jnr:jnr-posix:3.1.17",
"com.github.luben:zstd-jni:1.5.5-7",
"com.github.oshi:oshi-core:6.4.5",
"com.github.pcj:google-options:1.0.0",
"com.github.serceman:jnr-fuse:0.5.7",
"com.google.api.grpc:proto-google-common-protos:2.29.0",
"com.google.auth:google-auth-library-credentials:1.23.0",
"com.google.auth:google-auth-library-oauth2-http:1.23.0",
"com.google.code.findbugs:jsr305:3.0.2",
"com.google.code.gson:gson:2.11.0",
"com.google.errorprone:error_prone_annotations:2.28.0",
"com.google.errorprone:error_prone_core:2.28.0",
"com.google.guava:failureaccess:1.0.2",
"com.google.guava:guava:33.2.1-jre",
"com.google.j2objc:j2objc-annotations:3.0.0",
"com.google.protobuf:protobuf-java:3.19.1",
"com.google.protobuf:protobuf-java-util:3.19.1",
"com.googlecode.json-simple:json-simple:1.1.1",
"com.owteam.engUtils:netrc:2.0.1",
"commons-io:commons-io:2.15.1",
] + ["io.netty:netty-%s:4.1.108.Final" % module for module in IO_NETTY_MODULES] +
["io.grpc:grpc-%s:1.62.2" % module for module in IO_GRPC_MODULES] + [
# keep sorted
"io.prometheus:simpleclient:0.16.0",
"io.prometheus:simpleclient_hotspot:0.16.0",
"io.prometheus:simpleclient_httpserver:0.16.0",
"javax.annotation:javax.annotation-api:1.3.2",
"junit:junit:4.13.2",
"me.dinowernli:java-grpc-prometheus:0.6.0",
"net.javacrumbs.future-converter:future-converter-java8-guava:1.2.0",
"net.jcip:jcip-annotations:1.0",
"org.apache.commons:commons-compress:1.26.1",
"org.apache.commons:commons-lang3:3.13.0",
"org.apache.commons:commons-pool2:2.11.1",
"org.apache.httpcomponents:httpclient:4.5.14",
"org.apache.tomcat:annotations-api:6.0.53",
"org.bouncycastle:bcprov-jdk15on:1.70",
"org.checkerframework:checker-qual:3.38.0",
"org.jetbrains:annotations:16.0.2",
"org.mockito:mockito-core:5.10.0",
"org.openjdk.jmh:jmh-core:1.37",
"org.openjdk.jmh:jmh-generator-annprocess:1.37",
"org.projectlombok:lombok:1.18.30",
"org.redisson:redisson:3.23.4",
"org.slf4j:slf4j-simple:2.0.13",
"org.threeten:threetenbp:1.6.8",
"org.xerial:sqlite-jdbc:3.45.3.0",
"org.yaml:snakeyaml:2.2",
"redis.clients:jedis:5.1.2",
],
fail_if_repin_required = True, # TO RE-PIN: REPIN=1 bazel run @unpinned_maven//:pin
generate_compat_repositories = True,
lock_file = "//:maven_install.json",
repositories = [
"https://repo.maven.apache.org/maven2",
],
strict_visibility = True,
)
# Test only maven dependencies
[
maven.artifact(
testonly = True,
artifact = artifact,
group = group,
version = version,
)
for group, artifact, version in [coord.split(":") for coord in [
"com.github.fppt:jedis-mock:1.0.13",
"com.google.jimfs:jimfs:1.3.0",
"com.google.truth:truth:1.4.2",
]]
]
use_repo(
maven,
"maven",
"unpinned_maven",
)
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
# Server base image
oci.pull(
# This is a multi-arch image!
name = "amazon_corretto_java_image_base",
digest = "sha256:f0e6040a09168500a1e96d02fef42a26176aaec8e0f136afba081366cb98e2f6", # tag:21 as of today.
image = "public.ecr.aws/amazoncorretto/amazoncorretto",
platforms = [
"linux/amd64",
"linux/arm64/v8",
],
)
# Worker base image
oci.pull(
name = "ubuntu_lunar",
digest = "sha256:303223fbebbd1095df7299707ed8b0a51be5c0a7eee78292fc65ee2201c2e138", # tag: lunar
image = "index.docker.io/bazelbuild/buildfarm-worker-base",
)
use_repo(
oci,
"amazon_corretto_java_image_base",
"ubuntu_lunar",
)
# https://github.com/bazelbuild/rules_python/pull/713#issuecomment-1885628496
# Satisfy running tests in Docker as root.
bazel_dep(name = "rules_python", version = "0.31.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
configure_coverage_tool = False,
ignore_root_user_error = True,
python_version = "3.11",
)
build_deps = use_extension("//:extensions.bzl", "build_deps")
use_repo(
build_deps,
"bazel",
"opentelemetry",
"skip_sleep",
"tini",
)
# this is *only* required for bazel and should not be used in our repository
bazel_dep(name = "rules_proto", version = "6.0.0-rc2")
googleapis_switched_rules = use_extension("@googleapis//:extensions.bzl", "switched_rules")
googleapis_switched_rules.use_languages(
grpc = True,
java = True,
)
use_repo(googleapis_switched_rules, "com_google_googleapis_imports")
find_rpm = use_extension("@rules_pkg//toolchains/rpm:rpmbuild_configure.bzl", "find_system_rpmbuild_bzlmod")
use_repo(find_rpm, "rules_pkg_rpmbuild")
register_toolchains("@rules_pkg_rpmbuild//:all")