Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container always rebuilt #132

Closed
Krakinou opened this issue Aug 11, 2023 · 2 comments · Fixed by #139
Closed

Container always rebuilt #132

Krakinou opened this issue Aug 11, 2023 · 2 comments · Fixed by #139

Comments

@Krakinou
Copy link

Since 2 weeks (around 2nd August as far as I can tell), my github actions using run-on-arch-action systematically rebuild the container when triggered.

  • I have the instruction githubToken: ${{ github.token }} in my step
  • I have granted read and write permission in the workflow permission in the action settings for this repo.
  • The action was running daily for a few month without rebuilding the package

I created a small action to test it and the install step is always run, and the sha256sum is different each time:

name: Check container build
on:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-22.04


    strategy:
      fail-fast: false
      matrix:
        include:
          - qemu_arch: armv7
            qemu_distro: ubuntu22.04
          - qemu_arch: aarch64
            qemu_distro: ubuntu22.04

    steps:

    - name : Step 1
      uses: uraimo/run-on-arch-action@v.2.5.1
      with:
        arch: ${{ matrix.qemu_arch }}
        distro: ${{ matrix.qemu_distro }}
        githubToken: ${{ github.token }}
        install: |
            case "${{ matrix.qemu_arch }}" in 
              aarch64)
                echo " aarch64";
                echo "This is the install step";
                ;;
              armv7)
                echo " armv7";
                echo "This is the install step";
                ;;
              esac

        run: |
          echo "system installed : This is the run step"

I noticed in the log that a bunch of new messages appeared at the same time as this issue:

  #0 building with "default" instance using docker driver
  
  #1 [internal] load .dockerignore
  #1 transferring context: 2B done
  #1 DONE 0.0s
  
  #2 [internal] load build definition from Dockerfile.aarch64.ubuntu22.04
  #2 transferring dockerfile: 219B done
  #2 DONE 0.0s
  
  #3 [auth] arm64v8/ubuntu:pull token for registry-1.docker.io
  #3 DONE 0.0s
  
  #4 [internal] load metadata for docker.io/arm64v8/ubuntu:22.04
  #4 DONE 0.3s
  
  #5 importing cache manifest from ghcr.io/krakinou/runonarch/run-on-arch-krakinou-runonarch-check-container-build-aarch64-ubuntu22-04
  #5 DONE 0.0s
  
  #6 [internal] load build context
  #6 transferring context: 284B done
  #6 DONE 0.0s

Also a new version of the package with a different sha256sum is created each time.
Am I missing something or did something change?

@Veetaha
Copy link

Veetaha commented Sep 9, 2023

I also see the same problem (ci link)

@gamer191
Copy link
Contributor

gamer191 commented Nov 21, 2023

diff --git a/src/run-on-arch.sh b/src/run-on-arch.sh
index 813e094..1a22d9b 100755
--- a/src/run-on-arch.sh
+++ b/src/run-on-arch.sh
@@ -72,7 +72,8 @@ build_container () {
       "${ACTION_DIR}/Dockerfiles" \
       --file "$DOCKERFILE" \
       --tag "${CONTAINER_NAME}:latest" \
-      --cache-from="$PACKAGE_REGISTRY"
+      --cache-from="$PACKAGE_REGISTRY" \
+      --build-arg BUILDKIT_INLINE_CACHE=1
     docker tag "${CONTAINER_NAME}:latest" "$PACKAGE_REGISTRY" \
       && docker push "$PACKAGE_REGISTRY" || true
   fi

seems to fix it

source: kleisauke/libvips-packaging@e0b8d32

EDIT: I'm going to verify this, and then I'll open a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants