From c251d3573b6a2ef11b8711ba7b495152eaf5b702 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:51:23 +0100 Subject: [PATCH 1/3] ci: docker image always released as -dev --- .github/actions/docker/action.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/docker/action.yaml b/.github/actions/docker/action.yaml index 495222f7249..459a3fe6c4c 100644 --- a/.github/actions/docker/action.yaml +++ b/.github/actions/docker/action.yaml @@ -190,7 +190,9 @@ runs: platforms: ${{ inputs.platform }} secret-files: | AWS=${{ env.HOME }}/.aws/credentials - build-args: ${{ steps.sccache.outputs.env_vars }} + build-args: | + CARGO_BUILD_PROFILE=${{ inputs.cargo_profile }} + ${{ steps.sccache.outputs.env_vars }} cache-from: ${{ steps.layer_cache_settings.outputs.cache_from }} cache-to: ${{ steps.layer_cache_settings.outputs.cache_to }} outputs: type=image,name=${{ inputs.image_org }}/${{ inputs.image_name }},push-by-digest=${{ inputs.push_tags != 'true' }},name-canonical=true,push=true From aecd869e11fc96d95384c9495f1241f01a2e6909 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:22:28 +0100 Subject: [PATCH 2/3] chore: push to "name" cache on release --- .github/workflows/release-docker-image.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release-docker-image.yml b/.github/workflows/release-docker-image.yml index 728bd7e94ce..7d43c13fa8f 100644 --- a/.github/workflows/release-docker-image.yml +++ b/.github/workflows/release-docker-image.yml @@ -68,6 +68,8 @@ jobs: cache_endpoint: ${{ vars.CACHE_S3_ENDPOINT }} cache_access_key_id: ${{ secrets.CACHE_KEY_ID }} cache_secret_access_key: ${{ secrets.CACHE_SECRET_KEY }} + # On release, we generate a new "base" image, so we need to save cache to name manifest, like '.../drive' + cache_to_name: ${{ github.event_name == 'release' && 'true' || 'false' }} - name: Export digest run: | From ed401d179f215b33d5b41c2ce9fdae2b3a0b90a7 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:32:58 +0100 Subject: [PATCH 3/3] chore: optimize build --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0236a9e20e5..568e232cc6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -131,9 +131,6 @@ RUN if [[ "$TARGETARCH" == "arm64" ]] ; then export PROTOC_ARCH=aarch_64; else e # Switch to clang RUN rm /usr/bin/cc && ln -s /usr/bin/clang /usr/bin/cc -# Select whether we want dev or release -ONBUILD ARG CARGO_BUILD_PROFILE=dev - ARG NODE_ENV=production ENV NODE_ENV=${NODE_ENV} @@ -326,6 +323,10 @@ RUN --mount=type=secret,id=AWS \ --no-track \ --no-confirm + +# Select whether we want dev or release +ONBUILD ARG CARGO_BUILD_PROFILE=dev + # # Rust build planner to speed up builds #