forked from NVIDIA/nvcf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
120 lines (104 loc) · 7.47 KB
/
Copy pathMODULE.bazel
File metadata and controls
120 lines (104 loc) · 7.47 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
# SPDX-FileCopyrightText: Copyright (c) NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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.
"""NVCF monorepo Bazel module definition.
Phase 1 scope: native Go subtrees only.
- src/clis/nvcf-cli (Go binary)
- src/libraries/go/lib (Go library)
- src/libraries/go/worker (Go worker library)
Subtrees with authoritative_source: upstream in imports.yaml are intentionally
not wired here.
"""
module(
name = "nvcf",
version = "0.0.1",
)
bazel_dep(name = "rules_python", version = "1.4.1")
# ============================================================================
# OCI containers (multi-arch). Used by go_oci_image for nvcf-cli.
# ============================================================================
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_oci", version = "2.2.7")
bazel_dep(name = "rules_pkg", version = "1.2.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.19.3")
bazel_dep(name = "hermetic_cc_toolchain", version = "4.1.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
ignore_root_user_error = True,
python_version = "3.11",
)
# ============================================================================
# Prebuilt protoc toolchain.
#
# Without this, the proto_toolchain resolution that fires whenever any
# transitive dep declares a proto_library (today: grpc-gateway-v2's
# protoc-gen-openapiv2/options:options_proto) builds the entire C++
# protobuf compiler from source. That is ~1500 actions on a cold build
# and tens of MB of object files that get uploaded to Buildbarn for no
# benefit, since we only consume protoc as a tool.
#
# toolchains_protoc downloads the official prebuilt protoc binary from
# the protocolbuffers/protobuf GitHub releases for each host platform
# and registers a proto_toolchain that points at it. The C++ build of
# protoc is no longer reachable from any of our targets.
#
# Pinned alongside the protobuf module version (29.x) we resolve to.
# ============================================================================
bazel_dep(name = "toolchains_protoc", version = "0.6.1")
protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
protoc.toolchain(
google_protobuf = "com_google_protobuf",
version = "v29.0",
)
# ============================================================================
# Go
# ============================================================================
bazel_dep(name = "rules_go", version = "0.60.0")
bazel_dep(name = "gazelle", version = "0.48.0")
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.25.0")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_work = "//:go.work.bazel")
# use_repo entries below are auto-managed by `bazel mod tidy`. Re-run after
# adding new imports in nvcf-cli, src/libraries/go/lib, or
# src/libraries/go/worker.
use_repo(go_deps, "cat_dario_mergo", "com_github_aws_aws_sdk_go_v2", "com_github_aws_aws_sdk_go_v2_config", "com_github_aws_aws_sdk_go_v2_credentials", "com_github_aws_smithy_go", "com_github_awslabs_amazon_ecr_credential_helper_ecr_login", "com_github_carlmjohnson_versioninfo", "com_github_cenkalti_backoff_v4", "com_github_charmbracelet_bubbles", "com_github_charmbracelet_bubbletea", "com_github_charmbracelet_lipgloss", "com_github_dustin_go_humanize", "com_github_felixge_httpsnoop", "com_github_fsnotify_fsnotify", "com_github_go_co_op_gocron", "com_github_go_jose_go_jose_v4", "com_github_go_kit_kit", "com_github_go_viper_mapstructure_v2", "com_github_goccy_go_json", "com_github_golang_jwt_jwt_v5", "com_github_google_go_containerregistry", "com_github_google_shlex", "com_github_google_uuid", "com_github_gorilla_mux", "com_github_grpc_ecosystem_go_grpc_middleware", "com_github_grpc_ecosystem_grpc_gateway_v2", "com_github_hashicorp_go_cleanhttp", "com_github_hashicorp_go_retryablehttp", "com_github_hellofresh_health_go_v5", "com_github_jarcoal_httpmock", "com_github_kimmachinegun_automemlimit", "com_github_klauspost_compress", "com_github_madappgang_httplog", "com_github_madappgang_httplog_zap", "com_github_masterminds_semver_v3", "com_github_mattn_go_isatty", "com_github_mitchellh_go_homedir", "com_github_muesli_termenv", "com_github_nats_io_nats_go", "com_github_nats_io_nats_server_v2", "com_github_nats_io_nkeys", "com_github_nvidia_nvcf_src_libraries_go_lib", "com_github_oklog_oklog", "com_github_openzipkin_zipkin_go", "com_github_prometheus_client_golang", "com_github_prometheus_client_model", "com_github_quic_go_quic_go", "com_github_samber_lo", "com_github_senseyeio_duration", "com_github_sirupsen_logrus", "com_github_spf13_cobra", "com_github_spf13_pflag", "com_github_spf13_viper", "com_github_stretchr_testify", "com_github_urfave_cli_v2", "com_github_valyala_bytebufferpool", "com_github_volcengine_volcengine_go_sdk", "in_gopkg_yaml_v3", "in_yaml_go_yaml_v3", "io_k8s_api", "io_k8s_apiextensions_apiserver", "io_k8s_apimachinery", "io_k8s_client_go", "io_k8s_sigs_yaml", "io_opentelemetry_go_contrib_instrumentation_github_com_gorilla_mux_otelmux", "io_opentelemetry_go_contrib_instrumentation_google_golang_org_grpc_otelgrpc", "io_opentelemetry_go_contrib_instrumentation_host", "io_opentelemetry_go_contrib_instrumentation_net_http_httptrace_otelhttptrace", "io_opentelemetry_go_contrib_instrumentation_net_http_otelhttp", "io_opentelemetry_go_otel", "io_opentelemetry_go_otel_exporters_otlp_otlptrace_otlptracegrpc", "io_opentelemetry_go_otel_exporters_prometheus", "io_opentelemetry_go_otel_sdk", "io_opentelemetry_go_otel_sdk_metric", "io_opentelemetry_go_otel_trace", "io_opentelemetry_go_proto_otlp", "land_oras_oras_go_v2", "org_golang_google_genproto_googleapis_rpc", "org_golang_google_grpc", "org_golang_google_grpc_cmd_protoc_gen_go_grpc", "org_golang_google_protobuf", "org_golang_x_net", "org_golang_x_oauth2", "org_golang_x_sync", "org_golang_x_term", "org_uber_go_automaxprocs", "org_uber_go_zap")
# ============================================================================
# C++ cross-compilation (multi-arch container builds).
# Only register the cross toolchain; native arch uses host gcc.
# ============================================================================
zig = use_extension("@hermetic_cc_toolchain//toolchain:ext.bzl", "toolchains")
use_repo(zig, "zig_sdk")
register_toolchains(
"@zig_sdk//toolchain:linux_arm64_gnu.2.38",
)
# ============================================================================
# OCI base images (pinned by digest).
# ============================================================================
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "ubuntu_noble",
digest = "sha256:ef59d9e82939bbce08973bdffb8761b025f75369fb7d2882cdc4938b5a9e992e",
image = "public.ecr.aws/ubuntu/ubuntu",
platforms = [
"linux/arm64/v8",
"linux/amd64",
],
)
use_repo(
oci,
"ubuntu_noble",
"ubuntu_noble_linux_amd64",
"ubuntu_noble_linux_arm64_v8",
)