Skip to content
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

Use mirrored buildx for PRs Only #4753

Merged
merged 4 commits into from
Dec 17, 2024
Merged
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
1 change: 1 addition & 0 deletions build/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ stages:
parameters:
tag: $(build.BuildNumber)
buildPlatform: $(publicDockerImagePlatforms)
multiplePlatforms: true
1 change: 1 addition & 0 deletions build/ci-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ stages:
parameters:
tag: $(ImageTag)
buildPlatform: $(publicDockerImagePlatforms)
multiplePlatforms: true

- stage: provisionEnvironment
displayName: Provision Environment
Expand Down
1 change: 1 addition & 0 deletions build/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ stages:
parameters:
tag: $(ImageTag)
buildPlatform: $(publicDockerImagePlatforms)
multiplePlatforms: true

# *********************** Stu3 ***********************
- stage: redeployStu3
Expand Down
6 changes: 6 additions & 0 deletions build/jobs/docker-build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,34 @@ parameters:
type: string
- name: buildPlatform
type: string
- name: multiplePlatforms
type: boolean

jobs:
- template: docker-build-push.yml
parameters:
version: "R4"
tag: ${{parameters.tag}}
buildPlatform: ${{parameters.buildPlatform}}
multiplePlatforms: ${{parameters.multiplePlatforms}}

- template: docker-build-push.yml
parameters:
version: "R4B"
tag: ${{parameters.tag}}
buildPlatform: ${{parameters.buildPlatform}}
multiplePlatforms: ${{parameters.multiplePlatforms}}

- template: docker-build-push.yml
parameters:
version: "Stu3"
tag: ${{parameters.tag}}
buildPlatform: ${{parameters.buildPlatform}}
multiplePlatforms: ${{parameters.multiplePlatforms}}

- template: docker-build-push.yml
parameters:
version: "R5"
tag: ${{parameters.tag}}
buildPlatform: ${{parameters.buildPlatform}}
multiplePlatforms: ${{parameters.multiplePlatforms}}
10 changes: 9 additions & 1 deletion build/jobs/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ parameters:
type: string
- name: buildPlatform
type: string
- name: multiplePlatforms
type: boolean

jobs:
- job: '${{parameters.version}}_Docker'
Expand All @@ -22,7 +24,13 @@ jobs:
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
docker pull mirror.gcr.io/moby/buildkit:buildx-stable-1
if [ "${{ parameters.multiplePlatforms }}" = "true" ]; then
echo "Running multi-platform build. Will pull buildx from dockerhub."
else
echo "Running single-platform build, pulling buildx from mirror to avoid throttling."
docker pull mirror.gcr.io/moby/buildkit:buildx-stable-1
fi

TAG="$(azureContainerRegistry)/${{parameters.version}}_fhir-server:${{parameters.tag}}"
az acr login --name $(azureContainerRegistryName)
docker buildx create --name fhir-multi-platform --platform ${{parameters.buildPlatform}} --use --bootstrap
Expand Down
1 change: 1 addition & 0 deletions build/pr-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ stages:
parameters:
tag: $(ImageTag)
buildPlatform: $(testDockerImagePlatforms)
multiplePlatforms: false

- stage: provisionEnvironment
displayName: Provision Environment
Expand Down
Loading