From 1402570ab3f280f30bceb4f06735dbd38ca80cfb Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 17 Jan 2024 10:08:00 +0200 Subject: [PATCH 01/98] Use environment variables to set the major and minor versions Use same versions as in the other Docker images: - major -> 3 - minor -> 0 Suggested-at: https://github.com/bioconda/bioconda-containers/pull/68#issuecomment-1893793704 Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 1bad2d18..3e50725d 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -11,11 +11,19 @@ on: push: branches: - 'main' + paths: + - 'images/build-env/**' + - '.github/workflows/build-env-image.yml' + jobs: build: name: Build image - ${{ matrix.image }} runs-on: ubuntu-22.04 + env: + MAJOR_VERSION: 3 + MINOR_VERSION: 0 + strategy: matrix: include: @@ -37,11 +45,6 @@ jobs: repository: 'bioconda/bioconda-utils' path: 'bioconda-utils' - - id: get-tag - run: | - tag=${{ github.event.release && github.event.release.tag_name || github.sha }} - printf %s "tag=${tag#v}" >> $GITHUB_OUTPUT - - name: Install qemu dependency if: ${{ matrix.arch == 'arm64' }} uses: docker/setup-qemu-action@v3 @@ -58,7 +61,8 @@ jobs: BASE_IMAGE=${{ matrix.base_image }} tags: >- latest - ${{ steps.get-tag.outputs.tag }} + ${{ env.MAJOR_VERSION }} + ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} dockerfiles: | ./images/build-env/Dockerfile From 949ac0d9ca1071f7cabe369a050dc0361589db81 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 24 Jan 2024 09:44:14 +0200 Subject: [PATCH 02/98] Move the environment variables to be workflow level Install QEMU for all CPU architectures but amd64. At the moment this is just arm64 but now adding a new arch will not require changes to this step Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 3e50725d..35255aea 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -15,15 +15,14 @@ on: - 'images/build-env/**' - '.github/workflows/build-env-image.yml' - +env: + MAJOR_VERSION: 3 + MINOR_VERSION: 0 + jobs: build: name: Build image - ${{ matrix.image }} runs-on: ubuntu-22.04 - env: - MAJOR_VERSION: 3 - MINOR_VERSION: 0 - strategy: matrix: include: @@ -45,11 +44,11 @@ jobs: repository: 'bioconda/bioconda-utils' path: 'bioconda-utils' - - name: Install qemu dependency - if: ${{ matrix.arch == 'arm64' }} + - name: Install QEMU dependency + if: ${{ matrix.arch != 'amd64' }} uses: docker/setup-qemu-action@v3 with: - platforms: arm64 + platforms: ${{ matrix.arch }} - name: Build image id: buildah-build From 450d72e211cdbdd6f83344355c66fd69bff216f0 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 24 Jan 2024 09:55:36 +0200 Subject: [PATCH 03/98] Build and push manifests for several tags Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 35255aea..5c9389db 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -23,6 +23,8 @@ jobs: build: name: Build image - ${{ matrix.image }} runs-on: ubuntu-22.04 + outputs: + tags: ${{ steps.buildah-build.outputs.tags }} strategy: matrix: include: @@ -85,15 +87,15 @@ jobs: build-manifest: needs: [build] if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' - name: quay.io/bioconda/${{ matrix.cfg.DOCKER_MANIFEST }}:${{ matrix.cfg.DOCKER_TAG }} - runs-on: ubuntu-latest + name: Build and push Docker manifest + runs-on: ubuntu-22.04 + env: + DOCKER_MANIFEST: bioconda-utils-build-env-cos7 + DOCKER_IMAGES: "quay.io/<>/bioconda-utils-build-env-cos7:<>,quay.io/<>/bioconda-utils-build-env-cos7-aarch64:<>" strategy: - fail-fast: false + fail-fast: true matrix: - cfg: - - DOCKER_MANIFEST: bioconda-utils-build-env-cos7 - DOCKER_TAG: "latest" - DOCKER_IMAGES: "quay.io/<>/bioconda-utils-build-env-cos7:<>,quay.io/<>/bioconda-utils-build-env-cos7-aarch64:<>" + tag: ${{ fromJson(needs.build.outputs.tags) }} steps: - uses: actions/checkout@v4 @@ -102,7 +104,7 @@ jobs: id: interpolate run: | set -x - INTERPOLATED=`echo "${{ matrix.cfg.DOCKER_IMAGES }}" | sed "s#<>#${{ secrets.QUAY_BIOCONDA_USERNAME }}#g" | sed "s#<>#${{ matrix.cfg.DOCKER_TAG }}#g"` + INTERPOLATED=`echo "${{ env.DOCKER_IMAGES }}" | sed "s#<>#${{ secrets.QUAY_BIOCONDA_USERNAME }}#g" | sed "s#<>#${{ matrix.tag }}#g"` echo "DOCKER_IMAGES=${INTERPOLATED}" >> "$GITHUB_OUTPUT" - name: Login to Quay.io registry @@ -115,6 +117,6 @@ jobs: - name: Push Docker manifest list for quay.io/bioconda uses: Noelware/docker-manifest-action@v0.3.0 with: - inputs: quay.io/${{ secrets.QUAY_BIOCONDA_USERNAME }}/${{ matrix.cfg.DOCKER_MANIFEST }}:${{ matrix.cfg.DOCKER_TAG }} + inputs: quay.io/${{ secrets.QUAY_BIOCONDA_USERNAME }}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} images: ${{ steps.interpolate.outputs.DOCKER_IMAGES }} push: true From 5bbfdff99e3befac6ec06c8b9eaccad54d346a38 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 24 Jan 2024 10:08:57 +0200 Subject: [PATCH 04/98] Temporary enable pushing Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 5c9389db..e989db8d 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -75,7 +75,7 @@ jobs: done - name: Push To Quay - if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' + # if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.buildah-build.outputs.image }} @@ -86,7 +86,7 @@ jobs: build-manifest: needs: [build] - if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' + # if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' name: Build and push Docker manifest runs-on: ubuntu-22.04 env: From 958672e5b107d1e1d3fd614c2d9a8ce33389ddd3 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 24 Jan 2024 10:21:44 +0200 Subject: [PATCH 05/98] Use vars. context for the Quay.io username Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index e989db8d..0901cfa5 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -29,10 +29,10 @@ jobs: matrix: include: - arch: arm64 - image: bioconda/bioconda-utils-build-env-cos7-aarch64 + image: ${{ vars.QUAY_BIOCONDA_USERNAME }}/bioconda-utils-build-env-cos7-aarch64 base_image: quay.io/condaforge/linux-anvil-aarch64 - arch: amd64 - image: bioconda/bioconda-utils-build-env-cos7-x86_64 + image: ${{ vars.QUAY_BIOCONDA_USERNAME }}/bioconda-utils-build-env-cos7-x86_64 base_image: quay.io/condaforge/linux-anvil-cos7-x86_64 steps: - name: Checkout bioconda-containers @@ -81,7 +81,7 @@ jobs: image: ${{ steps.buildah-build.outputs.image }} tags: ${{ steps.buildah-build.outputs.tags }} registry: ${{ secrets.QUAY_BIOCONDA_REPO }} - username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} + username: ${{ vars.QUAY_BIOCONDA_USERNAME }} password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} build-manifest: @@ -104,19 +104,19 @@ jobs: id: interpolate run: | set -x - INTERPOLATED=`echo "${{ env.DOCKER_IMAGES }}" | sed "s#<>#${{ secrets.QUAY_BIOCONDA_USERNAME }}#g" | sed "s#<>#${{ matrix.tag }}#g"` + INTERPOLATED=`echo "${{ env.DOCKER_IMAGES }}" | sed "s#<>#${{ vars.QUAY_BIOCONDA_USERNAME }}#g" | sed "s#<>#${{ matrix.tag }}#g"` echo "DOCKER_IMAGES=${INTERPOLATED}" >> "$GITHUB_OUTPUT" - name: Login to Quay.io registry uses: docker/login-action@v2 with: registry: ${{ secrets.QUAY_BIOCONDA_REPO }} - username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} + username: ${{ vars.QUAY_BIOCONDA_USERNAME }} password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - name: Push Docker manifest list for quay.io/bioconda uses: Noelware/docker-manifest-action@v0.3.0 with: - inputs: quay.io/${{ secrets.QUAY_BIOCONDA_USERNAME }}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} + inputs: quay.io/${{ vars.QUAY_BIOCONDA_USERNAME }}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} images: ${{ steps.interpolate.outputs.DOCKER_IMAGES }} push: true From ea80a8eaca0475cda6fcdf72744b854167a3fd17 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 24 Jan 2024 10:42:36 +0200 Subject: [PATCH 06/98] Convert Bash array 'tags' to JSON array Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 0901cfa5..2b9abfbd 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -24,7 +24,7 @@ jobs: name: Build image - ${{ matrix.image }} runs-on: ubuntu-22.04 outputs: - tags: ${{ steps.buildah-build.outputs.tags }} + tags: ${{ steps.test.outputs.tags }} strategy: matrix: include: @@ -68,14 +68,18 @@ jobs: ./images/build-env/Dockerfile - name: Test built image + id: test run: | image='${{ steps.buildah-build.outputs.image }}' for tag in ${{ steps.buildah-build.outputs.tags }} ; do podman run --rm "${image}:${tag}" bioconda-utils --version done + tags_json=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${{ steps.buildah-build.outputs.tags }}") + echo $tags_json + echo "tags=${tags_json}" >> $GITHUB_OUTPUT - name: Push To Quay - # if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' + if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.buildah-build.outputs.image }} From c1751f93f33a26d6dea7c5be0a1f80b9ec076864 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 24 Jan 2024 10:51:58 +0200 Subject: [PATCH 07/98] Debug bash array to json array Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 2b9abfbd..5e927c7d 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -70,13 +70,14 @@ jobs: - name: Test built image id: test run: | + echo "${{ steps.buildah-build.outputs.tags }}" image='${{ steps.buildah-build.outputs.image }}' for tag in ${{ steps.buildah-build.outputs.tags }} ; do podman run --rm "${image}:${tag}" bioconda-utils --version done tags_json=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${{ steps.buildah-build.outputs.tags }}") echo $tags_json - echo "tags=${tags_json}" >> $GITHUB_OUTPUT + echo "tags='${tags_json}'" >> $GITHUB_OUTPUT - name: Push To Quay if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' From 13dabbe62b26fb4daaeafbb74bfd0cc65de88ea8 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 24 Jan 2024 11:03:55 +0200 Subject: [PATCH 08/98] More debug Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 5e927c7d..7f3dbbaf 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -70,6 +70,7 @@ jobs: - name: Test built image id: test run: | + jq --version echo "${{ steps.buildah-build.outputs.tags }}" image='${{ steps.buildah-build.outputs.image }}' for tag in ${{ steps.buildah-build.outputs.tags }} ; do @@ -77,7 +78,7 @@ jobs: done tags_json=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${{ steps.buildah-build.outputs.tags }}") echo $tags_json - echo "tags='${tags_json}'" >> $GITHUB_OUTPUT + echo "tags=${tags_json}" >> $GITHUB_OUTPUT - name: Push To Quay if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' From 4e4cf3721711ed75438d0e78a2617c39ee99ee65 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 24 Jan 2024 11:14:32 +0200 Subject: [PATCH 09/98] Convert Bash string to JSON array. Split by whitespace Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 7f3dbbaf..c1008cd8 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -70,13 +70,11 @@ jobs: - name: Test built image id: test run: | - jq --version - echo "${{ steps.buildah-build.outputs.tags }}" image='${{ steps.buildah-build.outputs.image }}' for tag in ${{ steps.buildah-build.outputs.tags }} ; do podman run --rm "${image}:${tag}" bioconda-utils --version done - tags_json=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${{ steps.buildah-build.outputs.tags }}") + tags_json=$(echo -n "${{ steps.buildah-build.outputs.tags }}" | jq --compact-output --raw-input --slurp 'split(" ")') echo $tags_json echo "tags=${tags_json}" >> $GITHUB_OUTPUT From 17d313e1d90a50b1243287e33cfa331ffaf20c97 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 24 Jan 2024 11:39:23 +0200 Subject: [PATCH 10/98] Use `docker manifest` cli instead of Noelware/docker-manifest-action Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index c1008cd8..a545f687 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -119,8 +119,17 @@ jobs: password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - name: Push Docker manifest list for quay.io/bioconda - uses: Noelware/docker-manifest-action@v0.3.0 - with: - inputs: quay.io/${{ vars.QUAY_BIOCONDA_USERNAME }}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} - images: ${{ steps.interpolate.outputs.DOCKER_IMAGES }} - push: true + run: | + PREFIX=${{ secrets.QUAY_BIOCONDA_REPO }}/${{ vars.QUAY_BIOCONDA_USERNAME }} + docker manifest create ${PREFIX}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} \ + --amend ${PREFIX}/bioconda-utils-build-env-cos7-x86_64:${{ matrix.tag }} \ + --amend ${PREFIX}/bioconda-utils-build-env-cos7-aarch64:${{ matrix.tag }} + + docker manifest inspect ${PREFIX}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} + + docker manifest push ${PREFIX}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} + # uses: Noelware/docker-manifest-action@v0.3.0 + # with: + # inputs: quay.io/${{ vars.QUAY_BIOCONDA_USERNAME }}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} + # images: ${{ steps.interpolate.outputs.DOCKER_IMAGES }} + # push: true From 165af24f6ce5112ce871c0ba6c493e36ffc044bd Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 24 Jan 2024 11:54:20 +0200 Subject: [PATCH 11/98] Go back to `secrets.QUAY_BIOCONDA_USERNAME` Remove debug statements and commented out code Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index a545f687..ffde2d61 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -29,10 +29,10 @@ jobs: matrix: include: - arch: arm64 - image: ${{ vars.QUAY_BIOCONDA_USERNAME }}/bioconda-utils-build-env-cos7-aarch64 + image: bioconda/bioconda-utils-build-env-cos7-aarch64 base_image: quay.io/condaforge/linux-anvil-aarch64 - arch: amd64 - image: ${{ vars.QUAY_BIOCONDA_USERNAME }}/bioconda-utils-build-env-cos7-x86_64 + image: bioconda/bioconda-utils-build-env-cos7-x86_64 base_image: quay.io/condaforge/linux-anvil-cos7-x86_64 steps: - name: Checkout bioconda-containers @@ -75,7 +75,6 @@ jobs: podman run --rm "${image}:${tag}" bioconda-utils --version done tags_json=$(echo -n "${{ steps.buildah-build.outputs.tags }}" | jq --compact-output --raw-input --slurp 'split(" ")') - echo $tags_json echo "tags=${tags_json}" >> $GITHUB_OUTPUT - name: Push To Quay @@ -85,7 +84,7 @@ jobs: image: ${{ steps.buildah-build.outputs.image }} tags: ${{ steps.buildah-build.outputs.tags }} registry: ${{ secrets.QUAY_BIOCONDA_REPO }} - username: ${{ vars.QUAY_BIOCONDA_USERNAME }} + username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} build-manifest: @@ -108,19 +107,19 @@ jobs: id: interpolate run: | set -x - INTERPOLATED=`echo "${{ env.DOCKER_IMAGES }}" | sed "s#<>#${{ vars.QUAY_BIOCONDA_USERNAME }}#g" | sed "s#<>#${{ matrix.tag }}#g"` + INTERPOLATED=`echo "${{ env.DOCKER_IMAGES }}" | sed "s#<>#${{ secrets.QUAY_BIOCONDA_USERNAME }}#g" | sed "s#<>#${{ matrix.tag }}#g"` echo "DOCKER_IMAGES=${INTERPOLATED}" >> "$GITHUB_OUTPUT" - name: Login to Quay.io registry uses: docker/login-action@v2 with: registry: ${{ secrets.QUAY_BIOCONDA_REPO }} - username: ${{ vars.QUAY_BIOCONDA_USERNAME }} + username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - name: Push Docker manifest list for quay.io/bioconda run: | - PREFIX=${{ secrets.QUAY_BIOCONDA_REPO }}/${{ vars.QUAY_BIOCONDA_USERNAME }} + PREFIX=${{ secrets.QUAY_BIOCONDA_REPO }}/${{ secrets.QUAY_BIOCONDA_USERNAME }} docker manifest create ${PREFIX}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} \ --amend ${PREFIX}/bioconda-utils-build-env-cos7-x86_64:${{ matrix.tag }} \ --amend ${PREFIX}/bioconda-utils-build-env-cos7-aarch64:${{ matrix.tag }} @@ -128,8 +127,3 @@ jobs: docker manifest inspect ${PREFIX}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} docker manifest push ${PREFIX}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} - # uses: Noelware/docker-manifest-action@v0.3.0 - # with: - # inputs: quay.io/${{ vars.QUAY_BIOCONDA_USERNAME }}/${{ env.DOCKER_MANIFEST }}:${{ matrix.tag }} - # images: ${{ steps.interpolate.outputs.DOCKER_IMAGES }} - # push: true From aab49c019f4abc68a0ed8ffd2d4914a985b1afbf Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Wed, 24 Jan 2024 13:29:15 +0200 Subject: [PATCH 12/98] Re-enable the check for push to main before pushing the manifest Signed-off-by: Martin Tzvetanov Grigorov --- .github/workflows/build-env-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index ffde2d61..cd15f8f8 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -89,7 +89,7 @@ jobs: build-manifest: needs: [build] - # if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' + if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' name: Build and push Docker manifest runs-on: ubuntu-22.04 env: From b22154620699e5766a6f71f860294c11b945582e Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 15:58:12 -0500 Subject: [PATCH 13/98] convert to testing targets --- .github/workflows/build-env-image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index cd15f8f8..c4089949 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -10,7 +10,7 @@ on: - '.github/workflows/build-env-image.yml' push: branches: - - 'main' + - 'test-push' paths: - 'images/build-env/**' - '.github/workflows/build-env-image.yml' @@ -29,10 +29,10 @@ jobs: matrix: include: - arch: arm64 - image: bioconda/bioconda-utils-build-env-cos7-aarch64 + image: bioconda/tmp-bioconda-utils-build-env-cos7-aarch64 base_image: quay.io/condaforge/linux-anvil-aarch64 - arch: amd64 - image: bioconda/bioconda-utils-build-env-cos7-x86_64 + image: bioconda/tmp-bioconda-utils-build-env-cos7-x86_64 base_image: quay.io/condaforge/linux-anvil-cos7-x86_64 steps: - name: Checkout bioconda-containers @@ -78,7 +78,7 @@ jobs: echo "tags=${tags_json}" >> $GITHUB_OUTPUT - name: Push To Quay - if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' + if: github.ref == 'refs/heads/test-push' && github.repository == 'bioconda/bioconda-containers' uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.buildah-build.outputs.image }} From 04e6b30c5315e240f73b117598475be465aa1e5b Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 17:22:35 -0500 Subject: [PATCH 14/98] add a round of comments to GH actions workflows --- .github/workflows/base-glibc-busybox-bash.yaml | 15 ++++++++++++++- .github/workflows/base-glibc-debian-bash.yaml | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/base-glibc-busybox-bash.yaml b/.github/workflows/base-glibc-busybox-bash.yaml index 9f76c16d..3ef3ac71 100644 --- a/.github/workflows/base-glibc-busybox-bash.yaml +++ b/.github/workflows/base-glibc-busybox-bash.yaml @@ -44,15 +44,19 @@ jobs: ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} latest ' + # Adds image and tags to outputs which can be used in later steps. printf %s\\n \ "image=${image_name}" \ "tags=$( echo ${tags} )" \ >> $GITHUB_OUTPUT + # Create manifest (which is considered arch-independent) for tag in ${tags} ; do buildah manifest create "${image_name}:${tag}" done + # --iidfile prints the built image ID to the specified file. This is + # used so we can refer to the image in later steps. iidfile="$( mktemp )" buildah bud \ --iidfile="${iidfile}" \ @@ -71,6 +75,7 @@ jobs: image_id="$( cat "${iidfile}" )" rm "${iidfile}" + # Extract various package info and version info to store as labels container="$( buildah from "${image_id}" )" run() { buildah run "${container}" "${@}" ; } deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )" @@ -80,6 +85,7 @@ jobs: bash="$( run bash --version | sed '1!d' )" buildah rm "${container}" + # Store package/version info as labels for the image container="$( buildah from "${image_id}" )" buildah config \ --label=glibc="${glibc}" \ @@ -89,8 +95,11 @@ jobs: --label=pkg-list="${pkg_list}" \ "${container}" + # Store the new image (now with labels) image_id="$( buildah commit "${container}" )" buildah rm "${container}" + + # image tag includes arch; then added to manifest which does not include arch for tag in ${tags} ; do buildah tag \ "${image_id}" \ @@ -104,6 +113,8 @@ jobs: - name: Test run: | image='${{ steps.build.outputs.image }}' + + # Extract image ids from manifest to test. ids="$( for tag in ${{ steps.build.outputs.tags }} ; do buildah manifest inspect "${image}:${tag}" \ @@ -114,6 +125,8 @@ jobs: done done )" + + # See Dockerfile.test for actual tests run ids="$( printf %s "${ids}" | sort -u )" for id in ${ids} ; do podman history "${id}" @@ -127,7 +140,7 @@ jobs: - name: Check Tags run: | # FIX upstream: Quay.io does not support immutable images currently. - # => Try to use the REST API to check for duplicate tags. + # => Try to use the REST API to check for duplicate tags and exit if they exist response="$( curl -sL \ 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image }}/tag/' diff --git a/.github/workflows/base-glibc-debian-bash.yaml b/.github/workflows/base-glibc-debian-bash.yaml index 331f44ea..6692f558 100644 --- a/.github/workflows/base-glibc-debian-bash.yaml +++ b/.github/workflows/base-glibc-debian-bash.yaml @@ -43,15 +43,19 @@ jobs: ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} latest ' + # Adds image and tags to outputs which can be used in later steps. printf %s\\n \ "image=${image_name}" \ "tags=$( echo ${tags} )" \ >> $GITHUB_OUTPUT + # Create manifest (which is considered arch-independent) for tag in ${tags} ; do buildah manifest create "${image_name}:${tag}" done + # --iidfile prints the built image ID to the specified file. This is + # used so we can refer to the image in later steps. for arch in amd64 arm64 ; do iidfile="$( mktemp )" buildah bud \ @@ -61,6 +65,7 @@ jobs: image_id="$( cat "${iidfile}" )" rm "${iidfile}" + # Extract various package info and version info to store as labels container="$( buildah from "${image_id}" )" run() { buildah run "${container}" "${@}" ; } deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )" @@ -70,6 +75,7 @@ jobs: bash="$( run bash --version | sed '1!d' )" buildah rm "${container}" + # Store package/version info as labels for the image container="$( buildah from "${image_id}" )" buildah config \ --label=glibc="${glibc}" \ @@ -79,8 +85,11 @@ jobs: --label=pkg-list="${pkg_list}" \ "${container}" + # Store the new image (now with labels) image_id="$( buildah commit "${container}" )" buildah rm "${container}" + + # image tag includes arch; then added to manifest which does not include arch for tag in ${tags} ; do buildah tag \ "${image_id}" \ @@ -94,6 +103,8 @@ jobs: - name: Test run: | image='${{ steps.build.outputs.image }}' + + # Extract image ids from manifest to test. ids="$( for tag in ${{ steps.build.outputs.tags }} ; do buildah manifest inspect "${image}:${tag}" \ @@ -104,6 +115,8 @@ jobs: done done )" + + # See Dockerfile.test for actual tests run ids="$( printf %s "${ids}" | sort -u )" for id in ${ids} ; do podman history "${id}" @@ -117,7 +130,7 @@ jobs: - name: Check Tags run: | # FIX upstream: Quay.io does not support immutable images currently. - # => Try to use the REST API to check for duplicate tags. + # => Try to use the REST API to check for duplicate tags and exit if they exist response="$( curl -sL \ 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image }}/tag/' From 7388860a31e822be20c87b0ad9b5a33f2cb7fa20 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 17:23:13 -0500 Subject: [PATCH 15/98] build build-env images similar to others --- .github/workflows/build-env-image.yml | 251 ++++++++++++++++++-------- images/build-env/Dockerfile | 7 +- images/build-env/Dockerfile.test | 4 + 3 files changed, 177 insertions(+), 85 deletions(-) create mode 100644 images/build-env/Dockerfile.test diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 1bad2d18..e7300f73 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -1,8 +1,4 @@ -name: Build image -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - +name: 'Build & Push: base-glibc-busybox-bash' on: pull_request: paths: @@ -14,20 +10,18 @@ on: jobs: build: - name: Build image - ${{ matrix.image }} + name: Build & Push runs-on: ubuntu-22.04 - strategy: - matrix: - include: - - arch: arm64 - image: bioconda/bioconda-utils-build-env-cos7-aarch64 - base_image: quay.io/condaforge/linux-anvil-aarch64 - - arch: amd64 - image: bioconda/bioconda-utils-build-env-cos7-x86_64 - base_image: quay.io/condaforge/linux-anvil-cos7-x86_64 + env: + # The base image is not intended to change often and should be used with + # version tags or checksum IDs, but not via "latest". + MAJOR_VERSION: 3 + MINOR_VERSION: 0 + IMAGE_NAME: bioconda-utils-build-env-cos7 + steps: - name: Checkout bioconda-containers - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Checkout bioconda-utils @@ -37,81 +31,178 @@ jobs: repository: 'bioconda/bioconda-utils' path: 'bioconda-utils' - - id: get-tag - run: | - tag=${{ github.event.release && github.event.release.tag_name || github.sha }} - printf %s "tag=${tag#v}" >> $GITHUB_OUTPUT - - - name: Install qemu dependency - if: ${{ matrix.arch == 'arm64' }} - uses: docker/setup-qemu-action@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 with: platforms: arm64 - - name: Build image - id: buildah-build - uses: redhat-actions/buildah-build@v2 - with: - image: ${{ matrix.image }} - arch: ${{ matrix.arch }} - build-args: | - BASE_IMAGE=${{ matrix.base_image }} - tags: >- + - name: Build + id: build + run: | + set -xeu + cd 'images/${{ env.IMAGE_NAME }}' + + image_name='${{ env.IMAGE_NAME }}' + tags=' + ${{ env.MAJOR_VERSION }} + ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} latest - ${{ steps.get-tag.outputs.tag }} - dockerfiles: | - ./images/build-env/Dockerfile + ' + # Adds image and tags to outputs which can be used in later steps. + printf %s\\n \ + "image=${image_name}" \ + "tags=$( echo ${tags} )" \ + >> $GITHUB_OUTPUT + + # Create manifest (which is considered arch-independent) + for tag in ${tags} ; do + buildah manifest create "${image_name}:${tag}" + done + + # Due to different nomenclature used by conda-forge and buildah, we + # need to map archs to base images. + for arch_and_image in \ + "amd64=quay.io/condaforge/linux-anvil-cos7-x86_64" \ + "arm64=quay.io/condaforge/linux-anvil-aarch64"; + do + # Unpack archs and base images + arch=$(cut -f1 -d "=" $arch_and_image) + base_image=$(cut -f2 -d "=" $arch_and_image) + + # --iidfile prints the built image ID to the specified file. This is + # used so we can refer to the image in later steps. + iidfile="$( mktemp )" + buildah bud \ + --arch="${arch}" \ + --iidfile="${iidfile}" \ + --build-arg=base_image="$base_image" \ + image_id="$( cat "${iidfile}" )" + rm "${iidfile}" + + # Extract various package info and version info to store as labels + container="$( buildah from "${image_id}" )" + run() { buildah run "${container}" "${@}" ; } + deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )" + pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )" + glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )" + bash="$( run bash --version | sed '1!d' )" + bioconda_utils="$( run bioconda-utils --version )" + buildah rm "${container}" + + # Store package/version info as labels for the image + container="$( buildah from "${image_id}" )" + buildah config \ + --label=glibc="${glibc}" \ + --label=bash="${bash}" \ + --label=deb-list="${deb_list}" \ + --label=pkg-list="${pkg_list}" \ + --label=bioconda-utils="${bioconda_utils}" \ + "${container}" - - name: Test built image + # Store the new image (now with labels) + image_id="$( buildah commit "${container}" )" + buildah rm "${container}" + + # image tag includes arch; then added to manifest which does not include arch + for tag in ${tags} ; do + buildah tag \ + "${image_id}" \ + "${image_name}:${tag}-${arch}" + buildah manifest add \ + "${image_name}:${tag}" \ + "${image_id}" + done + done + + - name: Test run: | - image='${{ steps.buildah-build.outputs.image }}' - for tag in ${{ steps.buildah-build.outputs.tags }} ; do - podman run --rm "${image}:${tag}" bioconda-utils --version + image='${{ steps.build.outputs.image }}' + + # Extract image ids from manifest to test. + ids="$( + for tag in ${{ steps.build.outputs.tags }} ; do + buildah manifest inspect "${image}:${tag}" \ + | jq -r '.manifests[]|.digest' \ + | while read id ; do + buildah images --format '{{.ID}}{{.Digest}}' \ + | sed -n "s/${id}//p" + done + done + )" + + # See Dockerfile.test for actual tests run + ids="$( printf %s "${ids}" | sort -u )" + for id in ${ids} ; do + podman history "${id}" + buildah bud \ + --build-arg=base="${id}" \ + --file=Dockerfile.test \ + "images/${image}" done + buildah rmi --prune || true + + - name: Check Tags + run: | + # FIX upstream: Quay.io does not support immutable images currently. + # => Try to use the REST API to check for duplicate tags and exit if they exist + response="$( + curl -sL \ + 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image }}/tag/' + )" - - name: Push To Quay - if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' + existing_tags="$( + printf %s "${response}" \ + | jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name' + )" \ + || { + printf %s\\n \ + 'Could not get list of image tags.' \ + 'Does the repository exist on Quay.io?' \ + 'Quay.io REST API response was:' \ + "${response}" + exit 1 + } + for tag in ${{ steps.build.outputs.tags }} ; do + case "${tag}" in + latest | '${{ env.MAJOR_VERSION }}' ) ;; + * ) + if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then + printf 'Tag %s already exists!\n' "${tag}" + exit 1 + fi + esac + done + + - if: ${{ github.ref == 'refs/heads/main' }} + name: Push uses: redhat-actions/push-to-registry@v2 with: - image: ${{ steps.buildah-build.outputs.image }} - tags: ${{ steps.buildah-build.outputs.tags }} + image: ${{ steps.build.outputs.image }} + tags: ${{ steps.build.outputs.tags }} registry: ${{ secrets.QUAY_BIOCONDA_REPO }} username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - build-manifest: - needs: [build] - if: github.ref == 'refs/heads/main' && github.repository == 'bioconda/bioconda-containers' - name: quay.io/bioconda/${{ matrix.cfg.DOCKER_MANIFEST }}:${{ matrix.cfg.DOCKER_TAG }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - cfg: - - DOCKER_MANIFEST: bioconda-utils-build-env-cos7 - DOCKER_TAG: "latest" - DOCKER_IMAGES: "quay.io/<>/bioconda-utils-build-env-cos7:<>,quay.io/<>/bioconda-utils-build-env-cos7-aarch64:<>" - - steps: - - uses: actions/checkout@v4 - - - name: Interpolate placeholders - id: interpolate - run: | - set -x - INTERPOLATED=`echo "${{ matrix.cfg.DOCKER_IMAGES }}" | sed "s#<>#${{ secrets.QUAY_BIOCONDA_USERNAME }}#g" | sed "s#<>#${{ matrix.cfg.DOCKER_TAG }}#g"` - echo "DOCKER_IMAGES=${INTERPOLATED}" >> "$GITHUB_OUTPUT" - - - name: Login to Quay.io registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.QUAY_BIOCONDA_REPO }} - username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} - password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - - - name: Push Docker manifest list for quay.io/bioconda - uses: Noelware/docker-manifest-action@v0.3.0 - with: - inputs: quay.io/${{ secrets.QUAY_BIOCONDA_USERNAME }}/${{ matrix.cfg.DOCKER_MANIFEST }}:${{ matrix.cfg.DOCKER_TAG }} - images: ${{ steps.interpolate.outputs.DOCKER_IMAGES }} - push: true + - if: ${{ github.ref == 'refs/heads/main' }} + name: Test Pushed + run: | + image='${{ env.IMAGE_NAME }}' + ids="$( + for tag in ${{ steps.build.outputs.tags }} ; do + buildah manifest inspect "${image}:${tag}" \ + | jq -r '.manifests[]|.digest' \ + | while read id ; do + buildah images --format '{{.ID}}{{.Digest}}' \ + | sed -n "s/${id}//p" + done + done + )" + ids="$( printf %s "${ids}" | sort -u )" + for id in ${ids} ; do + podman history "${id}" + buildah bud \ + --build-arg=base="${id}" \ + --file=Dockerfile.test \ + "images/${image}" + done + buildah rmi --prune || true diff --git a/images/build-env/Dockerfile b/images/build-env/Dockerfile index 6573054b..f90b0a69 100644 --- a/images/build-env/Dockerfile +++ b/images/build-env/Dockerfile @@ -1,9 +1,6 @@ -# Specify the base image to support multi-arch images, such as -# - 'quay.io/condaforge/linux-anvil-aarch64' for Linux aarch64 -# - 'quay.io/condaforge/linux-anvil-cos7-x86_64' for Linux x86_64 -ARG BASE_IMAGE=quay.io/condaforge/linux-anvil-cos7-x86_64 +ARG base_image -FROM ${BASE_IMAGE} as base +FROM ${base_image} as base # Copy over C.UTF-8 locale from our base image to make it consistently available during build. COPY --from=quay.io/bioconda/base-glibc-busybox-bash /usr/lib/locale/C.utf8 /usr/lib/locale/C.utf8 diff --git a/images/build-env/Dockerfile.test b/images/build-env/Dockerfile.test new file mode 100644 index 00000000..2232c7c8 --- /dev/null +++ b/images/build-env/Dockerfile.test @@ -0,0 +1,4 @@ +ARG base +FROM "${base}" +RUN bioconda-utils --version +RUN bioconda-utils --help From 3938cd154e746824531a197871fad0edc2dbfa33 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 17:38:49 -0500 Subject: [PATCH 16/98] fix name --- .github/workflows/build-env-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index e7300f73..dc84040d 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -1,4 +1,4 @@ -name: 'Build & Push: base-glibc-busybox-bash' +name: 'Build & Push: bioconda-utils-build-env-cos7' on: pull_request: paths: From 66efe129b40085a456143286e25065a66ab4d539 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 17:39:37 -0500 Subject: [PATCH 17/98] version bumps --- .github/workflows/base-glibc-busybox-bash.yaml | 2 +- .github/workflows/base-glibc-debian-bash.yaml | 2 +- .github/workflows/build-env-image.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/base-glibc-busybox-bash.yaml b/.github/workflows/base-glibc-busybox-bash.yaml index 3ef3ac71..e86b7df2 100644 --- a/.github/workflows/base-glibc-busybox-bash.yaml +++ b/.github/workflows/base-glibc-busybox-bash.yaml @@ -19,7 +19,7 @@ jobs: # The base image is not intended to change often and should be used with # version tags or checksum IDs, but not via "latest". MAJOR_VERSION: 3 - MINOR_VERSION: 0 + MINOR_VERSION: 1 IMAGE_NAME: base-glibc-busybox-bash BUSYBOX_VERSION: '1.36.1' DEBIAN_VERSION: '12.2' diff --git a/.github/workflows/base-glibc-debian-bash.yaml b/.github/workflows/base-glibc-debian-bash.yaml index 6692f558..6f264521 100644 --- a/.github/workflows/base-glibc-debian-bash.yaml +++ b/.github/workflows/base-glibc-debian-bash.yaml @@ -19,7 +19,7 @@ jobs: # The base image is not intended to change often and should be used with # version tags or checksum IDs, but not via "latest". MAJOR_VERSION: 3 - MINOR_VERSION: 0 + MINOR_VERSION: 1 IMAGE_NAME: base-glibc-debian-bash DEBIAN_VERSION: '12.2' diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index dc84040d..9bb9afef 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -16,7 +16,7 @@ jobs: # The base image is not intended to change often and should be used with # version tags or checksum IDs, but not via "latest". MAJOR_VERSION: 3 - MINOR_VERSION: 0 + MINOR_VERSION: 1 IMAGE_NAME: bioconda-utils-build-env-cos7 steps: From d257763a76d9d73d079fc1ac1802fa52d38db573 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 17:42:54 -0500 Subject: [PATCH 18/98] match format of others --- .github/workflows/build-env-image.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 9bb9afef..3ab77c05 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -1,12 +1,16 @@ name: 'Build & Push: bioconda-utils-build-env-cos7' on: - pull_request: - paths: - - 'images/build-env/**' - - '.github/workflows/build-env-image.yml' push: branches: - - 'main' + - main + paths: + - images/build-env/** + - .github/workflows/build-env-image.yml + pull_request: + paths: + - images/build-env/** + - .github/workflows/build-env-image.yml + jobs: build: From 82bd178331959e70b221341e0aabaa36b4eb134c Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 17:46:08 -0500 Subject: [PATCH 19/98] syntax --- .github/workflows/build-env-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 3ab77c05..91892419 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -2,7 +2,7 @@ name: 'Build & Push: bioconda-utils-build-env-cos7' on: push: branches: - - main + - main paths: - images/build-env/** - .github/workflows/build-env-image.yml @@ -12,6 +12,7 @@ on: - .github/workflows/build-env-image.yml + jobs: build: name: Build & Push From e9d5cf63a2b753be1fb9590e1512d81aab72e926 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 17:48:31 -0500 Subject: [PATCH 20/98] syntax --- .github/workflows/build-env-image.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 91892419..aaea6185 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -11,8 +11,6 @@ on: - images/build-env/** - .github/workflows/build-env-image.yml - - jobs: build: name: Build & Push @@ -29,6 +27,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Checkout bioconda-utils uses: actions/checkout@v4 with: From cfdcde2e647ec2e7b24e32b0dde5eabbc3316efc Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 21:31:16 -0500 Subject: [PATCH 21/98] syntax --- .github/workflows/build-env-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index aaea6185..cb769807 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -29,7 +29,7 @@ jobs: fetch-depth: 0 - name: Checkout bioconda-utils - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: 0 repository: 'bioconda/bioconda-utils' From 5d0aceb7ef40547006e36c761c727f0e0578b037 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 21:32:19 -0500 Subject: [PATCH 22/98] syntax --- .github/workflows/build-env-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index cb769807..78489804 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -24,12 +24,12 @@ jobs: steps: - name: Checkout bioconda-containers - - uses: actions/checkout@v4 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Checkout bioconda-utils - - uses: actions/checkout@v4 + uses: actions/checkout@v4 with: fetch-depth: 0 repository: 'bioconda/bioconda-utils' From db02883b5c8fae1c4fe46dc5eb7f74900f0d7a66 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 21:38:40 -0500 Subject: [PATCH 23/98] move dockerfiles to dir named after image --- images/{build-env => bioconda-utils-build-env-cos7}/Dockerfile | 0 .../{build-env => bioconda-utils-build-env-cos7}/Dockerfile.test | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename images/{build-env => bioconda-utils-build-env-cos7}/Dockerfile (100%) rename images/{build-env => bioconda-utils-build-env-cos7}/Dockerfile.test (100%) diff --git a/images/build-env/Dockerfile b/images/bioconda-utils-build-env-cos7/Dockerfile similarity index 100% rename from images/build-env/Dockerfile rename to images/bioconda-utils-build-env-cos7/Dockerfile diff --git a/images/build-env/Dockerfile.test b/images/bioconda-utils-build-env-cos7/Dockerfile.test similarity index 100% rename from images/build-env/Dockerfile.test rename to images/bioconda-utils-build-env-cos7/Dockerfile.test From de684e66b4bc1c24e24984ef17e3d218905bdb46 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 21:42:46 -0500 Subject: [PATCH 24/98] echo --- .github/workflows/build-env-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 78489804..30653cbf 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -70,8 +70,8 @@ jobs: "arm64=quay.io/condaforge/linux-anvil-aarch64"; do # Unpack archs and base images - arch=$(cut -f1 -d "=" $arch_and_image) - base_image=$(cut -f2 -d "=" $arch_and_image) + arch=$(echo $arch_and_image | cut -f1 -d "=") + base_image=$(echo $arch_and_image | cut -f2 -d "=") # --iidfile prints the built image ID to the specified file. This is # used so we can refer to the image in later steps. From 690e42a612a56f124858514d6f2bd62281d285ff Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 21:44:49 -0500 Subject: [PATCH 25/98] separate command --- .github/workflows/build-env-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 30653cbf..dc34c583 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -79,7 +79,7 @@ jobs: buildah bud \ --arch="${arch}" \ --iidfile="${iidfile}" \ - --build-arg=base_image="$base_image" \ + --build-arg=base_image="$base_image" image_id="$( cat "${iidfile}" )" rm "${iidfile}" From 2dd87a36be38e6870dd329f416332c90ab0f9675 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 22:14:58 -0500 Subject: [PATCH 26/98] clone bioconda-utils inside image dir --- .github/workflows/build-env-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index dc34c583..2e96e7dc 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -33,7 +33,7 @@ jobs: with: fetch-depth: 0 repository: 'bioconda/bioconda-utils' - path: 'bioconda-utils' + path: 'images/bioconda-utils-build-env-cos7/bioconda-utils' - name: Set up QEMU uses: docker/setup-qemu-action@v2 From cee51474c39c289acdcc392a599fd89c09d4dd97 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 22:18:21 -0500 Subject: [PATCH 27/98] bump qemu action version --- .github/workflows/base-glibc-busybox-bash.yaml | 2 +- .github/workflows/base-glibc-debian-bash.yaml | 2 +- .github/workflows/build-env-image.yml | 2 +- .github/workflows/create-env.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/base-glibc-busybox-bash.yaml b/.github/workflows/base-glibc-busybox-bash.yaml index e86b7df2..300702a8 100644 --- a/.github/workflows/base-glibc-busybox-bash.yaml +++ b/.github/workflows/base-glibc-busybox-bash.yaml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 diff --git a/.github/workflows/base-glibc-debian-bash.yaml b/.github/workflows/base-glibc-debian-bash.yaml index 6f264521..29abe884 100644 --- a/.github/workflows/base-glibc-debian-bash.yaml +++ b/.github/workflows/base-glibc-debian-bash.yaml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/build-env-image.yml index 2e96e7dc..e6969c3e 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/build-env-image.yml @@ -36,7 +36,7 @@ jobs: path: 'images/bioconda-utils-build-env-cos7/bioconda-utils' - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 diff --git a/.github/workflows/create-env.yaml b/.github/workflows/create-env.yaml index 21162b41..faefe0bb 100644 --- a/.github/workflows/create-env.yaml +++ b/.github/workflows/create-env.yaml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 From 03f6fb70b0e3ce34cd938ed9b1049dc76b098a5c Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 22:25:22 -0500 Subject: [PATCH 28/98] activate env for testing --- images/bioconda-utils-build-env-cos7/Dockerfile.test | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/images/bioconda-utils-build-env-cos7/Dockerfile.test b/images/bioconda-utils-build-env-cos7/Dockerfile.test index 2232c7c8..1c9b9830 100644 --- a/images/bioconda-utils-build-env-cos7/Dockerfile.test +++ b/images/bioconda-utils-build-env-cos7/Dockerfile.test @@ -1,4 +1,6 @@ ARG base FROM "${base}" -RUN bioconda-utils --version -RUN bioconda-utils --help +RUN . /opt/conda/etc/profile.d/conda.sh \ + && conda activate base \ + && bioconda-utils --version \ + && bioconda-utils --help From dd004ce83fd1d105eb0cf159f154028812c30645 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 22:28:34 -0500 Subject: [PATCH 29/98] version bump create-env --- .github/workflows/create-env.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-env.yaml b/.github/workflows/create-env.yaml index faefe0bb..811cb643 100644 --- a/.github/workflows/create-env.yaml +++ b/.github/workflows/create-env.yaml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-22.04 env: MAJOR_VERSION: 3 - MINOR_VERSION: 0 + MINOR_VERSION: 1 IMAGE_NAME: create-env steps: From 1ea327067563edbb36c2e9db81c1dd9b96092421 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 22:28:45 -0500 Subject: [PATCH 30/98] rename yaml to be consistent with image name --- ...ld-env-image.yml => bioconda-utils-build-env-cos7.yml} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{build-env-image.yml => bioconda-utils-build-env-cos7.yml} (97%) diff --git a/.github/workflows/build-env-image.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml similarity index 97% rename from .github/workflows/build-env-image.yml rename to .github/workflows/bioconda-utils-build-env-cos7.yml index e6969c3e..5c655556 100644 --- a/.github/workflows/build-env-image.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -4,12 +4,12 @@ on: branches: - main paths: - - images/build-env/** - - .github/workflows/build-env-image.yml + - images/bioconda-utils-build-env-cos7/** + - .github/workflows/bioconda-utils-build-env-cos7.yml pull_request: paths: - - images/build-env/** - - .github/workflows/build-env-image.yml + - images/bioconda-utils-build-env-cos7/** + - .github/workflows/bioconda-utils-build-env-cos7.yml jobs: build: From ce01478f20a705222bc4fd0c28de259ca83661ef Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 10:24:58 -0500 Subject: [PATCH 31/98] fix getting bioconda-utils version --- .github/workflows/bioconda-utils-build-env-cos7.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index 5c655556..bce71516 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -90,7 +90,7 @@ jobs: pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )" glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )" bash="$( run bash --version | sed '1!d' )" - bioconda_utils="$( run bioconda-utils --version )" + bioconda_utils="$( run ". /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version" )" buildah rm "${container}" # Store package/version info as labels for the image From 2ef2354b9f8d6c760646ff2ef84ca7bf7d5f90ea Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 10:37:05 -0500 Subject: [PATCH 32/98] rm labeling using bioconda-utils for now --- .github/workflows/bioconda-utils-build-env-cos7.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index bce71516..d01bdba0 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -90,7 +90,6 @@ jobs: pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )" glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )" bash="$( run bash --version | sed '1!d' )" - bioconda_utils="$( run ". /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version" )" buildah rm "${container}" # Store package/version info as labels for the image @@ -100,7 +99,6 @@ jobs: --label=bash="${bash}" \ --label=deb-list="${deb_list}" \ --label=pkg-list="${pkg_list}" \ - --label=bioconda-utils="${bioconda_utils}" \ "${container}" # Store the new image (now with labels) From fbff2c834c0d1cc2f0abc8869afb9f632a0d62b7 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 10:57:57 -0500 Subject: [PATCH 33/98] add back bioconda-utils label --- .github/workflows/bioconda-utils-build-env-cos7.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index d01bdba0..f66dd9af 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -90,6 +90,7 @@ jobs: pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )" glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )" bash="$( run bash --version | sed '1!d' )" + bioconda_utils="$( run sh -c '. /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version' | rev | cut -f1 -d " " | rev )" buildah rm "${container}" # Store package/version info as labels for the image @@ -99,6 +100,7 @@ jobs: --label=bash="${bash}" \ --label=deb-list="${deb_list}" \ --label=pkg-list="${pkg_list}" \ + --label=bioconda-utils="${bioconda_utils}" \ "${container}" # Store the new image (now with labels) From 19aba6bf29f42840741263c11b140a21e8342ae5 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 14:29:36 -0500 Subject: [PATCH 34/98] target test-push branch --- .github/workflows/bioconda-utils-build-env-cos7.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index f66dd9af..a180973d 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -2,7 +2,7 @@ name: 'Build & Push: bioconda-utils-build-env-cos7' on: push: branches: - - main + - test-push paths: - images/bioconda-utils-build-env-cos7/** - .github/workflows/bioconda-utils-build-env-cos7.yml @@ -177,7 +177,7 @@ jobs: esac done - - if: ${{ github.ref == 'refs/heads/main' }} + - if: ${{ github.ref == 'refs/heads/test-push' }} name: Push uses: redhat-actions/push-to-registry@v2 with: @@ -187,7 +187,7 @@ jobs: username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - - if: ${{ github.ref == 'refs/heads/main' }} + - if: ${{ github.ref == 'refs/heads/test-push' }} name: Test Pushed run: | image='${{ env.IMAGE_NAME }}' From 1463464d7cb7c7f424f91388898e8754a98525ea Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 15:34:42 -0500 Subject: [PATCH 35/98] differentiate between image name and image dir --- .../bioconda-utils-build-env-cos7.yml | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index a180973d..4e07ca69 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -20,6 +20,10 @@ jobs: # version tags or checksum IDs, but not via "latest". MAJOR_VERSION: 3 MINOR_VERSION: 1 + + # Used for testing -- set to something like 'tmp-' or 'test-' to prefix + # images with this name during testing + IMAGE_PREFIX: "tmp-" IMAGE_NAME: bioconda-utils-build-env-cos7 steps: @@ -44,9 +48,9 @@ jobs: id: build run: | set -xeu - cd 'images/${{ env.IMAGE_NAME }}' - image_name='${{ env.IMAGE_NAME }}' + image_name='${{ env.IMAGE_PREFIX }}${{ env.IMAGE_NAME }}' + image_dir='images/${{ env.IMAGE_NAME }}' tags=' ${{ env.MAJOR_VERSION }} ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} @@ -54,10 +58,13 @@ jobs: ' # Adds image and tags to outputs which can be used in later steps. printf %s\\n \ - "image=${image_name}" \ + "image_dir=${image_dir}" \ + "image_name=${image_name}" \ "tags=$( echo ${tags} )" \ >> $GITHUB_OUTPUT + cd 'images/${{ env.IMAGE_NAME }}' + # Create manifest (which is considered arch-independent) for tag in ${tags} ; do buildah manifest create "${image_name}:${tag}" @@ -120,7 +127,8 @@ jobs: - name: Test run: | - image='${{ steps.build.outputs.image }}' + image_name='${{ steps.build.outputs.image_name }}' + image_dir='${{ steps.build.outputs.image_dir }}' # Extract image ids from manifest to test. ids="$( @@ -141,7 +149,7 @@ jobs: buildah bud \ --build-arg=base="${id}" \ --file=Dockerfile.test \ - "images/${image}" + "${image_dir}" done buildah rmi --prune || true @@ -151,7 +159,7 @@ jobs: # => Try to use the REST API to check for duplicate tags and exit if they exist response="$( curl -sL \ - 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image }}/tag/' + 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image_name }}/tag/' )" existing_tags="$( @@ -181,7 +189,7 @@ jobs: name: Push uses: redhat-actions/push-to-registry@v2 with: - image: ${{ steps.build.outputs.image }} + image: ${{ steps.build.outputs.image_name }} tags: ${{ steps.build.outputs.tags }} registry: ${{ secrets.QUAY_BIOCONDA_REPO }} username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} @@ -190,10 +198,12 @@ jobs: - if: ${{ github.ref == 'refs/heads/test-push' }} name: Test Pushed run: | - image='${{ env.IMAGE_NAME }}' + + image_name='${{ steps.build.outputs.image_name }}' + image_dir='${{ steps.build.outputs.image_dir }}' ids="$( for tag in ${{ steps.build.outputs.tags }} ; do - buildah manifest inspect "${image}:${tag}" \ + buildah manifest inspect "${image_name}:${tag}" \ | jq -r '.manifests[]|.digest' \ | while read id ; do buildah images --format '{{.ID}}{{.Digest}}' \ @@ -207,6 +217,6 @@ jobs: buildah bud \ --build-arg=base="${id}" \ --file=Dockerfile.test \ - "images/${image}" + "${image_dir}" done buildah rmi --prune || true From c035696e9c4a9b1267d865203e36f5ca2c253be4 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 15:53:24 -0500 Subject: [PATCH 36/98] handle cases if image doesn't exist in registry yet --- .github/workflows/bioconda-utils-build-env-cos7.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index 4e07ca69..35285a7d 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -162,6 +162,13 @@ jobs: 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image_name }}/tag/' )" + # This might be the first time making this image (e.g., will likely + # happen when using a test prefix), in which case there will be no + # available images. + if [ -z "${response}" ]; then + exit 0 + ] + existing_tags="$( printf %s "${response}" \ | jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name' From c0c0fb1a58e2e28b524efbd5760bec5667ca44ae Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 15:53:44 -0500 Subject: [PATCH 37/98] hard-code repo --- .github/workflows/bioconda-utils-build-env-cos7.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index 35285a7d..c31436b7 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -198,7 +198,7 @@ jobs: with: image: ${{ steps.build.outputs.image_name }} tags: ${{ steps.build.outputs.tags }} - registry: ${{ secrets.QUAY_BIOCONDA_REPO }} + registry: quay.io/bioconda username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} From 3bed6b0f0ccd6529d55d4b0e9d9908684e7b2dc1 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 17:05:35 -0500 Subject: [PATCH 38/98] typo --- .github/workflows/bioconda-utils-build-env-cos7.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index c31436b7..5e06358c 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -167,7 +167,7 @@ jobs: # available images. if [ -z "${response}" ]; then exit 0 - ] + fi existing_tags="$( printf %s "${response}" \ From 3b3df34cd86fd28036cd96985638bb3165265c49 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 17:22:13 -0500 Subject: [PATCH 39/98] debug --- .github/workflows/bioconda-utils-build-env-cos7.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index 5e06358c..8d9322d8 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -165,6 +165,8 @@ jobs: # This might be the first time making this image (e.g., will likely # happen when using a test prefix), in which case there will be no # available images. + echo "response:" + echo $response if [ -z "${response}" ]; then exit 0 fi From 29f1500609325bae7942a69f6d7529fa6d1a866a Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 17:52:19 -0500 Subject: [PATCH 40/98] better check --- .github/workflows/bioconda-utils-build-env-cos7.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index 8d9322d8..dfcaf324 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -165,9 +165,7 @@ jobs: # This might be the first time making this image (e.g., will likely # happen when using a test prefix), in which case there will be no # available images. - echo "response:" - echo $response - if [ -z "${response}" ]; then + if [ "$(echo "${response}" | jq -r '.error_message')" == "Requires authentication" ]; then exit 0 fi From e4a05408525493f7c4bc84a71e65cccdf1aa9410 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 18:09:34 -0500 Subject: [PATCH 41/98] try pushing an image that has worked before --- .github/workflows/base-glibc-debian-bash.yaml | 46 +++++++++++++------ 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/.github/workflows/base-glibc-debian-bash.yaml b/.github/workflows/base-glibc-debian-bash.yaml index 29abe884..da37fcbc 100644 --- a/.github/workflows/base-glibc-debian-bash.yaml +++ b/.github/workflows/base-glibc-debian-bash.yaml @@ -2,7 +2,7 @@ name: 'Build & Push: base-glibc-debian-bash' on: push: branches: - - main + - test-push paths: - images/base-glibc-debian-bash/* - .github/workflows/base-glibc-debian-bash.yaml @@ -20,8 +20,11 @@ jobs: # version tags or checksum IDs, but not via "latest". MAJOR_VERSION: 3 MINOR_VERSION: 1 - IMAGE_NAME: base-glibc-debian-bash DEBIAN_VERSION: '12.2' + # Used for testing -- set to something like 'tmp-' or 'test-' to prefix + # images with this name during testing + IMAGE_PREFIX: "tmp-" + IMAGE_NAME: base-glibc-debian-bash steps: - uses: actions/checkout@v4 @@ -35,9 +38,9 @@ jobs: id: build run: | set -xeu - cd 'images/${{ env.IMAGE_NAME }}' - image_name='${{ env.IMAGE_NAME }}' + image_name='${{ env.IMAGE_PREFIX }}${{ env.IMAGE_NAME }}' + image_dir='images/${{ env.IMAGE_NAME }}' tags=' ${{ env.MAJOR_VERSION }} ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} @@ -45,10 +48,13 @@ jobs: ' # Adds image and tags to outputs which can be used in later steps. printf %s\\n \ - "image=${image_name}" \ + "image_dir=${image_dir}" \ + "image_name=${image_name}" \ "tags=$( echo ${tags} )" \ >> $GITHUB_OUTPUT + cd 'images/${{ env.IMAGE_NAME }}' + # Create manifest (which is considered arch-independent) for tag in ${tags} ; do buildah manifest create "${image_name}:${tag}" @@ -102,7 +108,8 @@ jobs: - name: Test run: | - image='${{ steps.build.outputs.image }}' + image_name='${{ steps.build.outputs.image_name }}' + image_dir='${{ steps.build.outputs.image_dir }}' # Extract image ids from manifest to test. ids="$( @@ -123,7 +130,7 @@ jobs: buildah bud \ --build-arg=base="${id}" \ --file=Dockerfile.test \ - "images/${image}" + "${image_dir}" done buildah rmi --prune || true @@ -133,9 +140,16 @@ jobs: # => Try to use the REST API to check for duplicate tags and exit if they exist response="$( curl -sL \ - 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image }}/tag/' + 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image_name }}/tag/' )" + # This might be the first time making this image (e.g., will likely + # happen when using a test prefix), in which case there will be no + # available images. + if [ "$(echo "${response}" | jq -r '.error_message')" == "Requires authentication" ]; then + exit 0 + fi + existing_tags="$( printf %s "${response}" \ | jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name' @@ -159,23 +173,25 @@ jobs: esac done - - if: ${{ github.ref == 'refs/heads/main' }} + - if: ${{ github.ref == 'refs/heads/test-push' }} name: Push uses: redhat-actions/push-to-registry@v2 with: - image: ${{ steps.build.outputs.image }} + image: ${{ steps.build.outputs.image_name }} tags: ${{ steps.build.outputs.tags }} - registry: ${{ secrets.QUAY_BIOCONDA_REPO }} + registry: quay.io/bioconda username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - - if: ${{ github.ref == 'refs/heads/main' }} + - if: ${{ github.ref == 'refs/heads/test-push' }} name: Test Pushed run: | - image='${{ env.IMAGE_NAME }}' + + image_name='${{ steps.build.outputs.image_name }}' + image_dir='${{ steps.build.outputs.image_dir }}' ids="$( for tag in ${{ steps.build.outputs.tags }} ; do - buildah manifest inspect "${image}:${tag}" \ + buildah manifest inspect "${image_name}:${tag}" \ | jq -r '.manifests[]|.digest' \ | while read id ; do buildah images --format '{{.ID}}{{.Digest}}' \ @@ -189,6 +205,6 @@ jobs: buildah bud \ --build-arg=base="${id}" \ --file=Dockerfile.test \ - "images/${image}" + "${image_dir}" done buildah rmi --prune || true From 1164bfbe8aa09c26c5628587ef7d88360323bcf4 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sun, 28 Jan 2024 18:23:31 -0500 Subject: [PATCH 42/98] port recent changes to busybox --- .../workflows/base-glibc-busybox-bash.yaml | 44 +++++++++++++------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/base-glibc-busybox-bash.yaml b/.github/workflows/base-glibc-busybox-bash.yaml index 300702a8..9629acd3 100644 --- a/.github/workflows/base-glibc-busybox-bash.yaml +++ b/.github/workflows/base-glibc-busybox-bash.yaml @@ -20,9 +20,12 @@ jobs: # version tags or checksum IDs, but not via "latest". MAJOR_VERSION: 3 MINOR_VERSION: 1 - IMAGE_NAME: base-glibc-busybox-bash BUSYBOX_VERSION: '1.36.1' DEBIAN_VERSION: '12.2' + # Used for testing -- set to something like 'tmp-' or 'test-' to prefix + # images with this name during testing + IMAGE_PREFIX: "tmp-" + IMAGE_NAME: base-glibc-busybox-bash steps: - uses: actions/checkout@v4 @@ -36,9 +39,9 @@ jobs: id: build run: | set -xeu - cd 'images/${{ env.IMAGE_NAME }}' - image_name='${{ env.IMAGE_NAME }}' + image_name='${{ env.IMAGE_PREFIX }}${{ env.IMAGE_NAME }}' + image_dir='images/${{ env.IMAGE_NAME }}' tags=' ${{ env.MAJOR_VERSION }} ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} @@ -46,10 +49,13 @@ jobs: ' # Adds image and tags to outputs which can be used in later steps. printf %s\\n \ - "image=${image_name}" \ + "image_dir=${image_dir}" \ + "image_name=${image_name}" \ "tags=$( echo ${tags} )" \ >> $GITHUB_OUTPUT + cd 'images/${{ env.IMAGE_NAME }}' + # Create manifest (which is considered arch-independent) for tag in ${tags} ; do buildah manifest create "${image_name}:${tag}" @@ -112,7 +118,8 @@ jobs: - name: Test run: | - image='${{ steps.build.outputs.image }}' + image_name='${{ steps.build.outputs.image_name }}' + image_dir='${{ steps.build.outputs.image_dir }}' # Extract image ids from manifest to test. ids="$( @@ -133,7 +140,7 @@ jobs: buildah bud \ --build-arg=base="${id}" \ --file=Dockerfile.test \ - "images/${image}" + "${image_dir}" done buildah rmi --prune || true @@ -143,9 +150,16 @@ jobs: # => Try to use the REST API to check for duplicate tags and exit if they exist response="$( curl -sL \ - 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image }}/tag/' + 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image_name }}/tag/' )" + # This might be the first time making this image (e.g., will likely + # happen when using a test prefix), in which case there will be no + # available images. + if [ "$(echo "${response}" | jq -r '.error_message')" == "Requires authentication" ]; then + exit 0 + fi + existing_tags="$( printf %s "${response}" \ | jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name' @@ -169,23 +183,25 @@ jobs: esac done - - if: ${{ github.ref == 'refs/heads/main' }} + - if: ${{ github.ref == 'refs/heads/test-push' }} name: Push uses: redhat-actions/push-to-registry@v2 with: - image: ${{ steps.build.outputs.image }} + image: ${{ steps.build.outputs.image_name }} tags: ${{ steps.build.outputs.tags }} - registry: ${{ secrets.QUAY_BIOCONDA_REPO }} + registry: quay.io/bioconda username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - - if: ${{ github.ref == 'refs/heads/main' }} + - if: ${{ github.ref == 'refs/heads/test-push' }} name: Test Pushed run: | - image='${{ env.IMAGE_NAME }}' + + image_name='${{ steps.build.outputs.image_name }}' + image_dir='${{ steps.build.outputs.image_dir }}' ids="$( for tag in ${{ steps.build.outputs.tags }} ; do - buildah manifest inspect "${image}:${tag}" \ + buildah manifest inspect "${image_name}:${tag}" \ | jq -r '.manifests[]|.digest' \ | while read id ; do buildah images --format '{{.ID}}{{.Digest}}' \ @@ -199,6 +215,6 @@ jobs: buildah bud \ --build-arg=base="${id}" \ --file=Dockerfile.test \ - "images/${image}" + "${image_dir}" done buildah rmi --prune || true From 5fec03600aba98b6c27bd411b781d3d3dcb7e2ba Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 29 Jan 2024 15:10:50 -0500 Subject: [PATCH 43/98] comment out push --- .github/workflows/bioconda-utils-build-env-cos7.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index dfcaf324..a96dc41d 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -1,11 +1,11 @@ name: 'Build & Push: bioconda-utils-build-env-cos7' on: push: - branches: - - test-push - paths: - - images/bioconda-utils-build-env-cos7/** - - .github/workflows/bioconda-utils-build-env-cos7.yml + # branches: + # - test-push + # paths: + # - images/bioconda-utils-build-env-cos7/** + # - .github/workflows/bioconda-utils-build-env-cos7.yml pull_request: paths: - images/bioconda-utils-build-env-cos7/** From ed9a1f936aa0f554918aceb336ad560f7b4ca1c5 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 29 Jan 2024 15:26:52 -0500 Subject: [PATCH 44/98] try new credentials --- .github/workflows/bioconda-utils-build-env-cos7.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index a96dc41d..832aa1ee 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -199,8 +199,8 @@ jobs: image: ${{ steps.build.outputs.image_name }} tags: ${{ steps.build.outputs.tags }} registry: quay.io/bioconda - username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} - password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} + username: ${{ secrets.QUAY_BIOCONDA_USERNAME_2024 }} + password: ${{ secrets.QUAY_BIOCONDA_TOKEN_2024}} - if: ${{ github.ref == 'refs/heads/test-push' }} name: Test Pushed From 319b352334a2478075ddc91c07830824c93d9bb1 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 29 Jan 2024 15:46:10 -0500 Subject: [PATCH 45/98] whitespace to trigger --- .github/workflows/bioconda-utils-build-env-cos7.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index 832aa1ee..b04855f0 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -1,3 +1,4 @@ + name: 'Build & Push: bioconda-utils-build-env-cos7' on: push: From 1387d2da8d534a90f1ebb14c1f2098fc9cd20dcf Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 29 Jan 2024 15:46:45 -0500 Subject: [PATCH 46/98] disable push for now --- .github/workflows/bioconda-utils-build-env-cos7.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index b04855f0..bd2ebf60 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -1,7 +1,6 @@ - name: 'Build & Push: bioconda-utils-build-env-cos7' on: - push: + # push: # branches: # - test-push # paths: From 8e89ac24652dd8c6954f8ad905b68520d602ac22 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 29 Jan 2024 16:04:05 -0500 Subject: [PATCH 47/98] re-enable push --- .github/workflows/bioconda-utils-build-env-cos7.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index bd2ebf60..1684fca6 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -1,11 +1,11 @@ name: 'Build & Push: bioconda-utils-build-env-cos7' on: - # push: - # branches: - # - test-push - # paths: - # - images/bioconda-utils-build-env-cos7/** - # - .github/workflows/bioconda-utils-build-env-cos7.yml + push: + branches: + - test-push + paths: + - images/bioconda-utils-build-env-cos7/** + - .github/workflows/bioconda-utils-build-env-cos7.yml pull_request: paths: - images/bioconda-utils-build-env-cos7/** From f2c528c34e9d0fd5f6dbe1bfbd8e0e0f3f804e92 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 29 Jan 2024 16:53:02 -0500 Subject: [PATCH 48/98] back to original credentials --- .github/workflows/bioconda-utils-build-env-cos7.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index 1684fca6..dfcaf324 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -199,8 +199,8 @@ jobs: image: ${{ steps.build.outputs.image_name }} tags: ${{ steps.build.outputs.tags }} registry: quay.io/bioconda - username: ${{ secrets.QUAY_BIOCONDA_USERNAME_2024 }} - password: ${{ secrets.QUAY_BIOCONDA_TOKEN_2024}} + username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} + password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - if: ${{ github.ref == 'refs/heads/test-push' }} name: Test Pushed From a4d6bc16327918d20383fbb09fa186e6a0227654 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:19:26 -0500 Subject: [PATCH 49/98] rm existing workflows for testing --- .../workflows/base-glibc-busybox-bash.yaml | 220 ----------------- .github/workflows/base-glibc-debian-bash.yaml | 210 ---------------- .../bioconda-recipes-issue-responder.yaml | 112 --------- .../bioconda-utils-build-env-cos7.yml | 229 ------------------ .github/workflows/bot.yaml | 123 ---------- .github/workflows/create-env.yaml | 145 ----------- 6 files changed, 1039 deletions(-) delete mode 100644 .github/workflows/base-glibc-busybox-bash.yaml delete mode 100644 .github/workflows/base-glibc-debian-bash.yaml delete mode 100644 .github/workflows/bioconda-recipes-issue-responder.yaml delete mode 100644 .github/workflows/bioconda-utils-build-env-cos7.yml delete mode 100644 .github/workflows/bot.yaml delete mode 100644 .github/workflows/create-env.yaml diff --git a/.github/workflows/base-glibc-busybox-bash.yaml b/.github/workflows/base-glibc-busybox-bash.yaml deleted file mode 100644 index 9629acd3..00000000 --- a/.github/workflows/base-glibc-busybox-bash.yaml +++ /dev/null @@ -1,220 +0,0 @@ -name: 'Build & Push: base-glibc-busybox-bash' -on: - push: - branches: - - main - paths: - - images/base-glibc-busybox-bash/* - - .github/workflows/base-glibc-busybox-bash.yaml - pull_request: - paths: - - images/base-glibc-busybox-bash/* - - .github/workflows/base-glibc-busybox-bash.yaml - -jobs: - build: - name: Build & Push - runs-on: ubuntu-22.04 - env: - # The base image is not intended to change often and should be used with - # version tags or checksum IDs, but not via "latest". - MAJOR_VERSION: 3 - MINOR_VERSION: 1 - BUSYBOX_VERSION: '1.36.1' - DEBIAN_VERSION: '12.2' - # Used for testing -- set to something like 'tmp-' or 'test-' to prefix - # images with this name during testing - IMAGE_PREFIX: "tmp-" - IMAGE_NAME: base-glibc-busybox-bash - - steps: - - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - - name: Build - id: build - run: | - set -xeu - - image_name='${{ env.IMAGE_PREFIX }}${{ env.IMAGE_NAME }}' - image_dir='images/${{ env.IMAGE_NAME }}' - tags=' - ${{ env.MAJOR_VERSION }} - ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} - latest - ' - # Adds image and tags to outputs which can be used in later steps. - printf %s\\n \ - "image_dir=${image_dir}" \ - "image_name=${image_name}" \ - "tags=$( echo ${tags} )" \ - >> $GITHUB_OUTPUT - - cd 'images/${{ env.IMAGE_NAME }}' - - # Create manifest (which is considered arch-independent) - for tag in ${tags} ; do - buildah manifest create "${image_name}:${tag}" - done - - # --iidfile prints the built image ID to the specified file. This is - # used so we can refer to the image in later steps. - iidfile="$( mktemp )" - buildah bud \ - --iidfile="${iidfile}" \ - --build-arg=busybox_version='${{ env.BUSYBOX_VERSION }}' \ - --file=Dockerfile.busybox - busybox_image="$( cat "${iidfile}" )" - rm "${iidfile}" - - for arch in amd64 arm64 ; do - iidfile="$( mktemp )" - buildah bud \ - --arch="${arch}" \ - --iidfile="${iidfile}" \ - --build-arg=busybox_image="${busybox_image}" \ - --build-arg=debian_version='${{ env.DEBIAN_VERSION }}' - image_id="$( cat "${iidfile}" )" - rm "${iidfile}" - - # Extract various package info and version info to store as labels - container="$( buildah from "${image_id}" )" - run() { buildah run "${container}" "${@}" ; } - deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )" - pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )" - glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )" - busybox="$( run busybox | sed '1!d' )" - bash="$( run bash --version | sed '1!d' )" - buildah rm "${container}" - - # Store package/version info as labels for the image - container="$( buildah from "${image_id}" )" - buildah config \ - --label=glibc="${glibc}" \ - --label=busybox="${busybox}" \ - --label=bash="${bash}" \ - --label=deb-list="${deb_list}" \ - --label=pkg-list="${pkg_list}" \ - "${container}" - - # Store the new image (now with labels) - image_id="$( buildah commit "${container}" )" - buildah rm "${container}" - - # image tag includes arch; then added to manifest which does not include arch - for tag in ${tags} ; do - buildah tag \ - "${image_id}" \ - "${image_name}:${tag}-${arch}" - buildah manifest add \ - "${image_name}:${tag}" \ - "${image_id}" - done - done - - - name: Test - run: | - image_name='${{ steps.build.outputs.image_name }}' - image_dir='${{ steps.build.outputs.image_dir }}' - - # Extract image ids from manifest to test. - ids="$( - for tag in ${{ steps.build.outputs.tags }} ; do - buildah manifest inspect "${image}:${tag}" \ - | jq -r '.manifests[]|.digest' \ - | while read id ; do - buildah images --format '{{.ID}}{{.Digest}}' \ - | sed -n "s/${id}//p" - done - done - )" - - # See Dockerfile.test for actual tests run - ids="$( printf %s "${ids}" | sort -u )" - for id in ${ids} ; do - podman history "${id}" - buildah bud \ - --build-arg=base="${id}" \ - --file=Dockerfile.test \ - "${image_dir}" - done - buildah rmi --prune || true - - - name: Check Tags - run: | - # FIX upstream: Quay.io does not support immutable images currently. - # => Try to use the REST API to check for duplicate tags and exit if they exist - response="$( - curl -sL \ - 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image_name }}/tag/' - )" - - # This might be the first time making this image (e.g., will likely - # happen when using a test prefix), in which case there will be no - # available images. - if [ "$(echo "${response}" | jq -r '.error_message')" == "Requires authentication" ]; then - exit 0 - fi - - existing_tags="$( - printf %s "${response}" \ - | jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name' - )" \ - || { - printf %s\\n \ - 'Could not get list of image tags.' \ - 'Does the repository exist on Quay.io?' \ - 'Quay.io REST API response was:' \ - "${response}" - exit 1 - } - for tag in ${{ steps.build.outputs.tags }} ; do - case "${tag}" in - latest | '${{ env.MAJOR_VERSION }}' ) ;; - * ) - if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then - printf 'Tag %s already exists!\n' "${tag}" - exit 1 - fi - esac - done - - - if: ${{ github.ref == 'refs/heads/test-push' }} - name: Push - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build.outputs.image_name }} - tags: ${{ steps.build.outputs.tags }} - registry: quay.io/bioconda - username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} - password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - - - if: ${{ github.ref == 'refs/heads/test-push' }} - name: Test Pushed - run: | - - image_name='${{ steps.build.outputs.image_name }}' - image_dir='${{ steps.build.outputs.image_dir }}' - ids="$( - for tag in ${{ steps.build.outputs.tags }} ; do - buildah manifest inspect "${image_name}:${tag}" \ - | jq -r '.manifests[]|.digest' \ - | while read id ; do - buildah images --format '{{.ID}}{{.Digest}}' \ - | sed -n "s/${id}//p" - done - done - )" - ids="$( printf %s "${ids}" | sort -u )" - for id in ${ids} ; do - podman history "${id}" - buildah bud \ - --build-arg=base="${id}" \ - --file=Dockerfile.test \ - "${image_dir}" - done - buildah rmi --prune || true diff --git a/.github/workflows/base-glibc-debian-bash.yaml b/.github/workflows/base-glibc-debian-bash.yaml deleted file mode 100644 index da37fcbc..00000000 --- a/.github/workflows/base-glibc-debian-bash.yaml +++ /dev/null @@ -1,210 +0,0 @@ -name: 'Build & Push: base-glibc-debian-bash' -on: - push: - branches: - - test-push - paths: - - images/base-glibc-debian-bash/* - - .github/workflows/base-glibc-debian-bash.yaml - pull_request: - paths: - - images/base-glibc-debian-bash/* - - .github/workflows/base-glibc-debian-bash.yaml - -jobs: - build: - name: Build & Push - runs-on: ubuntu-22.04 - env: - # The base image is not intended to change often and should be used with - # version tags or checksum IDs, but not via "latest". - MAJOR_VERSION: 3 - MINOR_VERSION: 1 - DEBIAN_VERSION: '12.2' - # Used for testing -- set to something like 'tmp-' or 'test-' to prefix - # images with this name during testing - IMAGE_PREFIX: "tmp-" - IMAGE_NAME: base-glibc-debian-bash - - steps: - - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - - name: Build - id: build - run: | - set -xeu - - image_name='${{ env.IMAGE_PREFIX }}${{ env.IMAGE_NAME }}' - image_dir='images/${{ env.IMAGE_NAME }}' - tags=' - ${{ env.MAJOR_VERSION }} - ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} - latest - ' - # Adds image and tags to outputs which can be used in later steps. - printf %s\\n \ - "image_dir=${image_dir}" \ - "image_name=${image_name}" \ - "tags=$( echo ${tags} )" \ - >> $GITHUB_OUTPUT - - cd 'images/${{ env.IMAGE_NAME }}' - - # Create manifest (which is considered arch-independent) - for tag in ${tags} ; do - buildah manifest create "${image_name}:${tag}" - done - - # --iidfile prints the built image ID to the specified file. This is - # used so we can refer to the image in later steps. - for arch in amd64 arm64 ; do - iidfile="$( mktemp )" - buildah bud \ - --arch="${arch}" \ - --iidfile="${iidfile}" \ - --build-arg=debian_version='${{ env.DEBIAN_VERSION }}' - image_id="$( cat "${iidfile}" )" - rm "${iidfile}" - - # Extract various package info and version info to store as labels - container="$( buildah from "${image_id}" )" - run() { buildah run "${container}" "${@}" ; } - deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )" - pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )" - glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )" - debian="$( run cat /etc/debian_version | sed '1!d' )" - bash="$( run bash --version | sed '1!d' )" - buildah rm "${container}" - - # Store package/version info as labels for the image - container="$( buildah from "${image_id}" )" - buildah config \ - --label=glibc="${glibc}" \ - --label=debian="${debian}" \ - --label=bash="${bash}" \ - --label=deb-list="${deb_list}" \ - --label=pkg-list="${pkg_list}" \ - "${container}" - - # Store the new image (now with labels) - image_id="$( buildah commit "${container}" )" - buildah rm "${container}" - - # image tag includes arch; then added to manifest which does not include arch - for tag in ${tags} ; do - buildah tag \ - "${image_id}" \ - "${image_name}:${tag}-${arch}" - buildah manifest add \ - "${image_name}:${tag}" \ - "${image_id}" - done - done - - - name: Test - run: | - image_name='${{ steps.build.outputs.image_name }}' - image_dir='${{ steps.build.outputs.image_dir }}' - - # Extract image ids from manifest to test. - ids="$( - for tag in ${{ steps.build.outputs.tags }} ; do - buildah manifest inspect "${image}:${tag}" \ - | jq -r '.manifests[]|.digest' \ - | while read id ; do - buildah images --format '{{.ID}}{{.Digest}}' \ - | sed -n "s/${id}//p" - done - done - )" - - # See Dockerfile.test for actual tests run - ids="$( printf %s "${ids}" | sort -u )" - for id in ${ids} ; do - podman history "${id}" - buildah bud \ - --build-arg=base="${id}" \ - --file=Dockerfile.test \ - "${image_dir}" - done - buildah rmi --prune || true - - - name: Check Tags - run: | - # FIX upstream: Quay.io does not support immutable images currently. - # => Try to use the REST API to check for duplicate tags and exit if they exist - response="$( - curl -sL \ - 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image_name }}/tag/' - )" - - # This might be the first time making this image (e.g., will likely - # happen when using a test prefix), in which case there will be no - # available images. - if [ "$(echo "${response}" | jq -r '.error_message')" == "Requires authentication" ]; then - exit 0 - fi - - existing_tags="$( - printf %s "${response}" \ - | jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name' - )" \ - || { - printf %s\\n \ - 'Could not get list of image tags.' \ - 'Does the repository exist on Quay.io?' \ - 'Quay.io REST API response was:' \ - "${response}" - exit 1 - } - for tag in ${{ steps.build.outputs.tags }} ; do - case "${tag}" in - latest | '${{ env.MAJOR_VERSION }}' ) ;; - * ) - if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then - printf 'Tag %s already exists!\n' "${tag}" - exit 1 - fi - esac - done - - - if: ${{ github.ref == 'refs/heads/test-push' }} - name: Push - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build.outputs.image_name }} - tags: ${{ steps.build.outputs.tags }} - registry: quay.io/bioconda - username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} - password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - - - if: ${{ github.ref == 'refs/heads/test-push' }} - name: Test Pushed - run: | - - image_name='${{ steps.build.outputs.image_name }}' - image_dir='${{ steps.build.outputs.image_dir }}' - ids="$( - for tag in ${{ steps.build.outputs.tags }} ; do - buildah manifest inspect "${image_name}:${tag}" \ - | jq -r '.manifests[]|.digest' \ - | while read id ; do - buildah images --format '{{.ID}}{{.Digest}}' \ - | sed -n "s/${id}//p" - done - done - )" - ids="$( printf %s "${ids}" | sort -u )" - for id in ${ids} ; do - podman history "${id}" - buildah bud \ - --build-arg=base="${id}" \ - --file=Dockerfile.test \ - "${image_dir}" - done - buildah rmi --prune || true diff --git a/.github/workflows/bioconda-recipes-issue-responder.yaml b/.github/workflows/bioconda-recipes-issue-responder.yaml deleted file mode 100644 index 7218a752..00000000 --- a/.github/workflows/bioconda-recipes-issue-responder.yaml +++ /dev/null @@ -1,112 +0,0 @@ -name: 'Build & Push: bioconda-recipes-issue-responder' -on: - push: - branches: - - main - paths: - - images/bioconda-recipes-issue-responder/* - - .github/workflows/bioconda-recipes-issue-responder.yaml - pull_request: - paths: - - images/bioconda-recipes-issue-responder/* - - .github/workflows/bioconda-recipes-issue-responder.yaml - -jobs: - build: - name: Build & Push - runs-on: ubuntu-22.04 - env: - IMAGE_NAME: bioconda-recipes-issue-responder - IMAGE_VERSION: '1.1.1' - - steps: - - uses: actions/checkout@v2 - - - name: Build - id: buildah-build - uses: redhat-actions/buildah-build@v2 - with: - image: ${{ env.IMAGE_NAME }} - tags: >- - latest - ${{ env.IMAGE_VERSION }} - context: ./images/${{ env.IMAGE_NAME }} - dockerfiles: | - ./images/${{ env.IMAGE_NAME }}/Dockerfile - - - name: Test - run: | - image='${{ steps.buildah-build.outputs.image }}' - ids="$( - for tag in ${{ steps.buildah-build.outputs.tags }} ; do - buildah images --quiet --no-trunc "${image}:${tag}" - done - )" - ids="$( printf %s "${ids}" | sort -u )" - for id in ${ids} ; do - podman history "${id}" - buildah bud \ - --build-arg=base="${id}" \ - --file=Dockerfile.test \ - "images/${image}" - done - buildah rmi --prune || true - - - name: Check Tags - run: | - # FIX upstream: Quay.io does not support immutable images currently. - # => Try to use the REST API to check for duplicate tags. - respone="$( - curl -sL \ - 'https://quay.io/api/v1/repository/bioconda/${{ steps.buildah-build.outputs.image }}/image' - )" - - existing_tags="$( - printf %s "${respone}" \ - | jq -r '.images[].tags[]' - )" \ - || { - printf %s\\n \ - 'Could not get list of image tags.' \ - 'Does the repository exist on Quay.io?' \ - 'Quay.io REST API response was:' \ - "${respone}" - exit 1 - } - for tag in ${{ steps.buildah-build.outputs.tags }} ; do - if [ \! "${tag}" = latest ] ; then - if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then - printf 'Tag %s already exists!\n' "${tag}" - exit 1 - fi - fi - done - - - if: ${{ github.ref == 'refs/heads/main' }} - name: Push - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.buildah-build.outputs.image }} - tags: ${{ steps.buildah-build.outputs.tags }} - registry: ${{ secrets.QUAY_BIOCONDA_REPO }} - username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} - password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - - - if: ${{ github.ref == 'refs/heads/main' }} - name: Test Pushed - run: | - image='${{ steps.buildah-build.outputs.image }}' - ids="$( - for tag in ${{ steps.buildah-build.outputs.tags }} ; do - buildah images --quiet --no-trunc "${image}:${tag}" - done - )" - ids="$( printf %s "${ids}" | sort -u )" - for id in ${ids} ; do - podman history "${id}" - buildah bud \ - --build-arg=base="${id}" \ - --file=Dockerfile.test \ - "images/${image}" - done - buildah rmi --prune || true diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml deleted file mode 100644 index dfcaf324..00000000 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ /dev/null @@ -1,229 +0,0 @@ -name: 'Build & Push: bioconda-utils-build-env-cos7' -on: - push: - branches: - - test-push - paths: - - images/bioconda-utils-build-env-cos7/** - - .github/workflows/bioconda-utils-build-env-cos7.yml - pull_request: - paths: - - images/bioconda-utils-build-env-cos7/** - - .github/workflows/bioconda-utils-build-env-cos7.yml - -jobs: - build: - name: Build & Push - runs-on: ubuntu-22.04 - env: - # The base image is not intended to change often and should be used with - # version tags or checksum IDs, but not via "latest". - MAJOR_VERSION: 3 - MINOR_VERSION: 1 - - # Used for testing -- set to something like 'tmp-' or 'test-' to prefix - # images with this name during testing - IMAGE_PREFIX: "tmp-" - IMAGE_NAME: bioconda-utils-build-env-cos7 - - steps: - - name: Checkout bioconda-containers - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Checkout bioconda-utils - uses: actions/checkout@v4 - with: - fetch-depth: 0 - repository: 'bioconda/bioconda-utils' - path: 'images/bioconda-utils-build-env-cos7/bioconda-utils' - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - - name: Build - id: build - run: | - set -xeu - - image_name='${{ env.IMAGE_PREFIX }}${{ env.IMAGE_NAME }}' - image_dir='images/${{ env.IMAGE_NAME }}' - tags=' - ${{ env.MAJOR_VERSION }} - ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} - latest - ' - # Adds image and tags to outputs which can be used in later steps. - printf %s\\n \ - "image_dir=${image_dir}" \ - "image_name=${image_name}" \ - "tags=$( echo ${tags} )" \ - >> $GITHUB_OUTPUT - - cd 'images/${{ env.IMAGE_NAME }}' - - # Create manifest (which is considered arch-independent) - for tag in ${tags} ; do - buildah manifest create "${image_name}:${tag}" - done - - # Due to different nomenclature used by conda-forge and buildah, we - # need to map archs to base images. - for arch_and_image in \ - "amd64=quay.io/condaforge/linux-anvil-cos7-x86_64" \ - "arm64=quay.io/condaforge/linux-anvil-aarch64"; - do - # Unpack archs and base images - arch=$(echo $arch_and_image | cut -f1 -d "=") - base_image=$(echo $arch_and_image | cut -f2 -d "=") - - # --iidfile prints the built image ID to the specified file. This is - # used so we can refer to the image in later steps. - iidfile="$( mktemp )" - buildah bud \ - --arch="${arch}" \ - --iidfile="${iidfile}" \ - --build-arg=base_image="$base_image" - image_id="$( cat "${iidfile}" )" - rm "${iidfile}" - - # Extract various package info and version info to store as labels - container="$( buildah from "${image_id}" )" - run() { buildah run "${container}" "${@}" ; } - deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )" - pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )" - glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )" - bash="$( run bash --version | sed '1!d' )" - bioconda_utils="$( run sh -c '. /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version' | rev | cut -f1 -d " " | rev )" - buildah rm "${container}" - - # Store package/version info as labels for the image - container="$( buildah from "${image_id}" )" - buildah config \ - --label=glibc="${glibc}" \ - --label=bash="${bash}" \ - --label=deb-list="${deb_list}" \ - --label=pkg-list="${pkg_list}" \ - --label=bioconda-utils="${bioconda_utils}" \ - "${container}" - - # Store the new image (now with labels) - image_id="$( buildah commit "${container}" )" - buildah rm "${container}" - - # image tag includes arch; then added to manifest which does not include arch - for tag in ${tags} ; do - buildah tag \ - "${image_id}" \ - "${image_name}:${tag}-${arch}" - buildah manifest add \ - "${image_name}:${tag}" \ - "${image_id}" - done - done - - - name: Test - run: | - image_name='${{ steps.build.outputs.image_name }}' - image_dir='${{ steps.build.outputs.image_dir }}' - - # Extract image ids from manifest to test. - ids="$( - for tag in ${{ steps.build.outputs.tags }} ; do - buildah manifest inspect "${image}:${tag}" \ - | jq -r '.manifests[]|.digest' \ - | while read id ; do - buildah images --format '{{.ID}}{{.Digest}}' \ - | sed -n "s/${id}//p" - done - done - )" - - # See Dockerfile.test for actual tests run - ids="$( printf %s "${ids}" | sort -u )" - for id in ${ids} ; do - podman history "${id}" - buildah bud \ - --build-arg=base="${id}" \ - --file=Dockerfile.test \ - "${image_dir}" - done - buildah rmi --prune || true - - - name: Check Tags - run: | - # FIX upstream: Quay.io does not support immutable images currently. - # => Try to use the REST API to check for duplicate tags and exit if they exist - response="$( - curl -sL \ - 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image_name }}/tag/' - )" - - # This might be the first time making this image (e.g., will likely - # happen when using a test prefix), in which case there will be no - # available images. - if [ "$(echo "${response}" | jq -r '.error_message')" == "Requires authentication" ]; then - exit 0 - fi - - existing_tags="$( - printf %s "${response}" \ - | jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name' - )" \ - || { - printf %s\\n \ - 'Could not get list of image tags.' \ - 'Does the repository exist on Quay.io?' \ - 'Quay.io REST API response was:' \ - "${response}" - exit 1 - } - for tag in ${{ steps.build.outputs.tags }} ; do - case "${tag}" in - latest | '${{ env.MAJOR_VERSION }}' ) ;; - * ) - if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then - printf 'Tag %s already exists!\n' "${tag}" - exit 1 - fi - esac - done - - - if: ${{ github.ref == 'refs/heads/test-push' }} - name: Push - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build.outputs.image_name }} - tags: ${{ steps.build.outputs.tags }} - registry: quay.io/bioconda - username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} - password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - - - if: ${{ github.ref == 'refs/heads/test-push' }} - name: Test Pushed - run: | - - image_name='${{ steps.build.outputs.image_name }}' - image_dir='${{ steps.build.outputs.image_dir }}' - ids="$( - for tag in ${{ steps.build.outputs.tags }} ; do - buildah manifest inspect "${image_name}:${tag}" \ - | jq -r '.manifests[]|.digest' \ - | while read id ; do - buildah images --format '{{.ID}}{{.Digest}}' \ - | sed -n "s/${id}//p" - done - done - )" - ids="$( printf %s "${ids}" | sort -u )" - for id in ${ids} ; do - podman history "${id}" - buildah bud \ - --build-arg=base="${id}" \ - --file=Dockerfile.test \ - "${image_dir}" - done - buildah rmi --prune || true diff --git a/.github/workflows/bot.yaml b/.github/workflows/bot.yaml deleted file mode 100644 index 3b6371db..00000000 --- a/.github/workflows/bot.yaml +++ /dev/null @@ -1,123 +0,0 @@ -name: 'Build & Push: bot' -on: - push: - branches: - - main - paths: - - images/bot/** - - .github/workflows/bot.yaml - pull_request: - paths: - - images/bot/** - - .github/workflows/bot.yaml - -jobs: - build: - name: Build & Push - strategy: - matrix: - include: - - tag: comment - packages: "" - - tag: merge - packages: "anaconda-client skopeo" - - tag: update - packages: "git openssh" - runs-on: ubuntu-22.04 - env: - IMAGE_NAME: bot - IMAGE_VERSION: '1.1.23' - - steps: - - uses: actions/checkout@v2 - - - name: Build - id: buildah-build - uses: redhat-actions/buildah-build@v2 - with: - image: ${{ env.IMAGE_NAME }} - tags: >- - ${{ matrix.tag }} - ${{ matrix.tag }}-${{ env.IMAGE_VERSION }} - context: ./images/${{ env.IMAGE_NAME }} - dockerfiles: | - ./images/${{ env.IMAGE_NAME }}/Dockerfile - build-args: | - packages=${{ matrix.packages }} - - - name: Test - run: | - image='${{ steps.buildah-build.outputs.image }}' - ids="$( - for tag in ${{ steps.buildah-build.outputs.tags }} ; do - buildah images --quiet --no-trunc "${image}:${tag}" - done - )" - ids="$( printf %s "${ids}" | sort -u )" - for id in ${ids} ; do - podman history "${id}" - buildah bud \ - --build-arg=base="${id}" \ - --file=Dockerfile.test \ - 'images/${{ env.IMAGE_NAME }}' - done - buildah rmi --prune || true - - #- name: Check Tags - # run: | - # # FIX upstream: Quay.io does not support immutable images currently. - # # => Try to use the REST API to check for duplicate tags. - # respone="$( - # curl -sL \ - # 'https://quay.io/api/v1/repository/bioconda/${{ steps.buildah-build.outputs.image }}/image' - # )" - - # existing_tags="$( - # printf %s "${respone}" \ - # | jq -r '.images[].tags[]' - # )" \ - # || { - # printf %s\\n \ - # 'Could not get list of image tags.' \ - # 'Does the repository exist on Quay.io?' \ - # 'Quay.io REST API response was:' \ - # "${respone}" - # exit 1 - # } - # for tag in ${{ steps.buildah-build.outputs.tags }} ; do - # if [ \! "${tag}" = '${{ matrix.tag }}' ] ; then - # if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then - # printf 'Tag %s already exists!\n' "${tag}" - # exit 1 - # fi - # fi - # done - - - if: ${{ github.ref == 'refs/heads/main' }} - name: Push - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.buildah-build.outputs.image }} - tags: ${{ steps.buildah-build.outputs.tags }} - registry: ${{ secrets.QUAY_BIOCONDA_REPO }} - username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} - password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - - - if: ${{ github.ref == 'refs/heads/main' }} - name: Test Pushed - run: | - image='${{ steps.buildah-build.outputs.image }}' - ids="$( - for tag in ${{ steps.buildah-build.outputs.tags }} ; do - buildah images --quiet --no-trunc "${image}:${tag}" - done - )" - ids="$( printf %s "${ids}" | sort -u )" - for id in ${ids} ; do - podman history "${id}" - buildah bud \ - --build-arg=base="${id}" \ - --file=Dockerfile.test \ - 'images/${{ env.IMAGE_NAME }}' - done - buildah rmi --prune || true diff --git a/.github/workflows/create-env.yaml b/.github/workflows/create-env.yaml deleted file mode 100644 index 811cb643..00000000 --- a/.github/workflows/create-env.yaml +++ /dev/null @@ -1,145 +0,0 @@ -name: 'Build & Push: create-env' -on: - push: - branches: - - main - paths: - - images/create-env/* - - .github/workflows/create-env.yaml - pull_request: - paths: - - images/create-env/* - - .github/workflows/create-env.yaml - -jobs: - build: - name: Build & Push - runs-on: ubuntu-22.04 - env: - MAJOR_VERSION: 3 - MINOR_VERSION: 1 - IMAGE_NAME: create-env - - steps: - - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - - name: Prepare - id: prepare - run: | - curl -sSL \ - 'https://raw.githubusercontent.com/bioconda/bioconda-common/master/common.sh' \ - | sed -n \ - 's/BIOCONDA_UTILS_TAG=v/bioconda_utils_version=/p' \ - >> $GITHUB_OUTPUT - - - name: Build - id: build - uses: redhat-actions/buildah-build@v2 - with: - image: ${{ env.IMAGE_NAME }} - tags: >- - latest - ${{ env.MAJOR_VERSION }} - ${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} - archs: amd64,arm64 - context: ./images/${{ env.IMAGE_NAME }} - containerfiles: | - ./images/${{ env.IMAGE_NAME }}/Dockerfile - build-args: | - bioconda_utils_version=${{ steps.prepare.outputs.bioconda_utils_version }} - - - name: Test - run: | - set -x - image='${{ steps.build.outputs.image }}' - for tag in ${{ steps.build.outputs.tags }} ; do - buildah manifest inspect \ - "${image}:${tag}" \ - | jq '.manifests|{([.[].digest]|sort|join("+")): [.[]|["'"${tag}"'", .platform.architecture, .digest]|join(" ")]}' - done \ - | jq -rs 'add|add[]' \ - | while read tag arch digest ; do - podman images --format='{{.ID}}|{{.Digest}}|{{.RepoDigests}}' \ - | sed -n "/${digest}/{s/|.*//p;q}" \ - | xargs -n1 -- \ - sh -xc \ - 'podman history "${1}" ; podman inspect "${1}"' -- - buildah bud \ - --arch="${arch}" \ - --build-arg=base="${image}:${tag}" \ - --file=Dockerfile.test \ - "images/${image}" - done - buildah rmi --prune || true - - - name: Check Tags - run: | - # FIX upstream: Quay.io does not support immutable images currently. - # => Try to use the REST API to check for duplicate tags. - response="$( - curl -sL \ - 'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image }}/tag/' - )" - - existing_tags="$( - printf %s "${response}" \ - | jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name' - )" \ - || { - printf %s\\n \ - 'Could not get list of image tags.' \ - 'Does the repository exist on Quay.io?' \ - 'Quay.io REST API response was:' \ - "${response}" - exit 1 - } - for tag in ${{ steps.build.outputs.tags }} ; do - case "${tag}" in - latest | '${{ env.MAJOR_VERSION }}' ) ;; - * ) - if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then - printf 'Tag %s already exists!\n' "${tag}" - exit 1 - fi - esac - done - - - if: ${{ github.ref == 'refs/heads/main' }} - name: Push - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build.outputs.image }} - tags: ${{ steps.build.outputs.tags }} - registry: ${{ secrets.QUAY_BIOCONDA_REPO }} - username: ${{ secrets.QUAY_BIOCONDA_USERNAME }} - password: ${{ secrets.QUAY_BIOCONDA_TOKEN }} - - - if: ${{ github.ref == 'refs/heads/main' }} - name: Test Pushed - run: | - set -x - image='${{ steps.build.outputs.image }}' - for tag in ${{ steps.build.outputs.tags }} ; do - buildah manifest inspect \ - "${image}:${tag}" \ - | jq '.manifests|{([.[].digest]|sort|join("+")): [.[]|["'"${tag}"'", .platform.architecture, .digest]|join(" ")]}' - done \ - | jq -rs 'add|add[]' \ - | while read tag arch digest ; do - podman images --format='{{.ID}}|{{.Digest}}|{{.RepoDigests}}' \ - | sed -n "/${digest}/{s/|.*//p;q}" \ - | xargs -n1 -- \ - sh -xc \ - 'podman history "${1}" ; podman inspect "${1}"' -- - buildah bud \ - --arch="${arch}" \ - --build-arg=base="${image}:${tag}" \ - --file=Dockerfile.test \ - "images/${image}" - done - buildah rmi --prune || true From 73f1d828f5ea7d53ec969cb529e0e5f4dca6af39 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:19:45 -0500 Subject: [PATCH 50/98] add test caller and called workflow --- .github/workflows/caller.yml | 11 ++++++++ .github/workflows/generic_build.yml | 40 +++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/caller.yml create mode 100644 .github/workflows/generic_build.yml diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml new file mode 100644 index 00000000..c0a09c92 --- /dev/null +++ b/.github/workflows/caller.yml @@ -0,0 +1,11 @@ +name: "Generic caller test" +on: + pull_request: + +jobs: + call-generic-build: + uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml + with: + image_name: example-image + tags: 'major.minor latest' + diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml new file mode 100644 index 00000000..444cff5c --- /dev/null +++ b/.github/workflows/generic_build.yml @@ -0,0 +1,40 @@ +on: + workflow_call: + inputs: + image_name: + required: true + type: string + image_dir: + required: true + type: string + tags: + required: true + type: string + busybox_version: + required: false + type: string + debian_version: + required: false + type: string + image_prefix: + required: false + type: string + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Build + id: build + run: | + set -xeu + image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' + image_dir='images/${{ inputs.image_name }}' + From b2d6b7e4f2fe129ef29aad4673f8b5c7f458e482 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:21:10 -0500 Subject: [PATCH 51/98] bump --- .github/workflows/caller.yml | 2 ++ .github/workflows/generic_build.yml | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml index c0a09c92..67ef0a3b 100644 --- a/.github/workflows/caller.yml +++ b/.github/workflows/caller.yml @@ -1,6 +1,8 @@ name: "Generic caller test" on: pull_request: + paths: + - .github/workflows/caller.yml jobs: call-generic-build: diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 444cff5c..84d9e28a 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -4,9 +4,6 @@ on: image_name: required: true type: string - image_dir: - required: true - type: string tags: required: true type: string @@ -37,4 +34,4 @@ jobs: set -xeu image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' image_dir='images/${{ inputs.image_name }}' - + From 99550cdc2faaa3445d99e235582eaabe012a9c6a Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:22:36 -0500 Subject: [PATCH 52/98] bump --- .github/workflows/generic_build.yml | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 84d9e28a..b18a47ff 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -19,19 +19,21 @@ on: jobs: build: + name: building runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - name: Build - id: build - run: | - set -xeu - image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' - image_dir='images/${{ inputs.image_name }}' - + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Build + id: build + run: | + set -xeu + image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' + image_dir='images/${{ inputs.image_name }}' + From 7efe5174813faa1414013d0ce0b2680c77cdc8f9 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:23:22 -0500 Subject: [PATCH 53/98] add version --- .github/workflows/caller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml index 67ef0a3b..aff1445b 100644 --- a/.github/workflows/caller.yml +++ b/.github/workflows/caller.yml @@ -6,7 +6,7 @@ on: jobs: call-generic-build: - uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml + uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing with: image_name: example-image tags: 'major.minor latest' From a135954e8c64a1b378a93c87bdb9062f6812949c Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:24:22 -0500 Subject: [PATCH 54/98] bump --- .github/workflows/generic_build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index b18a47ff..227e8172 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -36,4 +36,6 @@ jobs: set -xeu image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' image_dir='images/${{ inputs.image_name }}' + echo $image_name + echo $image_dir From a420a4fd02c64414ab63de4e33de727e470b4fee Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:25:48 -0500 Subject: [PATCH 55/98] bump --- .github/workflows/caller.yml | 4 +++- .github/workflows/generic_build.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml index aff1445b..112d0378 100644 --- a/.github/workflows/caller.yml +++ b/.github/workflows/caller.yml @@ -6,8 +6,10 @@ on: jobs: call-generic-build: + env: + image_name: example-image uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing with: - image_name: example-image + image_name: ${{ env.image_name }} tags: 'major.minor latest' diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 227e8172..49c3557e 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -19,7 +19,7 @@ on: jobs: build: - name: building + name: Generic build runs-on: ubuntu-22.04 steps: From 02847d6095de182cfab6f24ca0f9f15f016f7b55 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:30:41 -0500 Subject: [PATCH 56/98] bump --- .github/workflows/caller.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml index 112d0378..811fb196 100644 --- a/.github/workflows/caller.yml +++ b/.github/workflows/caller.yml @@ -5,11 +5,14 @@ on: - .github/workflows/caller.yml jobs: - call-generic-build: - env: - image_name: example-image + build-image-1: uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing with: - image_name: ${{ env.image_name }} + image_name: image-1 tags: 'major.minor latest' +build-image-2: + uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing + with: + image_name: image-2 + tags: 'major.minor latest' From 5f45578efdaeb274f7129be099b9f32c07e4680a Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:31:07 -0500 Subject: [PATCH 57/98] bump --- .github/workflows/caller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml index 811fb196..3c8f5d22 100644 --- a/.github/workflows/caller.yml +++ b/.github/workflows/caller.yml @@ -11,7 +11,7 @@ jobs: image_name: image-1 tags: 'major.minor latest' -build-image-2: + build-image-2: uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing with: image_name: image-2 From 2b029c4d23048c57c9ffe72a2dd4c486a1e807a1 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:36:42 -0500 Subject: [PATCH 58/98] bump --- .github/workflows/caller.yml | 13 ++++--------- .github/workflows/generic_build.yml | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml index 3c8f5d22..5bb94c4e 100644 --- a/.github/workflows/caller.yml +++ b/.github/workflows/caller.yml @@ -5,14 +5,9 @@ on: - .github/workflows/caller.yml jobs: - build-image-1: + create-env: uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing with: - image_name: image-1 - tags: 'major.minor latest' - - build-image-2: - uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing - with: - image_name: image-2 - tags: 'major.minor latest' + image_name: base-glibc-debian-bash + tags: '3.1 3 latest' + debian_version: '12.2' diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 49c3557e..f13a8c0c 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -36,6 +36,31 @@ jobs: set -xeu image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' image_dir='images/${{ inputs.image_name }}' + tags='${{ inputs.tags }}' echo $image_name echo $image_dir + echo $tags + + # Adds image and tags to outputs which can be used in later steps. + printf %s\\n \ + "image_dir=${image_dir}" \ + "image_name=${image_name}" \ + "tags=$( echo ${tags} )" \ + >> $GITHUB_OUTPUT + + cd $image_dir + for tag in ${tags} ; do + buildah manifest create "${image_name}:${tag}" + done + + # --iidfile prints the built image ID to the specified file. This is + # used so we can refer to the image in later steps. + for arch in amd64 arm64 ; do + iidfile="$( mktemp )" + buildah bud \ + --arch="${arch}" \ + --iidfile="${iidfile}" \ + --build-arg=debian_version='${{ env.DEBIAN_VERSION }}' + image_id="$( cat "${iidfile}" )" + rm "${iidfile}" From 082cf5bf3405abb0d4d871f5c8dd57dc1e577592 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:38:09 -0500 Subject: [PATCH 59/98] bump --- .github/workflows/generic_build.yml | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index f13a8c0c..f448e50b 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -64,3 +64,37 @@ jobs: image_id="$( cat "${iidfile}" )" rm "${iidfile}" + # Extract various package info and version info to store as labels + container="$( buildah from "${image_id}" )" + run() { buildah run "${container}" "${@}" ; } + deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )" + pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )" + glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )" + debian="$( run cat /etc/debian_version | sed '1!d' )" + bash="$( run bash --version | sed '1!d' )" + buildah rm "${container}" + + # Store package/version info as labels for the image + container="$( buildah from "${image_id}" )" + buildah config \ + --label=glibc="${glibc}" \ + --label=debian="${debian}" \ + --label=bash="${bash}" \ + --label=deb-list="${deb_list}" \ + --label=pkg-list="${pkg_list}" \ + "${container}" + + # Store the new image (now with labels) + image_id="$( buildah commit "${container}" )" + buildah rm "${container}" + + # image tag includes arch; then added to manifest which does not include arch + for tag in ${tags} ; do + buildah tag \ + "${image_id}" \ + "${image_name}:${tag}-${arch}" + buildah manifest add \ + "${image_name}:${tag}" \ + "${image_id}" + done + done From a250b8f2e645912ffa6d4d9445705716a6c2267a Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:40:55 -0500 Subject: [PATCH 60/98] bump --- .github/workflows/generic_build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index f448e50b..77f8f89d 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -37,6 +37,7 @@ jobs: image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' image_dir='images/${{ inputs.image_name }}' tags='${{ inputs.tags }}' + debian_version='${{ inputs.debian_version }}' echo $image_name echo $image_dir echo $tags @@ -98,3 +99,4 @@ jobs: "${image_id}" done done + From 3f7ff8811f87186085e5c0912681c8115ecddc77 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:42:23 -0500 Subject: [PATCH 61/98] bump --- .github/workflows/generic_build.yml | 30 +++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 77f8f89d..e427e794 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -37,7 +37,6 @@ jobs: image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' image_dir='images/${{ inputs.image_name }}' tags='${{ inputs.tags }}' - debian_version='${{ inputs.debian_version }}' echo $image_name echo $image_dir echo $tags @@ -61,7 +60,7 @@ jobs: buildah bud \ --arch="${arch}" \ --iidfile="${iidfile}" \ - --build-arg=debian_version='${{ env.DEBIAN_VERSION }}' + --build-arg=debian_version='${{ inputs.debian_version }}' image_id="$( cat "${iidfile}" )" rm "${iidfile}" @@ -100,3 +99,30 @@ jobs: done done + - name: Test + run: | + image_name='${{ inputs.image_name }}' + image_dir='${{ inputs.image_dir }}' + + # Extract image ids from manifest to test. + ids="$( + for tag in ${{ inputs.tags }} ; do + buildah manifest inspect "${image}:${tag}" \ + | jq -r '.manifests[]|.digest' \ + | while read id ; do + buildah images --format '{{.ID}}{{.Digest}}' \ + | sed -n "s/${id}//p" + done + done + )" + + # See Dockerfile.test for actual tests run + ids="$( printf %s "${ids}" | sort -u )" + for id in ${ids} ; do + podman history "${id}" + buildah bud \ + --build-arg=base="${id}" \ + --file=Dockerfile.test \ + "${image_dir}" + done + buildah rmi --prune || true From 4f3e455f878e8cc76f65c6445c0c02c811f1aa57 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 14:47:09 -0500 Subject: [PATCH 62/98] bump --- .github/workflows/generic_build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index e427e794..b3589f17 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -53,6 +53,9 @@ jobs: buildah manifest create "${image_name}:${tag}" done + if '${{ inputs.debian_version }}'; then + BUILD_ARGS="--build"'${{ inputs_debian_version }}' + # --iidfile prints the built image ID to the specified file. This is # used so we can refer to the image in later steps. for arch in amd64 arm64 ; do @@ -101,13 +104,14 @@ jobs: - name: Test run: | + set -xeu image_name='${{ inputs.image_name }}' image_dir='${{ inputs.image_dir }}' # Extract image ids from manifest to test. ids="$( for tag in ${{ inputs.tags }} ; do - buildah manifest inspect "${image}:${tag}" \ + buildah manifest inspect "${image_name}:${tag}" \ | jq -r '.manifests[]|.digest' \ | while read id ; do buildah images --format '{{.ID}}{{.Digest}}' \ From 6105f7b5f62176493175b4175ff2e489c0811ed3 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 15:26:23 -0500 Subject: [PATCH 63/98] bump --- .github/workflows/generic_build.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index b3589f17..1b14d34b 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -52,9 +52,13 @@ jobs: for tag in ${tags} ; do buildah manifest create "${image_name}:${tag}" done - - if '${{ inputs.debian_version }}'; then - BUILD_ARGS="--build"'${{ inputs_debian_version }}' + debian_version='${{ inputs.debian_version }}' + busybox_version='${{ inputs.busybox_version }}' + echo "Busybox: $busybox_version" + BUILD_ARGS="" + if [ ! -z "${debian_version}" ]; then + BUILD_ARGS="--build=$debian_version" + fi # --iidfile prints the built image ID to the specified file. This is # used so we can refer to the image in later steps. @@ -63,7 +67,7 @@ jobs: buildah bud \ --arch="${arch}" \ --iidfile="${iidfile}" \ - --build-arg=debian_version='${{ inputs.debian_version }}' + $BUILD_ARGS image_id="$( cat "${iidfile}" )" rm "${iidfile}" From 4a4d66ef06f0103e3f397b1d562f4301aec68321 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 15:28:39 -0500 Subject: [PATCH 64/98] bump --- .github/workflows/generic_build.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 1b14d34b..d2a3c77e 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -34,12 +34,16 @@ jobs: id: build run: | set -xeu + + # Store provided inputs as local vars image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' image_dir='images/${{ inputs.image_name }}' tags='${{ inputs.tags }}' - echo $image_name - echo $image_dir - echo $tags + debian_version='${{ inputs.debian_version }}' + busybox_version='${{ inputs.busybox_version }}' + + # FIXME: just used for testing to see if we get default values + echo "Busybox: $busybox_version" # Adds image and tags to outputs which can be used in later steps. printf %s\\n \ @@ -52,12 +56,10 @@ jobs: for tag in ${tags} ; do buildah manifest create "${image_name}:${tag}" done - debian_version='${{ inputs.debian_version }}' - busybox_version='${{ inputs.busybox_version }}' - echo "Busybox: $busybox_version" + BUILD_ARGS="" if [ ! -z "${debian_version}" ]; then - BUILD_ARGS="--build=$debian_version" + BUILD_ARGS="--build-arg=debian_version=$debian_version" fi # --iidfile prints the built image ID to the specified file. This is From 9cdbcec6a91fa4ec70a44c6bc6ad7f976fe7500e Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 15:43:48 -0500 Subject: [PATCH 65/98] bump --- .github/workflows/caller.yml | 11 ++++++++-- .github/workflows/generic_build.yml | 34 ++++++++++++++--------------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml index 5bb94c4e..6dd3bdaa 100644 --- a/.github/workflows/caller.yml +++ b/.github/workflows/caller.yml @@ -5,9 +5,16 @@ on: - .github/workflows/caller.yml jobs: - create-env: + base-glibc-debian-bash: uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing with: image_name: base-glibc-debian-bash tags: '3.1 3 latest' - debian_version: '12.2' + build_args: '--build-arg=debian_version=12.2' + + base-glibc-debian-bash: + uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing + with: + image_name: base-glibc-busybox-bash + tags: '3.1 3 latest' + build_args: '--build-arg=debian_version=12.2 --build-arg=busybox_version=1.36.1' diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index d2a3c77e..ed810f73 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -7,15 +7,15 @@ on: tags: required: true type: string - busybox_version: - required: false - type: string - debian_version: + build_args: required: false type: string image_prefix: required: false type: string + archs: # space-separated list of architectures, e.g., "arm64 amd64" + required: true + type: string jobs: build: @@ -39,11 +39,8 @@ jobs: image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' image_dir='images/${{ inputs.image_name }}' tags='${{ inputs.tags }}' - debian_version='${{ inputs.debian_version }}' - busybox_version='${{ inputs.busybox_version }}' - - # FIXME: just used for testing to see if we get default values - echo "Busybox: $busybox_version" + archs='${{ inputs.archs }}' + build_args='${{ inputs.build_args }}' # Adds image and tags to outputs which can be used in later steps. printf %s\\n \ @@ -52,24 +49,22 @@ jobs: "tags=$( echo ${tags} )" \ >> $GITHUB_OUTPUT + # Dockerfile lives here cd $image_dir + for tag in ${tags} ; do buildah manifest create "${image_name}:${tag}" done - BUILD_ARGS="" - if [ ! -z "${debian_version}" ]; then - BUILD_ARGS="--build-arg=debian_version=$debian_version" - fi # --iidfile prints the built image ID to the specified file. This is # used so we can refer to the image in later steps. - for arch in amd64 arm64 ; do + for arch in $archs ; do iidfile="$( mktemp )" buildah bud \ --arch="${arch}" \ --iidfile="${iidfile}" \ - $BUILD_ARGS + $build_args image_id="$( cat "${iidfile}" )" rm "${iidfile}" @@ -111,10 +106,12 @@ jobs: - name: Test run: | set -xeu + + # Store inputs as local variables image_name='${{ inputs.image_name }}' - image_dir='${{ inputs.image_dir }}' + image_dir="images/${image_name}" - # Extract image ids from manifest to test. + # Extract image IDs from the manifest built in the last step ids="$( for tag in ${{ inputs.tags }} ; do buildah manifest inspect "${image_name}:${tag}" \ @@ -126,7 +123,8 @@ jobs: done )" - # See Dockerfile.test for actual tests run + # Run the tests; see Dockerfile.test in the relevant image dir for the + # actual tests run ids="$( printf %s "${ids}" | sort -u )" for id in ${ids} ; do podman history "${id}" From ae59451b55bca7213bb00e2e42f4590f49e1a03d Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 15:44:19 -0500 Subject: [PATCH 66/98] bump --- .github/workflows/caller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml index 6dd3bdaa..60abb751 100644 --- a/.github/workflows/caller.yml +++ b/.github/workflows/caller.yml @@ -12,7 +12,7 @@ jobs: tags: '3.1 3 latest' build_args: '--build-arg=debian_version=12.2' - base-glibc-debian-bash: + base-glibc-busybox-bash: uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing with: image_name: base-glibc-busybox-bash From d3f9140a61a98152013a6e9ee844a3628700432c Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 15:44:57 -0500 Subject: [PATCH 67/98] bump --- .github/workflows/caller.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml index 60abb751..83495beb 100644 --- a/.github/workflows/caller.yml +++ b/.github/workflows/caller.yml @@ -11,6 +11,7 @@ jobs: image_name: base-glibc-debian-bash tags: '3.1 3 latest' build_args: '--build-arg=debian_version=12.2' + archs: 'amd64' base-glibc-busybox-bash: uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing @@ -18,3 +19,4 @@ jobs: image_name: base-glibc-busybox-bash tags: '3.1 3 latest' build_args: '--build-arg=debian_version=12.2 --build-arg=busybox_version=1.36.1' + archs: 'amd64' From 855a94ca78c64b73a2b92355b0c3de545d33446f Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 15:53:21 -0500 Subject: [PATCH 68/98] bump --- .github/workflows/generic_build.yml | 36 +++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index ed810f73..aac8f681 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -7,7 +7,10 @@ on: tags: required: true type: string - build_args: + busybox_version: + required: false + type: string + debian_version: required: false type: string image_prefix: @@ -39,8 +42,9 @@ jobs: image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' image_dir='images/${{ inputs.image_name }}' tags='${{ inputs.tags }}' + debian_version='${{ inputs.debian_version }}' + busybox_version='${{ inputs.busybox_version }}' archs='${{ inputs.archs }}' - build_args='${{ inputs.build_args }}' # Adds image and tags to outputs which can be used in later steps. printf %s\\n \ @@ -56,15 +60,37 @@ jobs: buildah manifest create "${image_name}:${tag}" done + # Incrementally compose build args. Using this + BUILD_ARGS="" + if [ ! -z "${debian_version}" ]; then + BUILD_ARGS=$(echo $BUILD_ARGS "--build-arg=debian_version=$debian_version") + fi + + # If busybox_version was specified, assume we are making a busybox image. + if [ ! -z "${busybox_version}" ]; then + BUILD_ARGS=$(echo $BUILD_ARGS "--build-arg=busybox_version=$busybox_version") + + # Make a busybox image that we'll use further below. + # --iidfile prints the built image ID to the specified file so we can + # refer to the image later + iidfile="$( mktemp )" + buildah bud \ + --iidfile="${iidfile}" \ + --file=Dockerfile.busybox \ + $BUILD_ARGS + busybox_image="$( cat "${iidfile}" )" + rm "${iidfile}" + + # And then extend the build args with this image. + BUILD_ARGS=$(echo $BUILD_ARGS "--build-arg=busybox_image=${busybox_image}") + fi - # --iidfile prints the built image ID to the specified file. This is - # used so we can refer to the image in later steps. for arch in $archs ; do iidfile="$( mktemp )" buildah bud \ --arch="${arch}" \ --iidfile="${iidfile}" \ - $build_args + $BUILD_ARGS image_id="$( cat "${iidfile}" )" rm "${iidfile}" From 447d5d42093785735e052e63d2441cc806004790 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 15:54:01 -0500 Subject: [PATCH 69/98] bump --- .github/workflows/caller.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml index 83495beb..54cb2b02 100644 --- a/.github/workflows/caller.yml +++ b/.github/workflows/caller.yml @@ -10,13 +10,14 @@ jobs: with: image_name: base-glibc-debian-bash tags: '3.1 3 latest' - build_args: '--build-arg=debian_version=12.2' - archs: 'amd64' + debian_version: '12.2' + archs: 'arm64' - base-glibc-busybox-bash: + base-glibc-debian-bash: uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing with: image_name: base-glibc-busybox-bash tags: '3.1 3 latest' - build_args: '--build-arg=debian_version=12.2 --build-arg=busybox_version=1.36.1' + debian_version: '12.2' + busybox_version: '1.36.1' archs: 'amd64' From 2372f15e1f99d38c660f07dfadcbc8c8844e7faa Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 15:55:17 -0500 Subject: [PATCH 70/98] bump --- .github/workflows/caller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml index 54cb2b02..3f77a463 100644 --- a/.github/workflows/caller.yml +++ b/.github/workflows/caller.yml @@ -13,7 +13,7 @@ jobs: debian_version: '12.2' archs: 'arm64' - base-glibc-debian-bash: + base-glibc-busybox-bash: uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing with: image_name: base-glibc-busybox-bash From 000e9469822f1aef6e98f0ae228717185a2539e4 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Tue, 30 Jan 2024 17:50:07 -0500 Subject: [PATCH 71/98] bump --- .github/workflows/base-glibc-busybox-bash.yml | 16 +++++++++++++ .github/workflows/base-glibc-debian-bash.yml | 15 ++++++++++++ .github/workflows/caller.yml | 23 ------------------- 3 files changed, 31 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/base-glibc-busybox-bash.yml create mode 100644 .github/workflows/base-glibc-debian-bash.yml delete mode 100644 .github/workflows/caller.yml diff --git a/.github/workflows/base-glibc-busybox-bash.yml b/.github/workflows/base-glibc-busybox-bash.yml new file mode 100644 index 00000000..e5ea9d9d --- /dev/null +++ b/.github/workflows/base-glibc-busybox-bash.yml @@ -0,0 +1,16 @@ +name: "base-glibc-busybox-bash" +on: + pull_request: + paths: + - .github/workflows/base-glibc-busybox-bash.yml + - .github/workflows/generic_build.yml + +jobs: + base-glibc-busybox-bash: + uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing + with: + image_name: base-glibc-busybox-bash + tags: '3.1 3 latest' + busybox_version: '1.36.1' + debian_version: '12.2' + archs: 'arm64 amd64' diff --git a/.github/workflows/base-glibc-debian-bash.yml b/.github/workflows/base-glibc-debian-bash.yml new file mode 100644 index 00000000..217a69e3 --- /dev/null +++ b/.github/workflows/base-glibc-debian-bash.yml @@ -0,0 +1,15 @@ +name: "base-glibc-debian-bash" +on: + pull_request: + paths: + - .github/workflows/base-glibc-debian-bash.yml + - .github/workflows/generic_build.yml + +jobs: + base-glibc-debian-bash: + uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing + with: + image_name: base-glibc-debian-bash + tags: '3.1 3 latest' + debian_version: '12.2' + archs: 'arm64 amd64' diff --git a/.github/workflows/caller.yml b/.github/workflows/caller.yml deleted file mode 100644 index 3f77a463..00000000 --- a/.github/workflows/caller.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: "Generic caller test" -on: - pull_request: - paths: - - .github/workflows/caller.yml - -jobs: - base-glibc-debian-bash: - uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing - with: - image_name: base-glibc-debian-bash - tags: '3.1 3 latest' - debian_version: '12.2' - archs: 'arm64' - - base-glibc-busybox-bash: - uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing - with: - image_name: base-glibc-busybox-bash - tags: '3.1 3 latest' - debian_version: '12.2' - busybox_version: '1.36.1' - archs: 'amd64' From dedefebf66bb355d439eeda1c3b608b4fb48534a Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Thu, 1 Feb 2024 13:25:25 -0500 Subject: [PATCH 72/98] now try bioconda-utils image --- .../bioconda-utils-build-env-cos7.yml | 15 ++++ .github/workflows/generic_build.yml | 74 +++++++++++++++---- 2 files changed, 73 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/bioconda-utils-build-env-cos7.yml diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml new file mode 100644 index 00000000..d96f59e9 --- /dev/null +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -0,0 +1,15 @@ +name: "bioconda-utils-build-env-cos7" +on: + pull_request: + paths: + - .github/workflows/bioconda-utils-build-env-cos7.yml + - .github/workflows/generic_build.yml + +jobs: + bioconda-utils-build-env-cos7: + uses: bioconda/bioconda-containers/.github/workflows/generic_build.yml@reusable-workflow-testing + with: + image_name: bioconda-utils-build-env-cos7 + tags: '3.1 3 latest' + debian_version: '12.2' + archs: 'arm64 amd64' diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index aac8f681..db85ff11 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -1,12 +1,17 @@ on: workflow_call: inputs: + # target image name to build image_name: required: true type: string + + # target tags to build (space-separated) tags: required: true type: string + + # will be passed as a build-arg to Docker busybox_version: required: false type: string @@ -16,10 +21,16 @@ on: image_prefix: required: false type: string - archs: # space-separated list of architectures, e.g., "arm64 amd64" + + # space-separated list of architectures, e.g., "arm64 amd64" + archs: required: true type: string + bioconda_utils: + required: false + type: boolean + jobs: build: name: Generic build @@ -60,15 +71,27 @@ jobs: buildah manifest create "${image_name}:${tag}" done - # Incrementally compose build args. Using this + archs_and_images=$archs + # ---------------------------------------------------------------------- + # Incrementally compose build args, depending on which inputs were + # provided. BUILD_ARGS="" if [ ! -z "${debian_version}" ]; then - BUILD_ARGS=$(echo $BUILD_ARGS "--build-arg=debian_version=$debian_version") + BUILD_ARGS+="--build-arg=debian_version=$debian_version" + fi + + if [ '${{ inputs.bioconda_utils }}' ]; then + # Due to different nomenclature used by conda-forge and buildah, we + # need to map archs to base images. + archs_and_images=' + amd64=quay.io/condaforge/linux-anvil-cos7-x86_64 + arm64=quay.io/condaforge/linux-anvil-aarch64 + ' fi # If busybox_version was specified, assume we are making a busybox image. if [ ! -z "${busybox_version}" ]; then - BUILD_ARGS=$(echo $BUILD_ARGS "--build-arg=busybox_version=$busybox_version") + BUILD_ARGS+="--build-arg=busybox_version=$busybox_version" # Make a busybox image that we'll use further below. # --iidfile prints the built image ID to the specified file so we can @@ -82,43 +105,62 @@ jobs: rm "${iidfile}" # And then extend the build args with this image. - BUILD_ARGS=$(echo $BUILD_ARGS "--build-arg=busybox_image=${busybox_image}") + BUILD_ARGS+="--build-arg=busybox_image=${busybox_image}" fi - for arch in $archs ; do + # ---------------------------------------------------------------------- + + # Build each arch's image + for arch in $arch_and_image ; do + arch=$(echo $arch_and_image | cut -f1 -d "=") + base_image=$(echo $arch_and_image | cut -f2 -d "=") iidfile="$( mktemp )" buildah bud \ --arch="${arch}" \ --iidfile="${iidfile}" \ + --build_arg=base_image="${base_image}" \ $BUILD_ARGS image_id="$( cat "${iidfile}" )" rm "${iidfile}" - # Extract various package info and version info to store as labels + # Extract various package info and version info... container="$( buildah from "${image_id}" )" run() { buildah run "${container}" "${@}" ; } + + # Incrementally make labels + deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )" + pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )" glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )" debian="$( run cat /etc/debian_version | sed '1!d' )" bash="$( run bash --version | sed '1!d' )" + buildah rm "${container}" - # Store package/version info as labels for the image + LABELS="" + LABELS+="--label=deb-list=${deb_list} " + LABELS+="--label=pkg-list=${pkg_list} " + LABELS+="--label=glibc=${glibc} " + LABELS+="--label=debian=${debian} " + LABELS+="--label=bash=${bash} " + if [ '${{ inputs.bioconda_utils }}' ]; then + bioconda_utils="$( + run sh -c '. /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version' \ + | rev | cut -f1 -d " " | rev + )" + LABELS+="--label=bioconda-utils=${bioconda_utils} " + fi + + # ...then store that info as labels for the image container="$( buildah from "${image_id}" )" - buildah config \ - --label=glibc="${glibc}" \ - --label=debian="${debian}" \ - --label=bash="${bash}" \ - --label=deb-list="${deb_list}" \ - --label=pkg-list="${pkg_list}" \ - "${container}" + buildah config $LABELS "${container}" # Store the new image (now with labels) image_id="$( buildah commit "${container}" )" buildah rm "${container}" - # image tag includes arch; then added to manifest which does not include arch + # Add images to manifest. Individual image tags include arch; manifest does not. for tag in ${tags} ; do buildah tag \ "${image_id}" \ From bc1f53dcf5fec731a0aeaf7c3ee5e0c4a66aa94b Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Thu, 1 Feb 2024 22:28:16 -0500 Subject: [PATCH 73/98] varname --- .github/workflows/generic_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index db85ff11..281fbf81 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -111,7 +111,7 @@ jobs: # ---------------------------------------------------------------------- # Build each arch's image - for arch in $arch_and_image ; do + for arch in $archs_and_images ; do arch=$(echo $arch_and_image | cut -f1 -d "=") base_image=$(echo $arch_and_image | cut -f2 -d "=") iidfile="$( mktemp )" From 2321455976487596acda98f2eac24f09ec22a223 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Thu, 1 Feb 2024 22:34:09 -0500 Subject: [PATCH 74/98] separate build arg for image --- .github/workflows/generic_build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 281fbf81..8bba1ad4 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -114,12 +114,17 @@ jobs: for arch in $archs_and_images ; do arch=$(echo $arch_and_image | cut -f1 -d "=") base_image=$(echo $arch_and_image | cut -f2 -d "=") + BASE_IMAGE_BUILD_ARG="" + if [ ! -z "$base_image" ]; then + BASE_IMAGE_BUILD_ARG="--build_arg=base_image="${base_image}"" + fi + iidfile="$( mktemp )" buildah bud \ --arch="${arch}" \ --iidfile="${iidfile}" \ - --build_arg=base_image="${base_image}" \ - $BUILD_ARGS + $BUILD_ARGS \ + $BASE_IMAGE_BUILD_ARG image_id="$( cat "${iidfile}" )" rm "${iidfile}" From 5989f1b071d12e1812fa0a5990779850393ea611 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 09:23:09 -0500 Subject: [PATCH 75/98] label fixes --- .../bioconda-utils-build-env-cos7.yml | 1 + .github/workflows/generic_build.yml | 44 +++++++++++-------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index d96f59e9..af548485 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -13,3 +13,4 @@ jobs: tags: '3.1 3 latest' debian_version: '12.2' archs: 'arm64 amd64' + bioconda_utils: 'master' diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 8bba1ad4..12a2f6c7 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -56,6 +56,7 @@ jobs: debian_version='${{ inputs.debian_version }}' busybox_version='${{ inputs.busybox_version }}' archs='${{ inputs.archs }}' + bioconda_utils='${{ inputs.bioconda_utils }}' # Adds image and tags to outputs which can be used in later steps. printf %s\\n \ @@ -80,7 +81,7 @@ jobs: BUILD_ARGS+="--build-arg=debian_version=$debian_version" fi - if [ '${{ inputs.bioconda_utils }}' ]; then + if [ ! -z "${bioconda_utils}" ]; then # Due to different nomenclature used by conda-forge and buildah, we # need to map archs to base images. archs_and_images=' @@ -93,7 +94,10 @@ jobs: if [ ! -z "${busybox_version}" ]; then BUILD_ARGS+="--build-arg=busybox_version=$busybox_version" - # Make a busybox image that we'll use further below. + # Make a busybox image that we'll use further below. As shown in the + # Dockerfile.busybox, this uses the build-busybox script which in turn + # cross-compiles for x86_64 and aarch64, and these are later copied + # into an arch-specific container. # --iidfile prints the built image ID to the specified file so we can # refer to the image later iidfile="$( mktemp )" @@ -128,38 +132,37 @@ jobs: image_id="$( cat "${iidfile}" )" rm "${iidfile}" - # Extract various package info and version info... + # Extract various package info and version info, then store that info as labels container="$( buildah from "${image_id}" )" run() { buildah run "${container}" "${@}" ; } - - # Incrementally make labels - deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )" - pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )" glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )" debian="$( run cat /etc/debian_version | sed '1!d' )" bash="$( run bash --version | sed '1!d' )" - buildah rm "${container}" - - LABELS="" - LABELS+="--label=deb-list=${deb_list} " - LABELS+="--label=pkg-list=${pkg_list} " - LABELS+="--label=glibc=${glibc} " - LABELS+="--label=debian=${debian} " - LABELS+="--label=bash=${bash} " - if [ '${{ inputs.bioconda_utils }}' ]; then + if [ ! -z "${bioconda_utils}" ]; then bioconda_utils="$( run sh -c '. /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version' \ | rev | cut -f1 -d " " | rev )" - LABELS+="--label=bioconda-utils=${bioconda_utils} " + buildah config --label=bioconda-utils="${bioconda_utils}" ${container} fi - # ...then store that info as labels for the image + if [ ! -z "${busybox_version}" ]; then + buildah config --label=busybox-version="${busybox_version}" + fi + + + buildah rm "${container}" container="$( buildah from "${image_id}" )" - buildah config $LABELS "${container}" + buildah config \ + --label=glibc="${glibc}" \ + --label=debian="${debian}" \ + --label=bash="${bash}" \ + --label=deb-list="${deb_list}" \ + --label=pkg-list="${pkg_list}" \ + "${container}" # Store the new image (now with labels) image_id="$( buildah commit "${container}" )" @@ -173,8 +176,11 @@ jobs: buildah manifest add \ "${image_name}:${tag}" \ "${image_id}" + + buildah inspect -t image ${image_name}:${tag} done done + buidah_inspect -t manifest ${image_name} - name: Test run: | From 033f85057c31451d61c878c802c893dac6edf78d Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 09:30:54 -0500 Subject: [PATCH 76/98] bump --- .github/workflows/generic_build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 12a2f6c7..ed76cfa1 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -76,9 +76,9 @@ jobs: # ---------------------------------------------------------------------- # Incrementally compose build args, depending on which inputs were # provided. - BUILD_ARGS="" + BUILD_ARGS=() if [ ! -z "${debian_version}" ]; then - BUILD_ARGS+="--build-arg=debian_version=$debian_version" + BUILD_ARGS+=("--build-arg=debian_version=$debian_version") fi if [ ! -z "${bioconda_utils}" ]; then @@ -92,7 +92,7 @@ jobs: # If busybox_version was specified, assume we are making a busybox image. if [ ! -z "${busybox_version}" ]; then - BUILD_ARGS+="--build-arg=busybox_version=$busybox_version" + BUILD_ARGS+=("--build-arg=busybox_version=$busybox_version") # Make a busybox image that we'll use further below. As shown in the # Dockerfile.busybox, this uses the build-busybox script which in turn @@ -104,12 +104,12 @@ jobs: buildah bud \ --iidfile="${iidfile}" \ --file=Dockerfile.busybox \ - $BUILD_ARGS + ${BUILD_ARGS[@]} busybox_image="$( cat "${iidfile}" )" rm "${iidfile}" # And then extend the build args with this image. - BUILD_ARGS+="--build-arg=busybox_image=${busybox_image}" + BUILD_ARGS+=("--build-arg=busybox_image=${busybox_image}") fi # ---------------------------------------------------------------------- @@ -127,7 +127,7 @@ jobs: buildah bud \ --arch="${arch}" \ --iidfile="${iidfile}" \ - $BUILD_ARGS \ + ${BUILD_ARGS[@]} \ $BASE_IMAGE_BUILD_ARG image_id="$( cat "${iidfile}" )" rm "${iidfile}" From 88ecc6f03fbeacb1a1803ecec1eb7d3e4227a411 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 09:33:01 -0500 Subject: [PATCH 77/98] bump --- .github/workflows/bioconda-utils-build-env-cos7.yml | 2 +- .github/workflows/generic_build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bioconda-utils-build-env-cos7.yml b/.github/workflows/bioconda-utils-build-env-cos7.yml index af548485..2ec5767f 100644 --- a/.github/workflows/bioconda-utils-build-env-cos7.yml +++ b/.github/workflows/bioconda-utils-build-env-cos7.yml @@ -13,4 +13,4 @@ jobs: tags: '3.1 3 latest' debian_version: '12.2' archs: 'arm64 amd64' - bioconda_utils: 'master' + bioconda_utils: true diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index ed76cfa1..a39101e8 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -141,7 +141,7 @@ jobs: debian="$( run cat /etc/debian_version | sed '1!d' )" bash="$( run bash --version | sed '1!d' )" - if [ ! -z "${bioconda_utils}" ]; then + if [ "${bioconda_utils}" ]; then bioconda_utils="$( run sh -c '. /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version' \ | rev | cut -f1 -d " " | rev From 07c54d3d3e37b292c5dcce293c2bbeef17c2987f Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 09:34:56 -0500 Subject: [PATCH 78/98] bump --- .github/workflows/generic_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index a39101e8..5cf6b97d 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -177,10 +177,10 @@ jobs: "${image_name}:${tag}" \ "${image_id}" - buildah inspect -t image ${image_name}:${tag} + # buildah inspect -t image ${image_name}:${tag} done done - buidah_inspect -t manifest ${image_name} + # buidah_inspect -t manifest ${image_name} - name: Test run: | From 5d5e9f1197d3d66713a6b9264dc197c09dadc601 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 09:35:52 -0500 Subject: [PATCH 79/98] bump --- .github/workflows/generic_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 5cf6b97d..13da4752 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -116,8 +116,8 @@ jobs: # Build each arch's image for arch in $archs_and_images ; do - arch=$(echo $arch_and_image | cut -f1 -d "=") - base_image=$(echo $arch_and_image | cut -f2 -d "=") + arch=$(echo $archs_and_images | cut -f1 -d "=") + base_image=$(echo $archs_and_images | cut -f2 -d "=") BASE_IMAGE_BUILD_ARG="" if [ ! -z "$base_image" ]; then BASE_IMAGE_BUILD_ARG="--build_arg=base_image="${base_image}"" From 432b9a6fd4617fa991d75d98384d6ae24a822c18 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 09:39:34 -0500 Subject: [PATCH 80/98] bump --- .github/workflows/generic_build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 13da4752..e8918a2e 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -84,10 +84,10 @@ jobs: if [ ! -z "${bioconda_utils}" ]; then # Due to different nomenclature used by conda-forge and buildah, we # need to map archs to base images. - archs_and_images=' - amd64=quay.io/condaforge/linux-anvil-cos7-x86_64 - arm64=quay.io/condaforge/linux-anvil-aarch64 - ' + archs_and_images=( + "amd64=quay.io/condaforge/linux-anvil-cos7-x86_64", + "arm64=quay.io/condaforge/linux-anvil-aarch64" + ) fi # If busybox_version was specified, assume we are making a busybox image. From 8ef2c10c931c77c0a92dcef68dea017aa2c66efd Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 10:49:54 -0500 Subject: [PATCH 81/98] bump --- .github/workflows/generic_build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index e8918a2e..b50deddf 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -15,9 +15,11 @@ on: busybox_version: required: false type: string + debian_version: required: false type: string + image_prefix: required: false type: string @@ -50,7 +52,7 @@ jobs: set -xeu # Store provided inputs as local vars - image_name='${{ inputs.image_name }}${{ inputs.image_prefix }}' + image_name='${{ inputs.image_prefix }}${{ inputs.image_name }}' image_dir='images/${{ inputs.image_name }}' tags='${{ inputs.tags }}' debian_version='${{ inputs.debian_version }}' @@ -85,7 +87,7 @@ jobs: # Due to different nomenclature used by conda-forge and buildah, we # need to map archs to base images. archs_and_images=( - "amd64=quay.io/condaforge/linux-anvil-cos7-x86_64", + "amd64=quay.io/condaforge/linux-anvil-cos7-x86_64" "arm64=quay.io/condaforge/linux-anvil-aarch64" ) fi From 8544b9a4f1c23227074bf1d9513a7806914d626e Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 11:04:34 -0500 Subject: [PATCH 82/98] bump --- .github/workflows/generic_build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index b50deddf..5dbb8744 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -154,9 +154,11 @@ jobs: if [ ! -z "${busybox_version}" ]; then buildah config --label=busybox-version="${busybox_version}" fi - - buildah rm "${container}" + + # TODO: use array for labels, and make sure this next container is + # the one getting the labels (above, bioconda-utils is added to the + # first container which is then rmed) container="$( buildah from "${image_id}" )" buildah config \ --label=glibc="${glibc}" \ @@ -179,10 +181,10 @@ jobs: "${image_name}:${tag}" \ "${image_id}" - # buildah inspect -t image ${image_name}:${tag} + buildah inspect -t image ${image_name}:${tag} done done - # buidah_inspect -t manifest ${image_name} + buidah inspect -t manifest ${image_name} - name: Test run: | From 5bdc847be8a5ea6cdedc0b842a1a7069c0f2571d Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 11:05:30 -0500 Subject: [PATCH 83/98] bump --- .github/workflows/generic_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 5dbb8744..e03003c4 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -122,7 +122,7 @@ jobs: base_image=$(echo $archs_and_images | cut -f2 -d "=") BASE_IMAGE_BUILD_ARG="" if [ ! -z "$base_image" ]; then - BASE_IMAGE_BUILD_ARG="--build_arg=base_image="${base_image}"" + BASE_IMAGE_BUILD_ARG="--build-arg=base_image="${base_image}"" fi iidfile="$( mktemp )" From befacb87b22dddc0c060c77d0188f67fd128b250 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 11:26:56 -0500 Subject: [PATCH 84/98] bump --- .github/workflows/generic_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index e03003c4..04b733da 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -184,7 +184,7 @@ jobs: buildah inspect -t image ${image_name}:${tag} done done - buidah inspect -t manifest ${image_name} + buildah inspect -t manifest ${image_name} - name: Test run: | From a1fd5d2c84723570927911de432e107f6c2afb72 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 11:38:14 -0500 Subject: [PATCH 85/98] bump --- .github/workflows/generic_build.yml | 36 +++++++++++++---------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 04b733da..7603ac80 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -134,41 +134,37 @@ jobs: image_id="$( cat "${iidfile}" )" rm "${iidfile}" - # Extract various package info and version info, then store that info as labels + # Extract various package info and version info, then store that info + # as labels. Container is removed at the end to avoid e.g. having these + # commands in the history of the container. container="$( buildah from "${image_id}" )" run() { buildah run "${container}" "${@}" ; } - deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )" - pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )" - glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )" - debian="$( run cat /etc/debian_version | sed '1!d' )" - bash="$( run bash --version | sed '1!d' )" + LABELS=() + LABELS+=("--label=deb-list=\"$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )\"") + LABELS+=("--label=pkg-list=\"$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )\"") + LABELS+=("--label=glibc=\"$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )\"") + LABELS+=("--label=debian=\"$( run cat /etc/debian_version | sed '1!d' )\"") + LABELS+=("--label=bash=\"$( run bash --version | sed '1!d' )\"") if [ "${bioconda_utils}" ]; then bioconda_utils="$( run sh -c '. /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version' \ | rev | cut -f1 -d " " | rev )" - buildah config --label=bioconda-utils="${bioconda_utils}" ${container} + LABELS+=("--label=\"${bioconda_utils}\"") fi if [ ! -z "${busybox_version}" ]; then - buildah config --label=busybox-version="${busybox_version}" + LABELS+=("--label=busybox-version=\"${busybox_version}\"") fi buildah rm "${container}" - # TODO: use array for labels, and make sure this next container is - # the one getting the labels (above, bioconda-utils is added to the - # first container which is then rmed) + # Add labels to a new container... container="$( buildah from "${image_id}" )" - buildah config \ - --label=glibc="${glibc}" \ - --label=debian="${debian}" \ - --label=bash="${bash}" \ - --label=deb-list="${deb_list}" \ - --label=pkg-list="${pkg_list}" \ - "${container}" - - # Store the new image (now with labels) + buildah config ${LABELS[@]} "${container}" + + # ...then store the container (now with labels) as a new image. This + # is what we'll use to upload. image_id="$( buildah commit "${container}" )" buildah rm "${container}" From 37b6e47295a37e1fcc7345161a5b5bccf11c007e Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 11:40:48 -0500 Subject: [PATCH 86/98] bump --- .github/workflows/generic_build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 7603ac80..c981810e 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -46,6 +46,14 @@ jobs: with: platforms: arm64 + - name: Checkout bioconda-utils + uses: actions/checkout@v4 + if: '${{ inputs.bioconda_utils }}' + with: + fetch-depth: 0 + repository: 'bioconda/bioconda-utils' + path: 'images/bioconda-utils-build-env-cos7/bioconda-utils' + - name: Build id: build run: | From f72e4a7139ae9b1e2b5e2bad2e8cb1f68bd00a21 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 11:46:25 -0500 Subject: [PATCH 87/98] bump --- .github/workflows/generic_build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index c981810e..50162745 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -91,7 +91,7 @@ jobs: BUILD_ARGS+=("--build-arg=debian_version=$debian_version") fi - if [ ! -z "${bioconda_utils}" ]; then + if [ "${bioconda_utils}" == "true" ]; then # Due to different nomenclature used by conda-forge and buildah, we # need to map archs to base images. archs_and_images=( @@ -150,7 +150,13 @@ jobs: LABELS=() LABELS+=("--label=deb-list=\"$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )\"") LABELS+=("--label=pkg-list=\"$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )\"") - LABELS+=("--label=glibc=\"$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )\"") + LABELS+=("--label=glibc=\"$( + run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' + | sed '1!d' + | sed "s/ /_/g" + | sed "s/\"//g" + | sed "s/\'//g")\"" + ) LABELS+=("--label=debian=\"$( run cat /etc/debian_version | sed '1!d' )\"") LABELS+=("--label=bash=\"$( run bash --version | sed '1!d' )\"") From 1d6be82978f6728c6912a1b1433c9685bf5ebf01 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 11:51:39 -0500 Subject: [PATCH 88/98] bump --- .github/workflows/generic_build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 50162745..a39ab3e8 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -82,7 +82,9 @@ jobs: buildah manifest create "${image_name}:${tag}" done - archs_and_images=$archs + # get space-separated archs input string into an array + read -r -a archs_and_images <<<"$archs" + # ---------------------------------------------------------------------- # Incrementally compose build args, depending on which inputs were # provided. From c4034c6c8c4574f7c845b92feed9a4c9df3388f5 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Fri, 2 Feb 2024 11:57:32 -0500 Subject: [PATCH 89/98] bump --- .github/workflows/generic_build.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index a39ab3e8..55da99a4 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -152,13 +152,7 @@ jobs: LABELS=() LABELS+=("--label=deb-list=\"$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )\"") LABELS+=("--label=pkg-list=\"$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )\"") - LABELS+=("--label=glibc=\"$( - run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' - | sed '1!d' - | sed "s/ /_/g" - | sed "s/\"//g" - | sed "s/\'//g")\"" - ) + # LABELS+=("--labels=glibc=\"$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )\"") LABELS+=("--label=debian=\"$( run cat /etc/debian_version | sed '1!d' )\"") LABELS+=("--label=bash=\"$( run bash --version | sed '1!d' )\"") From 1766609b0456bb972be496cb7270cc19dbbd69e3 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 5 Feb 2024 09:15:13 -0500 Subject: [PATCH 90/98] bump --- .github/workflows/generic_build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 55da99a4..957a558e 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -152,7 +152,7 @@ jobs: LABELS=() LABELS+=("--label=deb-list=\"$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )\"") LABELS+=("--label=pkg-list=\"$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )\"") - # LABELS+=("--labels=glibc=\"$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )\"") + LABELS+=("--labels=glibc=\"$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )\"") LABELS+=("--label=debian=\"$( run cat /etc/debian_version | sed '1!d' )\"") LABELS+=("--label=bash=\"$( run bash --version | sed '1!d' )\"") @@ -171,7 +171,10 @@ jobs: # Add labels to a new container... container="$( buildah from "${image_id}" )" - buildah config ${LABELS[@]} "${container}" + + # FIXME: can't quite get the quoting right for args in array, so + # disabling for now to get other things working. + # buildah config ${LABELS[@]} "${container}" # ...then store the container (now with labels) as a new image. This # is what we'll use to upload. From cc61158135358f704d9acabf982941f9166ed9cb Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 5 Feb 2024 09:39:36 -0500 Subject: [PATCH 91/98] bump --- .github/workflows/generic_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 957a558e..0ac77eb2 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -190,7 +190,7 @@ jobs: "${image_name}:${tag}" \ "${image_id}" - buildah inspect -t image ${image_name}:${tag} + buildah inspect -t image ${image_name}:${tag}-${arch} done done buildah inspect -t manifest ${image_name} From 1398b8f2c7ba66785b05f66b4ac9c658dbddee9a Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 5 Feb 2024 11:39:40 -0500 Subject: [PATCH 92/98] bump --- .github/workflows/generic_build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 0ac77eb2..ab37aece 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -127,9 +127,9 @@ jobs: # ---------------------------------------------------------------------- # Build each arch's image - for arch in $archs_and_images ; do - arch=$(echo $archs_and_images | cut -f1 -d "=") - base_image=$(echo $archs_and_images | cut -f2 -d "=") + for arch_and_image in "${archs_and_images[@]}" ; do + arch=$(echo $arch_and_image | cut -f1 -d "=") + base_image=$(echo $arch_and_image | cut -f2 -d "=") BASE_IMAGE_BUILD_ARG="" if [ ! -z "$base_image" ]; then BASE_IMAGE_BUILD_ARG="--build-arg=base_image="${base_image}"" From c739426f07ff14c2ee0d8787196bb602385a15e1 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 5 Feb 2024 12:00:59 -0500 Subject: [PATCH 93/98] try label fix --- .github/workflows/generic_build.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index ab37aece..baec7e5a 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -161,7 +161,7 @@ jobs: run sh -c '. /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version' \ | rev | cut -f1 -d " " | rev )" - LABELS+=("--label=\"${bioconda_utils}\"") + LABELS+=("--label=bioconda-utils=\"${bioconda_utils}\"") fi if [ ! -z "${busybox_version}" ]; then @@ -171,10 +171,7 @@ jobs: # Add labels to a new container... container="$( buildah from "${image_id}" )" - - # FIXME: can't quite get the quoting right for args in array, so - # disabling for now to get other things working. - # buildah config ${LABELS[@]} "${container}" + buildah config ${LABELS[@]} "${container}" # ...then store the container (now with labels) as a new image. This # is what we'll use to upload. From d85af0c99648ec767e37065a49cfda7bf65eb801 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 5 Feb 2024 12:10:34 -0500 Subject: [PATCH 94/98] bump --- .github/workflows/generic_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index baec7e5a..a2e81161 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -152,7 +152,7 @@ jobs: LABELS=() LABELS+=("--label=deb-list=\"$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )\"") LABELS+=("--label=pkg-list=\"$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )\"") - LABELS+=("--labels=glibc=\"$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )\"") + LABELS+=("--label=glibc=\"$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )\"") LABELS+=("--label=debian=\"$( run cat /etc/debian_version | sed '1!d' )\"") LABELS+=("--label=bash=\"$( run bash --version | sed '1!d' )\"") From 5c0dc83de9c5e8012c5ceeb48e4956eab29d495d Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 5 Feb 2024 14:08:11 -0500 Subject: [PATCH 95/98] back to disabling labels --- .github/workflows/generic_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index a2e81161..437dd697 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -156,7 +156,7 @@ jobs: LABELS+=("--label=debian=\"$( run cat /etc/debian_version | sed '1!d' )\"") LABELS+=("--label=bash=\"$( run bash --version | sed '1!d' )\"") - if [ "${bioconda_utils}" ]; then + if [ "${bioconda_utils}" == "true" ]; then bioconda_utils="$( run sh -c '. /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version' \ | rev | cut -f1 -d " " | rev @@ -171,7 +171,7 @@ jobs: # Add labels to a new container... container="$( buildah from "${image_id}" )" - buildah config ${LABELS[@]} "${container}" + # buildah config ${LABELS[@]} "${container}" # ...then store the container (now with labels) as a new image. This # is what we'll use to upload. From 823ff050e577fc59ac90b6e41313b354e5711721 Mon Sep 17 00:00:00 2001 From: aliciaaevans Date: Mon, 5 Feb 2024 16:08:48 -0500 Subject: [PATCH 96/98] test a few label quoting things --- .github/workflows/generic_build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 437dd697..ace2e7d4 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -171,7 +171,15 @@ jobs: # Add labels to a new container... container="$( buildah from "${image_id}" )" - # buildah config ${LABELS[@]} "${container}" + + # FIXME: Test out different options + declare -a mycmd=( buildah config ${LABELS[@]} "${container}" ) + echo "Label args: " "${LABELS[@]}" + echo "Label args with @Q: " "${LABELS[@]@Q}" + echo "Label command: " "${mycmd[@]}" + echo "Label command with @Q: " "${mycmd[@]@Q}" + + buildah config "${LABELS[@]}" "${container}" # ...then store the container (now with labels) as a new image. This # is what we'll use to upload. From 4e130a7d2347bda25acd2541c057466e99ddbf90 Mon Sep 17 00:00:00 2001 From: aliciaaevans Date: Mon, 5 Feb 2024 16:40:14 -0500 Subject: [PATCH 97/98] remove extra double quotes --- .github/workflows/generic_build.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index ace2e7d4..62621ffc 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -150,34 +150,34 @@ jobs: container="$( buildah from "${image_id}" )" run() { buildah run "${container}" "${@}" ; } LABELS=() - LABELS+=("--label=deb-list=\"$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )\"") - LABELS+=("--label=pkg-list=\"$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )\"") - LABELS+=("--label=glibc=\"$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )\"") - LABELS+=("--label=debian=\"$( run cat /etc/debian_version | sed '1!d' )\"") - LABELS+=("--label=bash=\"$( run bash --version | sed '1!d' )\"") + LABELS+=("--label=deb-list=$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )") + LABELS+=("--label=pkg-list=$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )") + LABELS+=("--label=glibc=$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )") + LABELS+=("--label=debian=$( run cat /etc/debian_version | sed '1!d' )") + LABELS+=("--label=bash=$( run bash --version | sed '1!d' )") if [ "${bioconda_utils}" == "true" ]; then bioconda_utils="$( run sh -c '. /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version' \ | rev | cut -f1 -d " " | rev )" - LABELS+=("--label=bioconda-utils=\"${bioconda_utils}\"") + LABELS+=("--label=bioconda-utils=${bioconda_utils}") fi if [ ! -z "${busybox_version}" ]; then - LABELS+=("--label=busybox-version=\"${busybox_version}\"") + LABELS+=("--label=busybox-version=${busybox_version}") fi buildah rm "${container}" # Add labels to a new container... container="$( buildah from "${image_id}" )" - # FIXME: Test out different options - declare -a mycmd=( buildah config ${LABELS[@]} "${container}" ) - echo "Label args: " "${LABELS[@]}" - echo "Label args with @Q: " "${LABELS[@]@Q}" - echo "Label command: " "${mycmd[@]}" - echo "Label command with @Q: " "${mycmd[@]@Q}" + # # FIXME: Test out different options + # declare -a mycmd=( buildah config ${LABELS[@]} "${container}" ) + # echo "Label args: " "${LABELS[@]}" + # echo "Label args with @Q: " "${LABELS[@]@Q}" + # echo "Label command: " "${mycmd[@]}" + # echo "Label command with @Q: " "${mycmd[@]@Q}" buildah config "${LABELS[@]}" "${container}" From c3bd6749909bffb2cbc4a969b0f3bb37442595cd Mon Sep 17 00:00:00 2001 From: aliciaaevans Date: Mon, 5 Feb 2024 16:48:04 -0500 Subject: [PATCH 98/98] remove extra logging --- .github/workflows/generic_build.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/generic_build.yml b/.github/workflows/generic_build.yml index 62621ffc..548ea51f 100644 --- a/.github/workflows/generic_build.yml +++ b/.github/workflows/generic_build.yml @@ -171,14 +171,6 @@ jobs: # Add labels to a new container... container="$( buildah from "${image_id}" )" - - # # FIXME: Test out different options - # declare -a mycmd=( buildah config ${LABELS[@]} "${container}" ) - # echo "Label args: " "${LABELS[@]}" - # echo "Label args with @Q: " "${LABELS[@]@Q}" - # echo "Label command: " "${mycmd[@]}" - # echo "Label command with @Q: " "${mycmd[@]@Q}" - buildah config "${LABELS[@]}" "${container}" # ...then store the container (now with labels) as a new image. This