-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make base images multiarch #55
Changes from all commits
484c3e2
55141ff
91d5700
d539259
73956c6
af88732
e1c9d8a
4d7695c
5ab1e66
bfcb907
575ea75
6a1897b
c1e64e2
29fd36c
a682f56
891daa4
a9d086d
c21a608
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,19 +14,24 @@ on: | |
jobs: | ||
build: | ||
name: Build & Push | ||
runs-on: ubuntu-18.04 | ||
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". | ||
IMAGE_VERSION: '2.1.0' | ||
IMAGE_VERSION: '3.0.0' | ||
IMAGE_NAME: base-glibc-debian-bash | ||
DEBIAN_VERSION: '10.9' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
id: buildah-build | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm64 | ||
|
||
- name: Calculate tags and labels | ||
id: calculate | ||
run: | | ||
set -xeu | ||
cd 'images/${{ env.IMAGE_NAME }}' | ||
|
@@ -44,10 +49,10 @@ jobs: | |
debian="$( run cat /etc/debian_version | sed '1!d' )" | ||
bash="$( run bash --version | sed '1!d' )" | ||
buildah rm "${container}" | ||
|
||
container="$( buildah from "${image_id}" )" | ||
buildah config --label=glibc="${glibc}" "${container}" | ||
buildah config --label=debian="${debian}" "${container}" | ||
labels=" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. buildah config --label=glibc="${glibc}" "${container}" Not sure what did the original buildah do? Just label variable? Was it used by some other where? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know where and how these labels are used but they are still set at https://github.com/bioconda/bioconda-containers/pull/55/files#diff-b4a54ac6775437f0dbe546b99c784d76f3defaaa74b1456488e4fa4f78850e1cR75 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, great! |
||
glibc=${glibc} | ||
debian=${debian} | ||
" | ||
|
||
glibc_version="$( printf %s "${glibc}" | sed -E 's/.*version ([0-9.]*[0-9]).*/\1/' )" | ||
debian_version="$( printf %s "${debian}" | sed -E 's|/|_|g' )" | ||
|
@@ -57,24 +62,28 @@ jobs: | |
${{ env.IMAGE_VERSION }}_${glibc_version}_${debian_version}_${bash_version} | ||
latest | ||
" | ||
|
||
echo "tags=$( echo ${tags} )" >> $GITHUB_OUTPUT | ||
echo "labels=$( echo ${labels} )" >> $GITHUB_OUTPUT | ||
|
||
image_id="$( buildah commit "${container}" )" | ||
buildah rm "${container}" | ||
image_name='${{ env.IMAGE_NAME }}' | ||
|
||
for tag in ${tags} ; do | ||
buildah tag "${image_id}" \ | ||
"${image_name}":"${tag}" | ||
done | ||
|
||
echo "::set-output name=image::${image_name}" | ||
echo "::set-output name=tags::$( echo ${tags} )" | ||
- name: Build multiarch image | ||
id: build | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: ${{ env.IMAGE_NAME }} | ||
tags: ${{ steps.calculate.outputs.tags }} | ||
labels: ${{ steps.calculate.outputs.labels }} | ||
archs: amd64,arm64 | ||
build-args: | | ||
debian_version=${{ env.DEBIAN_VERSION }} | ||
containerfiles: | | ||
./images/${{ env.IMAGE_NAME }}/Dockerfile | ||
|
||
- name: Test | ||
run: | | ||
image='${{ steps.buildah-build.outputs.image }}' | ||
image='${{ steps.build.outputs.image }}' | ||
ids="$( | ||
for tag in ${{ steps.buildah-build.outputs.tags }} ; do | ||
for tag in ${{ steps.calculate.outputs.tags }} ; do | ||
buildah images --quiet --no-trunc "${image}:${tag}" | ||
done | ||
)" | ||
|
@@ -90,13 +99,13 @@ jobs: | |
|
||
- name: Check Tags | ||
run: | | ||
set -x | ||
# FIX upstream: Quay.io does not support immutable images currently. | ||
# => Try to use the REST API to check for duplicate tags. | ||
response=$( | ||
curl -H "Authorization: Bearer $TOKEN" \ | ||
-sL \ | ||
'https://quay.io/api/v1/repository/bioconda/${{ steps.buildah-build.outputs.image }}/image' | ||
) | ||
response="$( | ||
curl -sL -H "Authorization: Bearer ${{ secrets.QUAY_BIOCONDA_TOKEN }}" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not tested because the secrets are not exported to forks/PRs. |
||
'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image }}/image' | ||
)" | ||
|
||
existing_tags="$( | ||
printf %s "${response}" \ | ||
|
@@ -107,10 +116,10 @@ jobs: | |
'Could not get list of image tags.' \ | ||
'Does the repository exist on Quay.io?' \ | ||
'Quay.io REST API response was:' \ | ||
"${respone}" | ||
"${response}" | ||
exit 1 | ||
} | ||
for tag in ${{ steps.buildah-build.outputs.tags }} ; do | ||
for tag in ${{ steps.calculate.outputs.tags }} ; do | ||
if [ \! "${tag}" = latest ] ; then | ||
if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then | ||
printf 'Tag %s already exists!\n' "${tag}" | ||
|
@@ -122,21 +131,22 @@ jobs: | |
TOKEN: ${{ secrets.secrets.QUAY_BIOCONDA_TOKEN }} | ||
|
||
- if: ${{ github.ref == 'refs/heads/main' }} | ||
name: Push | ||
name: Push To quay.io | ||
id: push-to-quay | ||
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.calculate.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 }}' | ||
image='${{ steps.build.outputs.image }}' | ||
ids="$( | ||
for tag in ${{ steps.buildah-build.outputs.tags }} ; do | ||
for tag in ${{ steps.calculate.outputs.tags }} ; do | ||
buildah images --quiet --no-trunc "${image}:${tag}" | ||
done | ||
)" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a normal upgrade or for special fixing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bumped the major version because now the image would be multi-arch and because of the update of Ubuntu version and the GLIBC coming with it.
But since there are no changes for the x86_64 users maybe we should bump the minor/patch version ?! I am OK to update the PR with the preferred change by the maintainers!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason I can think of to keep the older version is to use an older libc for testing to make sure our packages for on older HPC. But this should be ensure with the build container ... so following this and trusting the build container I think we could bump the runtime container.
@bioconda/build-system any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just bumped the version of
create-env
image too to3.0.0
, so it is in sync with the other images in this PR.As I said above I'd be happy to change the version to whatever the Bioconda team thinks it should be!