Skip to content

Commit

Permalink
ci/build-images: fix push to ECR (#1315)
Browse files Browse the repository at this point in the history
Push to ECR started to fail after
#1312 changes:

```
Copy neondatabase/neonvm-controller:testrelease-20250311.1c7bb48.13791913752 to dev ECR
ERROR: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
```

It tries to push images to `<ECR>/neondatabase/<IMAGE_NAME>` instead of
`<ECR>/<IMAGE_NAME>`
  • Loading branch information
bayandin authored Mar 11, 2025
1 parent ad51dab commit 515ec89
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ jobs:
- name: Copy all merged images to ECR
if: ${{ format('{0}', inputs.upload-to-ecr) == 'true' }}
env:
TAG: ${{ inputs.tag }}
run: |
# note: excludes neonvm-daemon because we only need it during CI, to build compute images.
images=("${IMG_CONTROLLER}" \
Expand All @@ -411,10 +413,16 @@ jobs:
"${IMG_CLUSTER_AUTOSCALER}")
for image in "${images[@]}"; do
echo Copy ${image}:${{ inputs.tag }} to dev ECR
docker buildx imagetools create -t ${{ env.ECR_DEV }}/${image}:${{ inputs.tag }} \
neondatabase/${image}:${{ inputs.tag }}
echo Copy ${image}:${{ inputs.tag }} to prod ECR
docker buildx imagetools create -t ${{ env.ECR_PROD }}/${image}:${{ inputs.tag }} \
neondatabase/${image}:${{ inputs.tag }}
# Remove "neondatabase/" prefix from image name
image_without_prefix=${image#neondatabase/}
image_from=${image}:${TAG}
image_ecr_dev="${ECR_DEV}/${image_without_prefix}:${TAG}"
image_ecr_prod="${ECR_PROD}/${image_without_prefix}:${TAG}"
echo "Copy ${image_from} to ${image_ecr_dev} (dev), and ${image_ecr_prod} (prod)"
docker buildx imagetools create -t ${image_ecr_dev} \
-t ${image_ecr_prod} \
${image_from}
done

0 comments on commit 515ec89

Please sign in to comment.