From 31f2a83c24392254a43d3e72374668101e0854b2 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 16 Mar 2026 11:15:33 +0100 Subject: [PATCH 1/6] ci: refactor test builds --- .github/actions/bake/action.yml | 38 +++++++++++++ .github/workflows/build.yml | 97 ++++++++------------------------- 2 files changed, 61 insertions(+), 74 deletions(-) create mode 100644 .github/actions/bake/action.yml diff --git a/.github/actions/bake/action.yml b/.github/actions/bake/action.yml new file mode 100644 index 0000000000..691bf6e8e4 --- /dev/null +++ b/.github/actions/bake/action.yml @@ -0,0 +1,38 @@ +name: 'bake' +description: 'builds a containerbase image using Docker Buildx' +inputs: + token: + description: 'GitHub token' + default: ${{ github.token }} + required: true + args: + description: 'Arguments for Docker Buildx bake' + default: '' + +runs: + using: 'composite' + + steps: + - name: fetch dist + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: dist + path: dist + + - name: fix executable + shell: bash + run: | + chmod +x dist/cli/* + chmod +x dist/docker/usr/local/containerbase/bin/* + chmod +x dist/docker/usr/local/sbin/* + + - name: bake + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 + with: + timeout_minutes: 10 + max_attempts: 3 + retry_wait_seconds: 60 + polling_interval_seconds: 5 + command: docker buildx bake --set settings.secrets=type=env,id=GITHUB_TOKEN ${{ inputs.args }} + env: + GITHUB_TOKEN: ${{ inputs.token }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 865dc58b3c..8c77d7484a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -166,29 +166,14 @@ jobs: - name: prepare apt proxy uses: ./.github/actions/prepare-proxy - - name: fetch dist - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + - name: build base + uses: ./.github/actions/bake with: - name: dist - path: dist - - - name: fix executable - run: | - chmod +x dist/cli/* - chmod +x dist/docker/usr/local/containerbase/bin/* - chmod +x dist/docker/usr/local/sbin/* - - - name: test distro - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 - with: - timeout_minutes: 10 - max_attempts: 3 - retry_wait_seconds: 60 - polling_interval_seconds: 5 - command: docker buildx bake --set build-ttl.tags=${{env.BASE}} build-ttl - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # CONTAINERBASE_CDN: ${{ vars.CONTAINERBASE_CDN }} + args: >- + --set build-ttl.tags=${{env.BASE}} + --set build-ttl.cache-to=gha,mode=max,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} + --set settings.cache-from+=gha,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} + build-ttl distro: runs-on: ubuntu-24.04 @@ -222,29 +207,10 @@ jobs: - name: prepare apt proxy uses: ./.github/actions/prepare-proxy - - name: fetch dist - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: dist - path: dist - - - name: fix executable - run: | - chmod +x dist/cli/* - chmod +x dist/docker/usr/local/containerbase/bin/* - chmod +x dist/docker/usr/local/sbin/* - - name: test distro - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 + uses: ./.github/actions/bake with: - timeout_minutes: 10 - max_attempts: 3 - retry_wait_seconds: 60 - polling_interval_seconds: 5 - command: docker buildx bake test-distro --set settings.secrets=type=env,id=GITHUB_TOKEN - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # CONTAINERBASE_CDN: ${{ vars.CONTAINERBASE_CDN }} + args: test-distro # test old distros on arm64 base-arm64: @@ -279,29 +245,10 @@ jobs: - name: prepare apt proxy uses: ./.github/actions/prepare-proxy - - name: fetch dist - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: dist - path: dist - - - name: fix executable - run: | - chmod +x dist/cli/* - chmod +x dist/docker/usr/local/containerbase/bin/* - chmod +x dist/docker/usr/local/sbin/* - - name: test distro - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 + uses: ./.github/actions/bake with: - timeout_minutes: 10 - max_attempts: 3 - retry_wait_seconds: 60 - polling_interval_seconds: 5 - command: docker buildx bake test-base --set settings.secrets=type=env,id=GITHUB_TOKEN - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # CONTAINERBASE_CDN: ${{ vars.CONTAINERBASE_CDN }} + args: test-base lang: runs-on: ${{ matrix.arch.os }} @@ -370,17 +317,19 @@ jobs: - name: prepare apt proxy uses: ./.github/actions/prepare-proxy - - name: test - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 + - name: build base + uses: ./.github/actions/bake + with: + args: >- + --set build-ttl.tags=${{env.BASE_IMAGE}} + --set build-ttl.cache-to=gha,mode=max,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} + --set settings.cache-from+=gha,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} + build-ttl + + - name: test distro + uses: ./.github/actions/bake with: - timeout_minutes: 10 - max_attempts: 3 - retry_wait_seconds: 60 - polling_interval_seconds: 5 - command: docker buildx bake test-${{ matrix.arch.name }} --set settings.secrets=type=env,id=GITHUB_TOKEN - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # CONTAINERBASE_CDN: ${{ vars.CONTAINERBASE_CDN }} + args: test-${{ matrix.arch.name }} # Catch-all required check for test matrix test-success: From ac00d9db2d586dd0e9b6665323bbc33e2f63537d Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 16 Mar 2026 11:21:53 +0100 Subject: [PATCH 2/6] ci: fix missing type --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c77d7484a..a5b487490f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -171,8 +171,8 @@ jobs: with: args: >- --set build-ttl.tags=${{env.BASE}} - --set build-ttl.cache-to=gha,mode=max,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} - --set settings.cache-from+=gha,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} + --set build-ttl.cache-to=type=gha,mode=max,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} + --set settings.cache-from+=type=gha,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} build-ttl distro: @@ -322,8 +322,8 @@ jobs: with: args: >- --set build-ttl.tags=${{env.BASE_IMAGE}} - --set build-ttl.cache-to=gha,mode=max,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} - --set settings.cache-from+=gha,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} + --set build-ttl.cache-to=type=gha,mode=max,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} + --set settings.cache-from+=type=gha,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }} build-ttl - name: test distro From fd8099dcf0243169a23347fe2e43b6d634ce845b Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 16 Mar 2026 11:35:57 +0100 Subject: [PATCH 3/6] ci: enable containerd image store --- .github/actions/check/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actions/check/action.yml b/.github/actions/check/action.yml index 7b7266426d..3ad44c350c 100644 --- a/.github/actions/check/action.yml +++ b/.github/actions/check/action.yml @@ -5,6 +5,13 @@ runs: using: 'composite' steps: + - name: Set Up contained image store + shell: bash + run: | + cat /etc/docker/daemon.json | jq '. | .+{"features": {"containerd-snapshotter": true}}' | sudo tee /etc/docker/daemon.json + cat /etc/docker/daemon.json + sudo systemctl restart docker + - name: ⚙️ Check docker service shell: bash run: | From 0e047137afde0ffc77a074c435f64f78f95da8a6 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 16 Mar 2026 11:36:18 +0100 Subject: [PATCH 4/6] ci: simplify --- .github/workflows/build.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5b487490f..75df8c4776 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,6 +154,9 @@ jobs: steps: - name: ⚙️ Setup uses: containerbase/internal-tools/setup@5deae3a281a98870784309f9017eff5e54d2bf31 # v4.5.0 + with: + node: false + apt-proxy: true - name: Check system uses: ./.github/actions/check @@ -163,9 +166,6 @@ jobs: echo "OWNER=${OWNER,,}" >> ${GITHUB_ENV} echo "BASE=ttl.sh/${{ needs.setup.outputs.uid }}/${{ matrix.arch.tag }}:1d" >> ${GITHUB_ENV} - - name: prepare apt proxy - uses: ./.github/actions/prepare-proxy - - name: build base uses: ./.github/actions/bake with: @@ -196,6 +196,9 @@ jobs: steps: - name: ⚙️ Setup uses: containerbase/internal-tools/setup@5deae3a281a98870784309f9017eff5e54d2bf31 # v4.5.0 + with: + node: false + apt-proxy: true - name: Check system uses: ./.github/actions/check @@ -204,9 +207,6 @@ jobs: run: | echo "OWNER=${OWNER,,}" >> ${GITHUB_ENV} - - name: prepare apt proxy - uses: ./.github/actions/prepare-proxy - - name: test distro uses: ./.github/actions/bake with: @@ -234,6 +234,9 @@ jobs: steps: - name: ⚙️ Setup uses: containerbase/internal-tools/setup@5deae3a281a98870784309f9017eff5e54d2bf31 # v4.5.0 + with: + node: false + apt-proxy: true - name: Check system uses: ./.github/actions/check @@ -242,9 +245,6 @@ jobs: run: | echo "OWNER=${OWNER,,}" >> ${GITHUB_ENV} - - name: prepare apt proxy - uses: ./.github/actions/prepare-proxy - - name: test distro uses: ./.github/actions/bake with: @@ -305,6 +305,9 @@ jobs: steps: - name: ⚙️ Setup uses: containerbase/internal-tools/setup@5deae3a281a98870784309f9017eff5e54d2bf31 # v4.5.0 + with: + node: false + apt-proxy: true - name: Check system uses: ./.github/actions/check @@ -314,9 +317,6 @@ jobs: echo "OWNER=${OWNER,,}" >> ${GITHUB_ENV} echo "BASE_IMAGE=ttl.sh/${{ needs.setup.outputs.uid }}/${{ matrix.arch.tag }}:1d" >> ${GITHUB_ENV} - - name: prepare apt proxy - uses: ./.github/actions/prepare-proxy - - name: build base uses: ./.github/actions/bake with: From 86b079285dad3604289ee2bd9b9c6e43732902a0 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 16 Mar 2026 13:22:53 +0100 Subject: [PATCH 5/6] ci: create docker daemon file if not exist --- .github/actions/check/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/check/action.yml b/.github/actions/check/action.yml index 3ad44c350c..fe382c1a7c 100644 --- a/.github/actions/check/action.yml +++ b/.github/actions/check/action.yml @@ -8,6 +8,9 @@ runs: - name: Set Up contained image store shell: bash run: | + if [ ! -f /etc/docker/daemon.json ]; then + echo "{}" | sudo tee /etc/docker/daemon.json + fi cat /etc/docker/daemon.json | jq '. | .+{"features": {"containerd-snapshotter": true}}' | sudo tee /etc/docker/daemon.json cat /etc/docker/daemon.json sudo systemctl restart docker From ee91b789e8ab1d87f8c942915de38bd298107c86 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 16 Mar 2026 14:11:05 +0100 Subject: [PATCH 6/6] chore: cleanup --- .github/actions/prepare-proxy/action.yml | 11 ----------- package.json | 1 - tools/containerbase.acl | 2 -- tools/prepare-proxy.js | 12 ------------ 4 files changed, 26 deletions(-) delete mode 100644 .github/actions/prepare-proxy/action.yml delete mode 100644 tools/containerbase.acl delete mode 100644 tools/prepare-proxy.js diff --git a/.github/actions/prepare-proxy/action.yml b/.github/actions/prepare-proxy/action.yml deleted file mode 100644 index 69f4f71976..0000000000 --- a/.github/actions/prepare-proxy/action.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: 'Prepare propxy' -description: 'Prepares the apt proxy for the build' - -runs: - using: 'composite' - - steps: - - name: ⚙️ Prepare proxy - shell: bash - run: | - sudo $(command -v node) tools/prepare-proxy.js diff --git a/package.json b/package.json index 105ea8c2f5..771fe7cba1 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "lint-fix": "run-s prettier-fix eslint-fix 'lint-fix:*'", "lint-fix:markdown": "markdownlint-cli2 --fix '**/*.md'", "prepare": "husky", - "prepare:proxy": "node tools/prepare-proxy.js", "prettier": "prettier --cache -c -u \"**/*.*\"", "prettier-fix": "prettier --cache -w -u \"**/*.*\"", "release:prepare": "node tools/prepare-release.js", diff --git a/tools/containerbase.acl b/tools/containerbase.acl deleted file mode 100644 index 8358ecb110..0000000000 --- a/tools/containerbase.acl +++ /dev/null @@ -1,2 +0,0 @@ -ppa.launchpad.net -binaries.erlang-solutions.com diff --git a/tools/prepare-proxy.js b/tools/prepare-proxy.js deleted file mode 100644 index b8743a2c8d..0000000000 --- a/tools/prepare-proxy.js +++ /dev/null @@ -1,12 +0,0 @@ -import shell from 'shelljs'; - -shell.config.fatal = true; - -shell.echo(`Preparing squid-deb-proxy`); - -shell.exec('apt-get -qq update'); -shell.exec('apt-get install -y squid-deb-proxy'); -shell - .cat('./tools/containerbase.acl') - .to('/etc/squid-deb-proxy/mirror-dstdomain.acl.d/containerbase.acl'); -shell.exec('systemctl reload squid-deb-proxy');