From 04e6b30c5315e240f73b117598475be465aa1e5b Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Sat, 27 Jan 2024 17:22:35 -0500 Subject: [PATCH 01/21] 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 02/21] 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 03/21] 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 04/21] 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 05/21] 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 06/21] 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 07/21] 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 08/21] 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 09/21] 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 10/21] 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 11/21] 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 12/21] 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 13/21] 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 14/21] 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 15/21] 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 16/21] 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 17/21] 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 18/21] 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 19/21] 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 20/21] 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 21/21] 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 }}'