Skip to content

Commit 2acffa0

Browse files
authored
Merge branch 'main' into renovate
2 parents efcd9c8 + afbeafb commit 2acffa0

196 files changed

Lines changed: 33049 additions & 22791 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelversion

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
6.5.0
1+
8.4.1
2+
# Switch these two versions if bzlmod doesn't work (let us know too)
3+
6.5.0

.github/workflows/generatedcode.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jobs:
2828
- name: Check Diff
2929
run: |
3030
if test -n "$(git status --porcelain)"; then
31-
git diff HEAD
31+
# MODULE.bazel.lock file can change due to rules_python dependency packages.
32+
git diff HEAD -- ':(exclude)MODULE.bazel.lock'
3233
exit 1
3334
fi
3435
protos:
@@ -50,6 +51,7 @@ jobs:
5051
- name: Check Diff
5152
run: |
5253
if test -n "$(git status --porcelain)"; then
53-
git diff HEAD
54+
# MODULE.bazel.lock file can change due to rules_python dependency packages.
55+
git diff HEAD -- ':(exclude)MODULE.bazel.lock'
5456
exit 1
5557
fi

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
bazel-*
2-
kne/*config.yaml
3-
go.work
4-
go.work.sum
2+
kne/*config.yaml

BUILD

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
load("@bazel_gazelle//:def.bzl", "gazelle")
1+
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_test")
22
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
33

4+
# gazelle:go_grpc_compilers @io_bazel_rules_go//proto:go_grpc_v2, @io_bazel_rules_go//proto:go_proto
45
# gazelle:prefix github.com/openconfig/lemming
5-
# gazelle:resolve proto proto google/rpc/status.proto @googleapis//google/rpc:status_proto
6-
# gazelle:resolve proto go google/rpc/status.proto @org_golang_google_genproto_googleapis_rpc//status
7-
# gazelle:resolve go github.com/p4lang/p4runtime/go/p4/v1 @com_github_p4lang_p4runtime//:p4runtime_go_proto
6+
# gazelle:resolve proto go google/rpc/status.proto @org_golang_google_genproto_googleapis_rpc//status
7+
# gazelle:resolve proto google/rpc/status.proto @googleapis//google/rpc:status_proto
88
# gazelle:build_file_name BUILD
9+
# gazelle:exclude github.com/p4lang/p4runtime
910
gazelle(
1011
name = "gazelle",
1112
)

MODULE.bazel

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
module(
2+
name = "openconfig_lemming",
3+
version = "0.0.0",
4+
)
5+
6+
bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2")
7+
bazel_dep(name = "gazelle", version = "0.45.0", repo_name = "bazel_gazelle")
8+
bazel_dep(name = "glog", version = "0.7.1", repo_name = "com_github_google_glog")
9+
bazel_dep(name = "googleapis", version = "0.0.0-20240819-fe8ba054a")
10+
bazel_dep(name = "grpc", version = "1.70.1", repo_name = "com_github_grpc_grpc")
11+
bazel_dep(name = "openconfig_gnmi", version = "0.14.1", repo_name = "com_github_openconfig_gnmi")
12+
bazel_dep(name = "p4runtime", version = "0.0.0", repo_name = "p4runtime_protos")
13+
bazel_dep(name = "platforms", version = "1.0.0")
14+
bazel_dep(name = "protobuf", version = "29.3", repo_name = "com_google_protobuf")
15+
bazel_dep(name = "re2", version = "2024-07-02.bcr.1")
16+
bazel_dep(name = "rules_go", version = "0.57.0", repo_name = "io_bazel_rules_go")
17+
bazel_dep(name = "rules_pkg", version = "1.1.0")
18+
bazel_dep(name = "rules_proto", version = "7.0.2")
19+
bazel_dep(name = "rules_proto_grpc_go", version = "5.0.1")
20+
bazel_dep(name = "rules_cc", version = "0.1.1")
21+
bazel_dep(name = "rules_distroless", version = "0.5.1")
22+
bazel_dep(name = "rules_oci", version = "2.2.5")
23+
24+
archive_override(
25+
module_name = "p4runtime",
26+
integrity = "sha256-n2T6gGjkKtl5QRzJWhTjYG1G4Z6wjuUJszs+XAVBqmc=",
27+
patches = ["//patches:p4.patch"],
28+
strip_prefix = "p4runtime-a60ccfd3128061d3d8c9b8bcda558cdd9bf9858e/proto",
29+
urls = ["https://github.com/p4lang/p4runtime/archive/a60ccfd3128061d3d8c9b8bcda558cdd9bf9858e.zip"],
30+
)
31+
32+
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
33+
34+
http_archive(
35+
name = "com_github_opencomputeproject_sai",
36+
build_file_content = """
37+
cc_library(
38+
name = "sai",
39+
hdrs = glob(["inc/*.h","experimental/*.h"]),
40+
includes = ["inc", "experimental"],
41+
visibility = ["//visibility:public"],
42+
)
43+
""",
44+
patch_args = ["-p1"],
45+
patches = ["//patches:sai.patch"],
46+
sha256 = "4e3a1d010bda0c589db46e077725a2cd9624a5cc255c89d1caa79deb408d1fa7",
47+
strip_prefix = "SAI-1.14.0",
48+
urls = ["https://github.com/opencomputeproject/SAI/archive/refs/tags/v1.14.0.tar.gz"],
49+
)
50+
51+
######################################
52+
######### Python ####################
53+
######################################
54+
bazel_dep(name = "rules_python", version = "1.3.0")
55+
56+
# This prevents "current user is root" build failures in Cloud Build Presubmit
57+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
58+
python.toolchain(
59+
ignore_root_user_error = True,
60+
is_default = True,
61+
python_version = "3.11",
62+
)
63+
64+
######################################
65+
######### Golang ####################
66+
######################################
67+
go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
68+
go_sdk.download(version = "1.24.2")
69+
70+
go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
71+
go_deps.from_file(go_work = "//:go.work")
72+
use_repo(
73+
go_deps,
74+
"com_github_fatih_color",
75+
"com_github_go_logr_logr",
76+
"com_github_golang_glog",
77+
"com_github_google_go_cmp",
78+
"com_github_google_gopacket",
79+
"com_github_google_uuid",
80+
"com_github_googleapis_gax_go_v2",
81+
"com_github_googlecloudplatform_opentelemetry_operations_go_exporter_metric",
82+
"com_github_googlecloudplatform_opentelemetry_operations_go_exporter_trace",
83+
"com_github_grpc_ecosystem_go_grpc_middleware_v2",
84+
"com_github_kentik_patricia",
85+
"com_github_mdlayher_genetlink",
86+
"com_github_open_traffic_generator_snappi_gosnappi",
87+
"com_github_openconfig_gnoi",
88+
"com_github_openconfig_gnoigo",
89+
"com_github_openconfig_gnsi",
90+
"com_github_openconfig_goyang",
91+
"com_github_openconfig_gribi",
92+
"com_github_openconfig_gribigo",
93+
"com_github_openconfig_kne",
94+
"com_github_openconfig_magna",
95+
"com_github_openconfig_ondatra",
96+
"com_github_openconfig_testt",
97+
"com_github_openconfig_ygnmi",
98+
"com_github_openconfig_ygot",
99+
"com_github_osrg_gobgp_v3",
100+
"com_github_p4lang_p4runtime",
101+
"com_github_sirupsen_logrus",
102+
"com_github_spf13_cobra",
103+
"com_github_spf13_pflag",
104+
"com_github_spf13_viper",
105+
"com_github_stoewer_go_strcase",
106+
"com_github_vishvananda_netlink",
107+
"com_google_cloud_go_cloudbuild",
108+
"com_google_cloud_go_logging",
109+
"com_google_cloud_go_monitoring",
110+
"com_google_cloud_go_trace",
111+
"in_gopkg_yaml_v3",
112+
"io_k8s_api",
113+
"io_k8s_apimachinery",
114+
"io_k8s_client_go",
115+
"io_k8s_klog",
116+
"io_k8s_klog_v2",
117+
"io_k8s_sigs_controller_runtime",
118+
"io_k8s_utils",
119+
"io_opentelemetry_go_contrib_detectors_gcp",
120+
"io_opentelemetry_go_contrib_instrumentation_google_golang_org_grpc_otelgrpc",
121+
"io_opentelemetry_go_otel",
122+
"io_opentelemetry_go_otel_exporters_stdout_stdoutlog",
123+
"io_opentelemetry_go_otel_log",
124+
"io_opentelemetry_go_otel_sdk",
125+
"io_opentelemetry_go_otel_sdk_log",
126+
"io_opentelemetry_go_otel_sdk_metric",
127+
"io_opentelemetry_go_otel_trace",
128+
"org_golang_google_api",
129+
"org_golang_google_genproto_googleapis_api",
130+
"org_golang_google_genproto_googleapis_rpc",
131+
"org_golang_google_grpc",
132+
"org_golang_google_grpc_cmd_protoc_gen_go_grpc",
133+
"org_golang_google_protobuf",
134+
"org_golang_x_oauth2",
135+
"org_golang_x_sys",
136+
"org_modernc_cc_v4",
137+
"org_uber_go_mock",
138+
)
139+
140+
switched_rules = use_extension("@googleapis//:extensions.bzl", "switched_rules")
141+
switched_rules.use_languages(
142+
cc = True,
143+
go = False,
144+
grpc = True,
145+
)
146+
use_repo(switched_rules, "com_google_googleapis_imports")
147+
148+
go_deps.gazelle_override(
149+
directives = [
150+
"gazelle:proto disable", # keep
151+
],
152+
path = "github.com/osrg/gobgp/v3",
153+
)
154+
155+
# Without clean, the `com_github_grpc_grpc` repo isn't visible causing build failure.
156+
go_deps.gazelle_override(
157+
build_file_generation = "clean",
158+
directives = [
159+
"gazelle:resolve go github.com/p4lang/p4runtime/go/p4/v1 @p4runtime_protos//:p4runtime_go_proto",
160+
"gazelle:proto disable", # keep
161+
],
162+
path = "github.com/p4lang/p4runtime",
163+
)
164+
165+
# Prevents `missing strict dependencies` error. May be resolved in future versions?
166+
go_deps.gazelle_override(
167+
build_file_generation = "clean",
168+
directives = [
169+
"gazelle:proto disable", # keep
170+
],
171+
path = "github.com/open-traffic-generator/snappi/gosnappi",
172+
)
173+
174+
# Caused by BUILD file being one directory up from the proto files.
175+
go_deps.gazelle_override(
176+
directives = [
177+
"gazelle:resolve_regexp go ^github.com/openconfig/attestz/proto/(tpm_attestz|tpm_enrollz)$ @com_github_openconfig_attestz//proto:${1}_go_proto",
178+
],
179+
path = "github.com/openconfig/ondatra",
180+
)
181+
go_deps.gazelle_override(
182+
build_file_generation = "clean",
183+
directives = [
184+
"gazelle:proto disable", # keep
185+
],
186+
path = "github.com/openconfig/bootz",
187+
)
188+
go_deps.gazelle_override(
189+
build_file_generation = "clean",
190+
directives = [
191+
"gazelle:proto disable", # keep
192+
],
193+
path = "github.com/openconfig/gnsi",
194+
)
195+
go_deps.gazelle_override(
196+
directives = [
197+
"gazelle:proto disable", # keep
198+
],
199+
path = "github.com/openconfig/gribi",
200+
)
201+
go_deps.gazelle_override(
202+
build_file_generation = "clean",
203+
directives = [
204+
"gazelle:proto disable", # keep
205+
],
206+
path = "github.com/openconfig/gnoi",
207+
)
208+
209+
######################################
210+
######### Linux ######################
211+
######################################
212+
213+
apt = use_extension(
214+
"@rules_distroless//apt:extensions.bzl",
215+
"apt",
216+
dev_dependency = True,
217+
)
218+
apt.install(
219+
name = "bookworm",
220+
lock = "//:bookworm.lock.json",
221+
manifest = "//:bookworm.yaml",
222+
)
223+
224+
# bazel run @bullseye//:lock
225+
use_repo(apt, "bookworm")
226+
227+
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
228+
oci.pull(
229+
name = "debian_bookworm",
230+
digest = "sha256:a92ed51e0996d8e9de041ca05ce623d2c491444df6a535a566dabd5cb8336946", # bookworm as of 06/20/24
231+
image = "debian",
232+
platforms = ["linux/amd64"],
233+
)
234+
oci.pull(
235+
name = "distroless_static_debug_nonroot",
236+
digest = "sha256:cb0459bf13af06cb3d3ee5dde5f1c5c34381cbce3a86bd08e1e7fd7a3ed28e59", # debug-nonroot as of 06/20/24
237+
image = "gcr.io/distroless/static",
238+
platforms = ["linux/amd64"],
239+
)
240+
use_repo(oci, "debian_bookworm", "debian_bookworm_linux_amd64", "distroless_static_debug_nonroot", "distroless_static_debug_nonroot_linux_amd64")

0 commit comments

Comments
 (0)