From db42b9c61ff6b9906a0d29e178f6774ac855511a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 24 Nov 2023 09:58:24 +0000 Subject: [PATCH] It's always multiarch containers(when available) Signed-off-by: Pedro Algarvio --- .github/workflows/.container.template.j2 | 10 +---- .github/workflows/almalinux-containers.yml | 4 +- .github/workflows/amazonlinux-containers.yml | 4 +- .github/workflows/archlinux-containers.yml | 4 +- .github/workflows/busybox-containers.yml | 4 +- .github/workflows/centos-containers.yml | 4 +- .../workflows/centos-stream-containers.yml | 4 +- .github/workflows/consul-containers.yml | 4 +- .github/workflows/debian-containers.yml | 4 +- .github/workflows/etcd-v2-containers.yml | 4 +- .github/workflows/etcd-v3-containers.yml | 4 +- .github/workflows/fedora-containers.yml | 4 +- .github/workflows/mariadb-containers.yml | 4 +- .github/workflows/mysql-server-containers.yml | 4 +- .../workflows/openldap-minion-containers.yml | 4 +- .github/workflows/opensuse-containers.yml | 4 +- .github/workflows/packaging-containers.yml | 4 +- .github/workflows/percona-containers.yml | 4 +- .github/workflows/photon-containers.yml | 4 +- .github/workflows/python-containers.yml | 4 +- .github/workflows/rabbitmq-containers.yml | 4 +- .github/workflows/redis-containers.yml | 4 +- .github/workflows/salt-containers.yml | 4 +- .../workflows/salt-gitfs-http-containers.yml | 4 +- .github/workflows/ssh-minion-containers.yml | 4 +- .github/workflows/tinyproxy-containers.yml | 4 +- .github/workflows/ubuntu-containers.yml | 4 +- .github/workflows/vault-containers.yml | 4 +- .github/workflows/virt-minion-containers.yml | 4 +- .github/workflows/zookeeper-containers.yml | 4 +- tasks/containers.py | 43 ++++++++++--------- 31 files changed, 82 insertions(+), 87 deletions(-) diff --git a/.github/workflows/.container.template.j2 b/.github/workflows/.container.template.j2 index 7b0ca2f..e5c1b21 100644 --- a/.github/workflows/.container.template.j2 +++ b/.github/workflows/.container.template.j2 @@ -52,8 +52,6 @@ jobs: run: | python -m pip install -r requirements.txt - <%- if multiarch %> - - name: "Docker QEMU" uses: docker/setup-qemu-action@v3 @@ -61,17 +59,15 @@ jobs: id: buildx uses: docker/setup-buildx-action@v3 - <%- endif %> - - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }}<%- if multiarch %> --multiarch<%- endif %> + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }}<%- if multiarch %> (${{ matrix.dockerinfo.platform }})<%- endif %>" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 @@ -140,9 +136,7 @@ jobs: with: file: ${{ matrix.dockerinfo.file }} context: ${{ env.PATH_IN_REPO }} -<%- if multiarch %> platforms: ${{ matrix.dockerinfo.platform }} -<%- endif %> push: ${{ github.repository == 'saltstack/salt-ci-containers' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) }} tags: | ghcr.io/${{ github.repository }}/${{ matrix.dockerinfo.name }} diff --git a/.github/workflows/almalinux-containers.yml b/.github/workflows/almalinux-containers.yml index e8205de..3b5ae16 100644 --- a/.github/workflows/almalinux-containers.yml +++ b/.github/workflows/almalinux-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/amazonlinux-containers.yml b/.github/workflows/amazonlinux-containers.yml index 5d05c4b..b2f37dd 100644 --- a/.github/workflows/amazonlinux-containers.yml +++ b/.github/workflows/amazonlinux-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/archlinux-containers.yml b/.github/workflows/archlinux-containers.yml index 81e53d9..fb929c6 100644 --- a/.github/workflows/archlinux-containers.yml +++ b/.github/workflows/archlinux-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/busybox-containers.yml b/.github/workflows/busybox-containers.yml index d1eabd0..3e2cdb3 100644 --- a/.github/workflows/busybox-containers.yml +++ b/.github/workflows/busybox-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/centos-containers.yml b/.github/workflows/centos-containers.yml index 6e810c8..627b6a4 100644 --- a/.github/workflows/centos-containers.yml +++ b/.github/workflows/centos-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/centos-stream-containers.yml b/.github/workflows/centos-stream-containers.yml index b441cfb..e9ede28 100644 --- a/.github/workflows/centos-stream-containers.yml +++ b/.github/workflows/centos-stream-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/consul-containers.yml b/.github/workflows/consul-containers.yml index c7b86fe..8fbf101 100644 --- a/.github/workflows/consul-containers.yml +++ b/.github/workflows/consul-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/debian-containers.yml b/.github/workflows/debian-containers.yml index ab66cf8..8f0d881 100644 --- a/.github/workflows/debian-containers.yml +++ b/.github/workflows/debian-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/etcd-v2-containers.yml b/.github/workflows/etcd-v2-containers.yml index 572417c..a8614b9 100644 --- a/.github/workflows/etcd-v2-containers.yml +++ b/.github/workflows/etcd-v2-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/etcd-v3-containers.yml b/.github/workflows/etcd-v3-containers.yml index 85f9e2c..59ae7dc 100644 --- a/.github/workflows/etcd-v3-containers.yml +++ b/.github/workflows/etcd-v3-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/fedora-containers.yml b/.github/workflows/fedora-containers.yml index 82e7f6b..bed55b6 100644 --- a/.github/workflows/fedora-containers.yml +++ b/.github/workflows/fedora-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/mariadb-containers.yml b/.github/workflows/mariadb-containers.yml index 1b85673..f55d95d 100644 --- a/.github/workflows/mariadb-containers.yml +++ b/.github/workflows/mariadb-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/mysql-server-containers.yml b/.github/workflows/mysql-server-containers.yml index 2970df3..1aa8647 100644 --- a/.github/workflows/mysql-server-containers.yml +++ b/.github/workflows/mysql-server-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/openldap-minion-containers.yml b/.github/workflows/openldap-minion-containers.yml index 53c36cd..915e13f 100644 --- a/.github/workflows/openldap-minion-containers.yml +++ b/.github/workflows/openldap-minion-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/opensuse-containers.yml b/.github/workflows/opensuse-containers.yml index 0211238..84a08e9 100644 --- a/.github/workflows/opensuse-containers.yml +++ b/.github/workflows/opensuse-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/packaging-containers.yml b/.github/workflows/packaging-containers.yml index bfae0a8..9cf7177 100644 --- a/.github/workflows/packaging-containers.yml +++ b/.github/workflows/packaging-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/percona-containers.yml b/.github/workflows/percona-containers.yml index b1093e7..703c2fa 100644 --- a/.github/workflows/percona-containers.yml +++ b/.github/workflows/percona-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/photon-containers.yml b/.github/workflows/photon-containers.yml index 6659718..06703f1 100644 --- a/.github/workflows/photon-containers.yml +++ b/.github/workflows/photon-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/python-containers.yml b/.github/workflows/python-containers.yml index 48ea401..6904d3c 100644 --- a/.github/workflows/python-containers.yml +++ b/.github/workflows/python-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/rabbitmq-containers.yml b/.github/workflows/rabbitmq-containers.yml index d04a15e..129f9f5 100644 --- a/.github/workflows/rabbitmq-containers.yml +++ b/.github/workflows/rabbitmq-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/redis-containers.yml b/.github/workflows/redis-containers.yml index 4fe7794..78a1669 100644 --- a/.github/workflows/redis-containers.yml +++ b/.github/workflows/redis-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/salt-containers.yml b/.github/workflows/salt-containers.yml index b8d89ca..34fea45 100644 --- a/.github/workflows/salt-containers.yml +++ b/.github/workflows/salt-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/salt-gitfs-http-containers.yml b/.github/workflows/salt-gitfs-http-containers.yml index 7868945..15589ad 100644 --- a/.github/workflows/salt-gitfs-http-containers.yml +++ b/.github/workflows/salt-gitfs-http-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/ssh-minion-containers.yml b/.github/workflows/ssh-minion-containers.yml index 7985c66..8ed056e 100644 --- a/.github/workflows/ssh-minion-containers.yml +++ b/.github/workflows/ssh-minion-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/tinyproxy-containers.yml b/.github/workflows/tinyproxy-containers.yml index 4d5a126..f159c4f 100644 --- a/.github/workflows/tinyproxy-containers.yml +++ b/.github/workflows/tinyproxy-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/ubuntu-containers.yml b/.github/workflows/ubuntu-containers.yml index 5f416f9..5ce042c 100644 --- a/.github/workflows/ubuntu-containers.yml +++ b/.github/workflows/ubuntu-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/vault-containers.yml b/.github/workflows/vault-containers.yml index 44c784a..b46afa8 100644 --- a/.github/workflows/vault-containers.yml +++ b/.github/workflows/vault-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/virt-minion-containers.yml b/.github/workflows/virt-minion-containers.yml index 7a13b94..05fbfb1 100644 --- a/.github/workflows/virt-minion-containers.yml +++ b/.github/workflows/virt-minion-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/.github/workflows/zookeeper-containers.yml b/.github/workflows/zookeeper-containers.yml index 23514c0..9d98d3e 100644 --- a/.github/workflows/zookeeper-containers.yml +++ b/.github/workflows/zookeeper-containers.yml @@ -62,12 +62,12 @@ jobs: - name: "Generate Matrix Data" id: set-matrix run: | - inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} --multiarch + inv containers.matrix --from-workflow ${{ env.PATH_IN_REPO }} mirror-image: runs-on: ubuntu-latest needs: matrix-generator - name: "${{ matrix.dockerinfo.name }} (${{ matrix.dockerinfo.platform }})" + name: "${{ matrix.dockerinfo.name }}${{ matrix.dockerinfo.platform && format(' ({0})', matrix.dockerinfo.platform) || ''}}" strategy: fail-fast: false max-parallel: 10 diff --git a/tasks/containers.py b/tasks/containers.py index 7e8034c..9641a9e 100644 --- a/tasks/containers.py +++ b/tasks/containers.py @@ -145,7 +145,6 @@ def generate(ctx, ghcr_org="saltstack/salt-ci-containers"): "repository_path": container_dir.relative_to(utils.REPO_ROOT), "is_mirror": is_mirror, "workflow_file_name": workflow_file_name, - "multiarch": details.get("multiarch", True), "cron_hour": cron_hour, } workflows_dir = utils.REPO_ROOT / ".github" / "workflows" @@ -167,7 +166,7 @@ def generate(ctx, ghcr_org="saltstack/salt-ci-containers"): @task -def matrix(ctx, image, from_workflow=False, multiarch=False, build_platforms=None): +def matrix(ctx, image, from_workflow=False, build_platforms=None): """ Generate the container mirrors. """ @@ -193,31 +192,33 @@ def matrix(ctx, image, from_workflow=False, multiarch=False, build_platforms=Non else: source_container = _get_source_container(fpath) - if multiarch: - ret = ctx.run( - f"docker buildx imagetools inspect --raw {source_container}", echo=False, hide=True + ret = ctx.run( + f"docker buildx imagetools inspect --raw {source_container}", echo=False, hide=True + ) + data = json.loads(ret.stdout) + for entry in data.get("manifests", ()): + platform = "{os}/{architecture}".format(**entry["platform"]) + if "variant" in entry["platform"]: + platform += f"/{entry['platform']['variant']}" + if platform not in build_platforms: + continue + output.append( + { + "name": f"{details['name']}:{fpath.stem}", + "platform": platform, + "file": str(fpath.relative_to(utils.REPO_ROOT)), + "source_container": source_container, + } ) - data = json.loads(ret.stdout) - for entry in data.get("manifests"): - platform = "{os}/{architecture}".format(**entry["platform"]) - if "variant" in entry["platform"]: - platform += f"/{entry['platform']['variant']}" - if platform not in build_platforms: - continue - output.append( - { - "name": f"{details['name']}:{fpath.stem}", - "platform": platform, - "file": str(fpath.relative_to(utils.REPO_ROOT)), - "source_container": source_container, - } - ) - else: + + if not output: + # This is because the buildx inspect did not return anything output.append( { "name": f"{details['name']}:{fpath.stem}", "file": str(fpath.relative_to(utils.REPO_ROOT)), "source_container": source_container, + "platform": "", } )