Skip to content

Commit fca4d08

Browse files
authored
Fix broken workflows since the introduction of private ecr repository (#4220)
## Motivation and Context Minor cleanup following #4153 ## Description The following workflows have been broken due to minor issues—such as missing secrets, not using the latest upload scripts, and so on: - `pull-request-updating-lockfiles.yml` - `update-lockfiles.yml` and `manual-update-lockfiles.yml` are callers of the given workflow - `ci-main.yml` - `dry-run-release-scheduled.yml` ## Testing The changes to `ci-main.yml` and `dry-run-release-scheduled.yml` haven't been verified, as these workflows only run in live environments (if they are still broken after this PR, will look into them further). For the changes to `pull-request-updating-lockfiles.yml`, manually triggered `manual-update-lockfiles.yml` and confirmed that #4219 has been created. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent 9ae04e6 commit fca4d08

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

.github/workflows/ci-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
run: ./.github/scripts/acquire-build-image
5959
- name: Tag and upload image
6060
run: |
61-
IMAGE_TAG="ci-$(./.github/scripts/docker-image-hash)"
61+
IMAGE_TAG="ci-$(./smithy-rs/.github/scripts/docker-image-hash)"
6262
./smithy-rs/.github/scripts/upload-build-image.sh $IMAGE_TAG
6363
6464
# Run the shared CI after a Docker build image has been uploaded to ECR

.github/workflows/dry-run-release-scheduled.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ jobs:
2525
with:
2626
commit_sha: main
2727
dry_run: true
28-
skip_ci: true
28+
# If the automation runs this workflow in the background, we might as well run the full CI to catch any potential issues.
29+
skip_ci: false
2930
secrets:
3031
RELEASE_AUTOMATION_BOT_PAT: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }}
3132
RELEASE_AUTOMATION_BOT_CRATESIO_TOKEN: ${{ secrets.RELEASE_AUTOMATION_BOT_CRATESIO_TOKEN }}
3233
CANARY_GITHUB_ACTIONS_ROLE_ARN: ${{ secrets.CANARY_GITHUB_ACTIONS_ROLE_ARN }}
3334
CANARY_STACK_CDK_OUTPUTS_BUCKET_NAME: ${{ secrets.CANARY_STACK_CDK_OUTPUTS_BUCKET_NAME }}
35+
SMITHY_RS_ECR_PUSH_ROLE_ARN: ${{ secrets.SMITHY_RS_ECR_PUSH_ROLE_ARN }}

.github/workflows/manual-update-lockfiles.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ jobs:
3434
force_update_on_broken_dependencies: ${{ inputs.force_update_on_broken_dependencies }}
3535
secrets:
3636
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
37-
SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN: ${{ secrets.SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN }}
37+
SMITHY_RS_ECR_PUSH_ROLE_ARN: ${{ secrets.SMITHY_RS_ECR_PUSH_ROLE_ARN }}
3838
RELEASE_AUTOMATION_BOT_PAT: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }}

.github/workflows/pull-request-updating-lockfiles.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ on:
1818
secrets:
1919
DOCKER_LOGIN_TOKEN_PASSPHRASE:
2020
required: true
21-
SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN:
21+
SMITHY_RS_ECR_PUSH_ROLE_ARN:
2222
required: true
2323
RELEASE_AUTOMATION_BOT_PAT:
2424
required: true
2525

26-
env:
27-
ecr_repository: public.ecr.aws/w0m4q9l7/github-awslabs-smithy-rs-ci
28-
2926
jobs:
3027
save-docker-login-token:
3128
name: Save a docker login token
@@ -42,14 +39,14 @@ jobs:
4239
- name: Attempt to load a docker login password
4340
uses: aws-actions/configure-aws-credentials@v4
4441
with:
45-
role-to-assume: ${{ secrets.SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN }}
42+
role-to-assume: ${{ secrets.SMITHY_RS_ECR_PUSH_ROLE_ARN }}
4643
role-session-name: GitHubActions
4744
aws-region: us-west-2
4845
- name: Save the docker login password to the output
4946
id: set-token
5047
run: |
5148
ENCRYPTED_PAYLOAD=$(
52-
gpg --symmetric --batch --passphrase "${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}" --output - <(aws ecr-public get-login-password --region us-east-1) | base64 -w0
49+
gpg --symmetric --batch --passphrase "${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}" --output - <(aws ecr get-login-password --region us-west-2) | base64 -w0
5350
)
5451
echo "docker-login-password=$ENCRYPTED_PAYLOAD" >> $GITHUB_OUTPUT
5552
@@ -77,19 +74,18 @@ jobs:
7774
- name: Acquire credentials
7875
uses: aws-actions/configure-aws-credentials@v4
7976
with:
80-
role-to-assume: ${{ secrets.SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN }}
77+
role-to-assume: ${{ secrets.SMITHY_RS_ECR_PUSH_ROLE_ARN }}
8178
role-session-name: GitHubActions
8279
aws-region: us-west-2
8380
- name: Upload image
8481
run: |
85-
IMAGE_TAG="$(./smithy-rs/.github/scripts/docker-image-hash)"
86-
docker tag "smithy-rs-base-image:${IMAGE_TAG}" "${{ env.ecr_repository }}:${IMAGE_TAG}"
87-
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
88-
docker push "${{ env.ecr_repository }}:${IMAGE_TAG}"
82+
IMAGE_TAG="ci-$(./smithy-rs/.github/scripts/docker-image-hash)"
83+
./smithy-rs/.github/scripts/upload-build-image.sh $IMAGE_TAG
8984
9085
create-pull-request-for-updating-lockfiles:
9186
name: Create a Pull Request for updating lockfiles
9287
needs:
88+
- save-docker-login-token
9389
- acquire-base-image
9490
runs-on: ubuntu-latest
9591
steps:
@@ -106,6 +102,9 @@ jobs:
106102
branch_name="update-all-lockfiles-$(date +%s)"
107103
echo "branch_name=${branch_name}" > $GITHUB_OUTPUT
108104
- name: Cargo update all lockfiles
105+
env:
106+
ENCRYPTED_DOCKER_PASSWORD: ${{ needs.save-docker-login-token.outputs.docker-login-password }}
107+
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
109108
uses: ./smithy-rs/.github/actions/docker-build
110109
with:
111110
action: cargo-update-lockfiles

.github/workflows/update-lockfiles.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ jobs:
2323
force_update_on_broken_dependencies: false
2424
secrets:
2525
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
26-
SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN: ${{ secrets.SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN }}
26+
SMITHY_RS_ECR_PUSH_ROLE_ARN: ${{ secrets.SMITHY_RS_ECR_PUSH_ROLE_ARN }}
2727
RELEASE_AUTOMATION_BOT_PAT: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }}

0 commit comments

Comments
 (0)