Skip to content

Instrument docker pull for lint and tests on Windows #37719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitlab/common/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,13 @@
- DOCKER_LOGIN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $DOCKER_REGISTRY_RO user) || exit $?
- $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $DOCKER_REGISTRY_RO token | crane auth login --username "$DOCKER_LOGIN" --password-stdin "$DOCKER_REGISTRY_URL"
- EXIT="${PIPESTATUS[0]}"; if [ $EXIT -ne 0 ]; then echo "Unable to locate credentials needs gitlab runner restart"; exit $EXIT; fi


.docker_pull_winbuildimage_instrumented:
# We should be able to remove that download when the datadog-ci is available in the windows image
- Invoke-WebRequest -Uri "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_win-x64" -OutFile "datadog-ci.exe"
- $tmpfile = [System.IO.Path]::GetTempFileName()
- (& "$CI_PROJECT_DIR\tools\ci\fetch_secret.ps1" -parameterName "$API_KEY_ORG2" -tempFile "$tmpfile")
- If ($lastExitCode -ne "0") { exit "$lastExitCode" }
- $Env:DATADOG_API_KEY=$(cat "$tmpfile")
- ./datadog-ci.exe trace -- docker pull ${WINBUILDIMAGE}
1 change: 1 addition & 0 deletions .gitlab/lint/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
script:
- $ErrorActionPreference = "Stop"
- '$_instance_id = (iwr -UseBasicParsing http://169.254.169.254/latest/meta-data/instance-id).content ; Write-Host "Running on instance $($_instance_id)"'
- !reference [.docker_pull_winbuildimage_instrumented]
# Previously this job required only 8Gb of memory but since Go 1.20 it requires more to avoid being OOM killed.
# 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).
# Windows jobs are using either 8Gb or 16Gb of memory so we can limit memory to 16Gb on this job because even if we decided to limit to 10Gb for instance,
Expand Down
1 change: 1 addition & 0 deletions .gitlab/source_test/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- '$_instance_id = (iwr -UseBasicParsing http://169.254.169.254/latest/meta-data/instance-id).content ; Write-Host "Running on instance $($_instance_id)"'
# we pass in CI_JOB_URL and CI_JOB_NAME so that they can be added to additional tags
# inside JUNIT_TAR and then later used by datadog-ci
- !reference [.docker_pull_winbuildimage_instrumented]
- $FAST_TESTS_FLAG=""
- If ($FAST_TESTS -eq "true") { $FAST_TESTS_FLAG="--only-impacted-packages" }
- >
Expand Down
Loading