From cd2875a0da7983e2eda808ea15ff3471354b803a Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 17 Nov 2023 23:01:33 +0100 Subject: [PATCH] [FAST_BUILD] Remove latest tag in workflow to make local development easier (#2034) * Remove latest tag in workflow to make local development easier * Fix style * Update docker-tag-push.yml * Update docker-tag-push.yml --- .github/workflows/docker-tag-push.yml | 3 +++ tagging/apply_tags.py | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-tag-push.yml b/.github/workflows/docker-tag-push.yml index 450dee0ae5..38ea9f3a16 100644 --- a/.github/workflows/docker-tag-push.yml +++ b/.github/workflows/docker-tag-push.yml @@ -52,6 +52,9 @@ jobs: path: /tmp/jupyter/tags/ - name: Apply tags to the loaded image 🏷 run: python3 -m tagging.apply_tags --short-image-name ${{ inputs.image }} --tags-dir /tmp/jupyter/tags/ --platform ${{ inputs.platform }} --registry ${{ env.REGISTRY }} --owner ${{ env.OWNER }} + # This step is needed to prevent pushing non-multiarch "latest" tag + - name: Remove "latest" tag from the image 🗑️ + run: docker image rmi ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ inputs.image }}:latest - name: Push Images to Registry 📤 if: env.PUSH_TO_REGISTRY == 'true' diff --git a/tagging/apply_tags.py b/tagging/apply_tags.py index 784cd778e0..72634227f9 100755 --- a/tagging/apply_tags.py +++ b/tagging/apply_tags.py @@ -23,7 +23,6 @@ def apply_tags( ) -> None: """ Tags //:latest with the tags reported by all taggers for this image - Then removes latest tag """ LOGGER.info(f"Tagging image: {short_image_name}") @@ -35,9 +34,6 @@ def apply_tags( LOGGER.info(f"Applying tag: {tag}") docker["tag", image, tag] & plumbum.FG - LOGGER.info("Removing latest tag from the image") - docker["image", "rmi", image] & plumbum.FG - if __name__ == "__main__": logging.basicConfig(level=logging.INFO)