Skip to content

Commit b684f20

Browse files
committed
Prefer DNS endpoint in CI for mirrored Go packages
1 parent d049f7e commit b684f20

12 files changed

Lines changed: 101 additions & 1 deletion

File tree

.adms/bazel/adms.mirror.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ allow depot-read-api-bzl.us1.ddbuild.io
99
allow depot-read-api-cli.us1.ddbuild.io
1010
allow depot-read-api-generic.us1.ddbuild.io
1111
allow depot-read-api-go.us1.ddbuild.io
12+
# Preferred first in GOPROXY (see .adms/go/gitlab.yaml); allow it here so Bazel's
13+
# downloader doesn't block it.
14+
allow depot-read-api-go.rapid-dependency-management-depot.all-clusters.local-dc.fabric.dog
1215
allow depot-read-api-java.us1.ddbuild.io
1316
allow depot-read-api-python.us1.ddbuild.io
1417
allow mass-read.us1.ddbuild.io

.adms/go/gitlab.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DO NOT EDIT
22

33
variables:
4-
GOPROXY: "https://depot-read-api-go.us1.ddbuild.io/magicmirror/magicmirror/@current/|https://depot-read-api-go.us1.ddbuild.io/magicmirror/testing/@current/|https://depot-read-api-go.us1.ddbuild.io/magicmirror/magicmirror/@current/|https://depot-read-api-go.us1.ddbuild.io/magicmirror/testing/@current/|https://depot-read-api-go.us1.ddbuild.io/magicmirror/magicmirror/@current/|https://depot-read-api-go.us1.ddbuild.io/magicmirror/testing/@current/"
4+
GOPROXY: "https://depot-read-api-go.rapid-dependency-management-depot.all-clusters.local-dc.fabric.dog:8443/magicmirror/magicmirror/@current/|https://depot-read-api-go.us1.ddbuild.io/magicmirror/magicmirror/@current/|https://depot-read-api-go.us1.ddbuild.io/magicmirror/testing/@current/|https://depot-read-api-go.us1.ddbuild.io/magicmirror/magicmirror/@current/|https://depot-read-api-go.us1.ddbuild.io/magicmirror/testing/@current/|https://depot-read-api-go.us1.ddbuild.io/magicmirror/magicmirror/@current/|https://depot-read-api-go.us1.ddbuild.io/magicmirror/testing/@current/"
55
GONOSUMDB: "github.com/DataDog,go.ddbuild.io"
66
GOPRIVATE: ""

.gitlab/.pre/common/macos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
before_script:
8585
- !reference [.vault_login]
8686
- !reference [.aws_retry_config]
87+
# Drop GOPROXY entries not usable from macOS runners, before any go command.
88+
- !reference [.sanitize_goproxy]
8789
# Selecting the current Go version
8890
- |
8991
eval $(gimme $(cat .go-version))

.gitlab/.pre/deps_fetch/deps_fetch.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@
33
# Contains jobs which fetch go dependencies, in order
44
# to reuse them in further jobs that need them.
55

6+
# Keep GOPROXY entries usable from the current environment; drop the rest.
7+
# See tools/ci/sanitize-goproxy.sh.
8+
.sanitize_goproxy:
9+
- . tools/ci/sanitize-goproxy.sh
10+
11+
# Windows host equivalent, for jobs that forward GOPROXY into a container.
12+
.sanitize_goproxy_windows:
13+
- . ./tools/ci/sanitize-goproxy.ps1
14+
615
.retrieve_linux_go_deps:
16+
- !reference [.sanitize_goproxy]
717
- mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache.tar.zst | tar xf - -C $GOPATH/pkg/mod/cache
818
- rm -f modcache.tar.zst
919

.gitlab/windows/build/binary_build/windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ build_windows_container_entrypoint:
1111
ARCH: "x64"
1212
script:
1313
- $ErrorActionPreference = "Stop"
14+
- !reference [.sanitize_goproxy_windows]
1415
- if (Test-Path build-out) { remove-item -recurse -force build-out }
1516
- >
1617
docker run --rm

.gitlab/windows/build/lint/windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
extends: .windows_docker_default
55
script:
66
- $ErrorActionPreference = "Stop"
7+
- !reference [.sanitize_goproxy_windows]
78
- !reference [.docker_pull_winbuildimage_instrumented]
89
# Previously this job required only 8Gb of memory but since Go 1.20 it requires more to avoid being OOM killed.
910
# Each Windows VM has 32Gb of memory and contains 3 runners that can run one job at a time each (so a maximum of 3 simultaneous jobs per VM).

.gitlab/windows/build/package_build/windows.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
needs: ["go_deps"]
66
script:
77
- $ErrorActionPreference = 'Stop'
8+
- !reference [.sanitize_goproxy_windows]
89
- if (Test-Path omnibus\pkg) { remove-item -recurse -force omnibus\pkg }
910
- mkdir omnibus\pkg
1011
- >
@@ -97,6 +98,7 @@ windows_msi_and_bosh_zip_x64-a7-fips:
9798
ARCH: "x64"
9899
script:
99100
- $ErrorActionPreference = "Stop"
101+
- !reference [.sanitize_goproxy_windows]
100102
- if (Test-Path omnibus\pkg) { remove-item -recurse -force omnibus\pkg }
101103
- mkdir omnibus\pkg
102104
- >

.gitlab/windows/build/source_test/windows.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- .bazel:defs:cache:windows
1212
script:
1313
- $ErrorActionPreference = "Stop"
14+
- !reference [.sanitize_goproxy_windows]
1415
# we pass in CI_JOB_URL and CI_JOB_NAME so that they can be added to additional tags
1516
# inside JUNIT_TAR and then later used by datadog-ci
1617
- !reference [.docker_pull_winbuildimage_instrumented]
@@ -81,6 +82,7 @@ tests_windows-x64:
8182
extends: [.windows_docker_default, .bazel:defs:cache:windows]
8283
script:
8384
- $ErrorActionPreference = "Stop"
85+
- !reference [.sanitize_goproxy_windows]
8486
- >
8587
.\tools\ci\docker-run-with-bazel-cache.ps1
8688
-m 16384M
@@ -109,6 +111,7 @@ tests_windows-x64:
109111
extends: [.windows_docker_default, .bazel:defs:cache:windows]
110112
script:
111113
- $ErrorActionPreference = "Stop"
114+
- !reference [.sanitize_goproxy_windows]
112115
- >
113116
.\tools\ci\docker-run-with-bazel-cache.ps1
114117
-m 16384M

.gitlab/windows/test/integration_test/windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Remove-Item "$tmpfile"
1515
script:
1616
- $ErrorActionPreference = "Stop"
17+
- !reference [.sanitize_goproxy_windows]
1718
# we pass in CI_JOB_URL and CI_JOB_NAME so that they can be added to additional tags
1819
# inside JUNIT_TAR and then later used by datadog-ci
1920
- >

Dockerfiles/agent-ddot/Dockerfile.agent-otel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ RUN apt-get update && \
4545
&& apt-get clean \
4646
&& rm -rf /var/lib/apt/lists/*
4747

48+
# Add the CA certificates needed to verify the GOPROXY endpoint used by the go
49+
# steps below.
50+
COPY --from=registry.ddbuild.io/images/datadog-ca-certs:standard /certs/ /usr/local/share/ca-certificates/
51+
# Make the staged certs non-world-writable, then register them in the trust store.
52+
RUN chmod -R o-w /usr/local/share/ca-certificates \
53+
&& update-ca-certificates
54+
4855
# Install Windows cross-compilation tools if building for Windows
4956
ARG PACKAGE_TYPE
5057
RUN if [ "$PACKAGE_TYPE" = "windows" ]; then \

0 commit comments

Comments
 (0)