From cbdbf1ba551060c005d01bbf04165592b01319a5 Mon Sep 17 00:00:00 2001 From: Maxime David Date: Fri, 2 Jan 2026 22:53:14 +0100 Subject: [PATCH 1/7] Update push-to-ecr.yml --- .github/workflows/push-to-ecr.yml | 59 ------------------------------- 1 file changed, 59 deletions(-) diff --git a/.github/workflows/push-to-ecr.yml b/.github/workflows/push-to-ecr.yml index 7e337e4cd0..9f836c9fe9 100644 --- a/.github/workflows/push-to-ecr.yml +++ b/.github/workflows/push-to-ecr.yml @@ -88,62 +88,3 @@ jobs: cd container-uploader yarn install node app.mjs - - clean-untagged-image: - needs: build-upload - runs-on: ubuntu-24.04 - steps: - - name: configure aws credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.role }} - role-session-name: GitHub_Action_LambdaPerf_Session - aws-region: ${{ inputs.environment == 'DEV' && secrets.devRegion || inputs.environment == 'PROD' && secrets.prodRegion }} - - name: clean untagged images - env: - AWS_REGION: ${{ inputs.environment == 'DEV' && secrets.devRegion || inputs.environment == 'PROD' && secrets.prodRegion }} - run: | - echo "Fetching untagged images..." - IMAGES_JSON=$(aws ecr list-images \ - --region "${AWS_REGION}" \ - --repository-name lambda-perf \ - --filter "tagStatus=UNTAGGED" \ - --query 'imageIds' \ - --output json) - - COUNT=$(echo "$IMAGES_JSON" | jq length) - if (( COUNT == 0 )); then - echo "No untagged images found. Skipping deletion." - exit 0 - fi - - echo "Found $COUNT untagged images. Deleting in batches of 100..." - - # read all images into an array - mapfile -t IMAGES_ARRAY < <(echo "$IMAGES_JSON" | jq -c '.[]') - - BATCH=() - for IMG in "${IMAGES_ARRAY[@]}"; do - BATCH+=("$IMG") - - if (( ${#BATCH[@]} == 100 )); then - BATCH_JSON=$(printf '%s\n' "${BATCH[@]}" | jq -s '.') - echo "Deleting batch of 100 images..." - aws ecr batch-delete-image \ - --region "${AWS_REGION}" \ - --repository-name lambda-perf \ - --image-ids "$BATCH_JSON" - BATCH=() - fi - done - - # delete leftover images - if (( ${#BATCH[@]} > 0 )); then - BATCH_JSON=$(printf '%s\n' "${BATCH[@]}" | jq -s '.') - LEFT_COUNT=${#BATCH[@]} - echo "Deleting final batch of $LEFT_COUNT images..." - aws ecr batch-delete-image \ - --region "${AWS_REGION}" \ - --repository-name lambda-perf \ - --image-ids "$BATCH_JSON" - fi \ No newline at end of file From 115697b382280c49e61082cf35406aad22f5f8d1 Mon Sep 17 00:00:00 2001 From: Maxime David Date: Fri, 2 Jan 2026 23:14:10 +0100 Subject: [PATCH 2/7] fix: ecr --- container-uploader/app.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/container-uploader/app.mjs b/container-uploader/app.mjs index c2f3c4ef37..e034fd410a 100644 --- a/container-uploader/app.mjs +++ b/container-uploader/app.mjs @@ -36,8 +36,9 @@ const buildDockerImage = async ( childProcess.execSync( `unzip ${runtime.path}_${architecture}.zip -d ${runtime.path}` ); + const platform = architecture === "x86_64" ? "linux/amd64" : "linux/arm64"; const tag = `${accountId}.dkr.ecr.${region}.amazonaws.com/lambda-perf:${runtime.path}-${architecture}`; - const cmdLine = `docker build . -f Dockerfile.sample -t ${tag} --build-arg baseImage='${runtime.image.baseImage}' --build-arg handlerCode='${runtime.path}' --build-arg handlerCmd='${runtime.handler}'`; + const cmdLine = `docker build . -f Dockerfile.sample --platform ${platform} -t ${tag} --build-arg baseImage='${runtime.image.baseImage}' --build-arg handlerCode='${runtime.path}' --build-arg handlerCmd='${runtime.handler}'`; childProcess.execSync(cmdLine); const cmdLogin = `aws ecr get-login-password --region ${region} | docker login --username AWS --password-stdin ${accountId}.dkr.ecr.${region}.amazonaws.com`; console.log("docker logging in!"); From 08d76e1be1717439d69bcfa5975d15d8e1c17a1c Mon Sep 17 00:00:00 2001 From: Maxime David Date: Fri, 2 Jan 2026 23:24:38 +0100 Subject: [PATCH 3/7] fix: ecr --- container-uploader/app.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/container-uploader/app.mjs b/container-uploader/app.mjs index e034fd410a..e2d38bd2b8 100644 --- a/container-uploader/app.mjs +++ b/container-uploader/app.mjs @@ -39,6 +39,7 @@ const buildDockerImage = async ( const platform = architecture === "x86_64" ? "linux/amd64" : "linux/arm64"; const tag = `${accountId}.dkr.ecr.${region}.amazonaws.com/lambda-perf:${runtime.path}-${architecture}`; const cmdLine = `docker build . -f Dockerfile.sample --platform ${platform} -t ${tag} --build-arg baseImage='${runtime.image.baseImage}' --build-arg handlerCode='${runtime.path}' --build-arg handlerCmd='${runtime.handler}'`; + console.log(cmdLine); childProcess.execSync(cmdLine); const cmdLogin = `aws ecr get-login-password --region ${region} | docker login --username AWS --password-stdin ${accountId}.dkr.ecr.${region}.amazonaws.com`; console.log("docker logging in!"); From e39977056b1fdd21aa5d82f888ce3f8d262c77ea Mon Sep 17 00:00:00 2001 From: Maxime David Date: Fri, 2 Jan 2026 23:28:23 +0100 Subject: [PATCH 4/7] fix: ecr --- container-uploader/app.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/container-uploader/app.mjs b/container-uploader/app.mjs index e2d38bd2b8..cff8c1ee79 100644 --- a/container-uploader/app.mjs +++ b/container-uploader/app.mjs @@ -36,6 +36,12 @@ const buildDockerImage = async ( childProcess.execSync( `unzip ${runtime.path}_${architecture}.zip -d ${runtime.path}` ); + console.log("runtime = "); + console.log(runtime); + console.log("runtime image"); + console.log(runtime.image); + console.log("runtime image base"); + console.log(runtime.image.baseImage); const platform = architecture === "x86_64" ? "linux/amd64" : "linux/arm64"; const tag = `${accountId}.dkr.ecr.${region}.amazonaws.com/lambda-perf:${runtime.path}-${architecture}`; const cmdLine = `docker build . -f Dockerfile.sample --platform ${platform} -t ${tag} --build-arg baseImage='${runtime.image.baseImage}' --build-arg handlerCode='${runtime.path}' --build-arg handlerCmd='${runtime.handler}'`; From 46c5a96317e58e68b07c62744ba2455e4fda43cf Mon Sep 17 00:00:00 2001 From: Maxime David Date: Fri, 2 Jan 2026 23:36:20 +0100 Subject: [PATCH 5/7] fix: ecr --- container-uploader/app.mjs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/container-uploader/app.mjs b/container-uploader/app.mjs index cff8c1ee79..c8c5ed1a72 100644 --- a/container-uploader/app.mjs +++ b/container-uploader/app.mjs @@ -36,15 +36,18 @@ const buildDockerImage = async ( childProcess.execSync( `unzip ${runtime.path}_${architecture}.zip -d ${runtime.path}` ); - console.log("runtime = "); - console.log(runtime); - console.log("runtime image"); - console.log(runtime.image); - console.log("runtime image base"); - console.log(runtime.image.baseImage); const platform = architecture === "x86_64" ? "linux/amd64" : "linux/arm64"; const tag = `${accountId}.dkr.ecr.${region}.amazonaws.com/lambda-perf:${runtime.path}-${architecture}`; - const cmdLine = `docker build . -f Dockerfile.sample --platform ${platform} -t ${tag} --build-arg baseImage='${runtime.image.baseImage}' --build-arg handlerCode='${runtime.path}' --build-arg handlerCmd='${runtime.handler}'`; + const cmdLine = ` + docker buildx build . \ + -f Dockerfile.sample \ + --platform ${platform} \ + --load \ + -t ${tag} \ + --build-arg baseImage='${runtime.image.baseImage}' \ + --build-arg handlerCode='${runtime.path}' \ + --build-arg handlerCmd='${runtime.handler}' + `; console.log(cmdLine); childProcess.execSync(cmdLine); const cmdLogin = `aws ecr get-login-password --region ${region} | docker login --username AWS --password-stdin ${accountId}.dkr.ecr.${region}.amazonaws.com`; @@ -127,7 +130,7 @@ const runtimeFromRuntimeId = (manifest, runtimeId) => { const runtime = manifest.find(r => { return r.path === runtimeId; }); - if(!runtime) { + if (!runtime) { throw "cound not find the runtime" } console.log(runtime); From e8643f79a13bf682f53f17104dd8f42256f75f1f Mon Sep 17 00:00:00 2001 From: Maxime David Date: Fri, 2 Jan 2026 23:45:31 +0100 Subject: [PATCH 6/7] fix: ecr --- container-uploader/app.mjs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/container-uploader/app.mjs b/container-uploader/app.mjs index c8c5ed1a72..54c022b6c4 100644 --- a/container-uploader/app.mjs +++ b/container-uploader/app.mjs @@ -39,10 +39,9 @@ const buildDockerImage = async ( const platform = architecture === "x86_64" ? "linux/amd64" : "linux/arm64"; const tag = `${accountId}.dkr.ecr.${region}.amazonaws.com/lambda-perf:${runtime.path}-${architecture}`; const cmdLine = ` - docker buildx build . \ + DOCKER_BUILDKIT=0 docker build . \ -f Dockerfile.sample \ --platform ${platform} \ - --load \ -t ${tag} \ --build-arg baseImage='${runtime.image.baseImage}' \ --build-arg handlerCode='${runtime.path}' \ From 9764389739664ee468949cf3bd055c49aab0b089 Mon Sep 17 00:00:00 2001 From: Maxime David Date: Fri, 2 Jan 2026 23:50:46 +0100 Subject: [PATCH 7/7] fix: remove ecr untagged --- .github/workflows/push-to-ecr.yml | 59 +++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/.github/workflows/push-to-ecr.yml b/.github/workflows/push-to-ecr.yml index 9f836c9fe9..7e337e4cd0 100644 --- a/.github/workflows/push-to-ecr.yml +++ b/.github/workflows/push-to-ecr.yml @@ -88,3 +88,62 @@ jobs: cd container-uploader yarn install node app.mjs + + clean-untagged-image: + needs: build-upload + runs-on: ubuntu-24.04 + steps: + - name: configure aws credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.role }} + role-session-name: GitHub_Action_LambdaPerf_Session + aws-region: ${{ inputs.environment == 'DEV' && secrets.devRegion || inputs.environment == 'PROD' && secrets.prodRegion }} + - name: clean untagged images + env: + AWS_REGION: ${{ inputs.environment == 'DEV' && secrets.devRegion || inputs.environment == 'PROD' && secrets.prodRegion }} + run: | + echo "Fetching untagged images..." + IMAGES_JSON=$(aws ecr list-images \ + --region "${AWS_REGION}" \ + --repository-name lambda-perf \ + --filter "tagStatus=UNTAGGED" \ + --query 'imageIds' \ + --output json) + + COUNT=$(echo "$IMAGES_JSON" | jq length) + if (( COUNT == 0 )); then + echo "No untagged images found. Skipping deletion." + exit 0 + fi + + echo "Found $COUNT untagged images. Deleting in batches of 100..." + + # read all images into an array + mapfile -t IMAGES_ARRAY < <(echo "$IMAGES_JSON" | jq -c '.[]') + + BATCH=() + for IMG in "${IMAGES_ARRAY[@]}"; do + BATCH+=("$IMG") + + if (( ${#BATCH[@]} == 100 )); then + BATCH_JSON=$(printf '%s\n' "${BATCH[@]}" | jq -s '.') + echo "Deleting batch of 100 images..." + aws ecr batch-delete-image \ + --region "${AWS_REGION}" \ + --repository-name lambda-perf \ + --image-ids "$BATCH_JSON" + BATCH=() + fi + done + + # delete leftover images + if (( ${#BATCH[@]} > 0 )); then + BATCH_JSON=$(printf '%s\n' "${BATCH[@]}" | jq -s '.') + LEFT_COUNT=${#BATCH[@]} + echo "Deleting final batch of $LEFT_COUNT images..." + aws ecr batch-delete-image \ + --region "${AWS_REGION}" \ + --repository-name lambda-perf \ + --image-ids "$BATCH_JSON" + fi \ No newline at end of file