From 5205d0830e4ed49027e9bb7a0c806ee46595f1b8 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Tue, 15 Sep 2026 09:48:28 -0700 Subject: [PATCH 1/4] devops: move docker publishing to Azure DevOps The GitHub Actions workflow failed to log in to Azure for v1.63.0. Port upstream's .azure-pipelines/publish-docker.yml (microsoft/playwright#41724). --- .azure-pipelines/publish-docker.yml | 114 ++++++++++++++++++ .azure-pipelines/settings.xml | 3 +- .../skills/playwright-java-release/SKILL.md | 2 +- .dockerignore | 3 + .github/workflows/publish_docker.yml | 30 ----- utils/docker/Dockerfile.jammy | 14 ++- utils/docker/Dockerfile.noble | 14 ++- utils/docker/Dockerfile.resolute | 14 ++- utils/docker/build.sh | 15 ++- utils/docker/publish_docker.sh | 75 ++++++------ 10 files changed, 208 insertions(+), 76 deletions(-) create mode 100644 .azure-pipelines/publish-docker.yml create mode 100644 .dockerignore delete mode 100644 .github/workflows/publish_docker.yml diff --git a/.azure-pipelines/publish-docker.yml b/.azure-pipelines/publish-docker.yml new file mode 100644 index 000000000..0848a3275 --- /dev/null +++ b/.azure-pipelines/publish-docker.yml @@ -0,0 +1,114 @@ +# Trigger: any `v*` release tag (e.g. v1.40.0). +# Can also be queued manually from the ADO UI, e.g. on a release-1.X branch +# whose Maven version has already been marked as 1.X.0. +trigger: + tags: + include: + - v* + exclude: + - v*-* + +pr: none + +resources: + repositories: + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines + parameters: + pool: + name: DevDivPlaywrightAzurePipelinesUbuntu2204 + os: linux + sdl: + sourceAnalysisPool: + name: DevDivPlaywrightAzurePipelinesWindows2022 + # The image must be windows-based due to restrictions of the SDL tools. See: https://aka.ms/AAo6v8e + os: windows + suppression: + suppressionFile: $(Build.SourcesDirectory)\.azure-pipelines\guardian\SDL\.gdnsuppress + stages: + - stage: Publish + jobs: + - job: PublishDocker + displayName: "Publish Docker images to ACR" + # arm64 images are cross-built under QEMU emulation, which is slow. + timeoutInMinutes: 360 + steps: + - checkout: self + displayName: "Checkout code" + + - task: UseNode@1 + inputs: + version: '26.x' + displayName: "Install Node.js" + + # Relocate the Docker data-root to the large /mnt volume: this job builds + # 6 images (jammy/noble/resolute x amd64/arm64) and `docker system prune`s + # between them, so the default disk fills up. + - task: Bash@3 + displayName: "Setup docker" + inputs: + targetType: "inline" + script: | + set -x + sudo service docker stop + sudo mkdir -p /etc/docker + echo '{ "data-root": "/mnt/docker" }' | sudo tee /etc/docker/daemon.json + sudo service docker start + + # Used by scripts/download_driver.sh on the host. The repository root is the + # Docker build context, so .dockerignore keeps this file out of the images. + - task: Bash@3 + displayName: "setup .npmrc" + inputs: + targetType: "inline" + script: | + echo "registry=https://devdiv.pkgs.visualstudio.com/DevDiv/_packaging/DevDiv_PublicPackages/npm/registry/" >> .npmrc + + - task: npmAuthenticate@0 + displayName: "authenticate the private npm registry" + inputs: + workingFile: .npmrc + + # Must run before MavenAuthenticate@0 so the credentials it injects into + # ~/.m2/settings.xml are not overwritten by the copy. + - bash: | + mkdir -p ~/.m2 + cp .azure-pipelines/settings.xml ~/.m2/settings.xml + displayName: 'Copy settings.xml (mirror Maven Central to DevDiv_PublicPackages)' + + - task: MavenAuthenticate@0 + displayName: 'Authenticate to DevDiv_PublicPackages feed' + inputs: + artifactsFeeds: DevDiv_PublicPackages + + - task: AzureCLI@2 + displayName: "Login to ACR via OIDC" + inputs: + azureSubscription: "Playwright-CDN" + scriptType: "bash" + scriptLocation: "inlineScript" + inlineScript: "az acr login --name playwright" + + - task: Bash@3 + displayName: "Register QEMU (binfmt) for arm64 cross-build" + inputs: + targetType: "inline" + script: "docker run --rm --privileged ${ACR_CACHE_PREFIX}tonistiigi/binfmt --install arm64" + env: + ACR_CACHE_PREFIX: "playwright.azurecr.io/cached/" + + - task: Bash@3 + displayName: "Build & publish Docker images" + inputs: + targetType: "inline" + # The authenticated settings.xml is passed to `docker build` as a secret so + # that Maven inside the image also resolves from DevDiv_PublicPackages. + script: "MAVEN_SETTINGS_SECRET=\"$HOME/.m2/settings.xml\" ./utils/docker/publish_docker.sh stable" + env: + ACR_CACHE_PREFIX: "playwright.azurecr.io/cached/" + UBUNTU_MIRROR_PREFIX: "azure." diff --git a/.azure-pipelines/settings.xml b/.azure-pipelines/settings.xml index 34e9be56f..1617d36e9 100644 --- a/.azure-pipelines/settings.xml +++ b/.azure-pipelines/settings.xml @@ -1,6 +1,7 @@