forked from privacysandbox/aggregation-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWORKSPACE.bzlmod
More file actions
164 lines (132 loc) · 5.55 KB
/
Copy pathWORKSPACE.bzlmod
File metadata and controls
164 lines (132 loc) · 5.55 KB
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
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Load specific version of differential privacy from github 2nd March 2022.
DIFFERENTIAL_PRIVACY_COMMIT = "099080e49c4c047802d785bc818898c0caf84d45"
# value recommended by the differential privacy repo.
# date, not after the specified commit to allow for more shallow clone of repo
# for faster build times.
DIFFERENTIAL_PRIVACY_SHALLOW_SINCE = "1618997113 +0200"
git_repository(
name = "com_google_differential_privacy",
commit = DIFFERENTIAL_PRIVACY_COMMIT,
remote = "https://github.com/google/differential-privacy.git",
shallow_since = DIFFERENTIAL_PRIVACY_SHALLOW_SINCE,
)
# Load dependencies for the base workspace.
load("@com_google_differential_privacy//:differential_privacy_deps.bzl", "differential_privacy_deps")
differential_privacy_deps()
############
# Go rules #
############
# Note: Go build rules are an indirect dependency of "io_bazel_rules_docker" and
# a direct dependency of rpmpack and buildifier. These rules are not used for
# deploying go code at the time of writing.
http_archive(
name = "io_bazel_rules_go",
sha256 = "6734a719993b1ba4ebe9806e853864395a8d3968ad27f9dd759c196b3eb3abe8",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.45.1/rules_go-v0.45.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.45.1/rules_go-v0.45.1.zip",
],
)
http_archive(
name = "bazel_gazelle",
integrity = "sha256-MpOL2hbmcABjA1R5Bj2dJMYO2o15/Uc5Vj9Q0zHLMgk=",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz",
],
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
go_rules_dependencies()
go_register_toolchains(version = "1.20.5")
gazelle_dependencies()
###################
# Container rules #
###################
# Note: these rules add a dependency on the golang toolchain and must be ordered
# after any `go_register_toolchains` calls in this file (or else the toolchain
# defined in io_bazel_rules_docker are used for future go toolchains)
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//repositories:repositories.bzl",
container_repositories = "repositories",
)
container_repositories()
load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")
container_deps()
load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
##############
# Containers #
##############
load("//build_defs:container_dependencies.bzl", container_dependencies = "CONTAINER_DEPS")
[
container_pull(
name = img_name,
digest = img_info["digest"],
registry = img_info["registry"],
repository = img_info["repository"],
)
for img_name, img_info in container_dependencies.items()
]
# Distroless image for running C++.
container_pull(
name = "cc_base",
registry = "gcr.io",
repository = "distroless/cc",
# Using SHA-256 for reproducibility.
# TODO: use digest instead of tag, currently it's not working.
tag = "latest",
)
# Distroless image for running statically linked binaries.
container_pull(
name = "static_base",
registry = "gcr.io",
repository = "distroless/static",
# Using SHA-256 for reproducibility.
# TODO: use digest instead of tag, currently it's not working.
tag = "latest",
)
# Debug image for Java used only for load testing.
container_pull(
name = "java_base_debug",
registry = "docker.io",
repository = "bellsoft/liberica-openjdk-debian",
tag = "latest",
)
###############################
# Binary Runtime Dependencies #
###############################
# Download the AWS enclave SDK repo and apply a patch for building the kmstool dependencies.
# load("@shared_libraries//build_defs/shared:enclaves_kmstools.bzl", "import_aws_nitro_enclaves_sdk_c")
# import_aws_nitro_enclaves_sdk_c(repo_name = "@shared_libraries")
# http_archive(
# name = "aws_nitro_enclaves_sdk_c",
# build_file = Label("//build_defs/aws/kmstool:kmstool.BUILD"),
# patches = [
# Label("//build_defs/aws/kmstool:kmstool.patch"),
# Label("//build_defs/aws/kmstool:dockerfile_git_shallow_clone.patch"),
# ],
# patch_args = ["-p1"],
# sha256 = "bc937626e1058c2464e60dde3a410855b87987e6da23433d78e77aedc8a152ec",
# strip_prefix = "aws-nitro-enclaves-sdk-c-e3425251b5fd573a730101b091f770ad21b9ee56",
# urls = ["https://github.com/aws/aws-nitro-enclaves-sdk-c/archive/e3425251b5fd573a730101b091f770ad21b9ee56.zip"],
# )