Skip to content

Commit 5989f1b

Browse files
committed
label fixes
1 parent 2321455 commit 5989f1b

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

.github/workflows/bioconda-utils-build-env-cos7.yml

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ jobs:
1313
tags: '3.1 3 latest'
1414
debian_version: '12.2'
1515
archs: 'arm64 amd64'
16+
bioconda_utils: 'master'

.github/workflows/generic_build.yml

+25-19
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
debian_version='${{ inputs.debian_version }}'
5757
busybox_version='${{ inputs.busybox_version }}'
5858
archs='${{ inputs.archs }}'
59+
bioconda_utils='${{ inputs.bioconda_utils }}'
5960
6061
# Adds image and tags to outputs which can be used in later steps.
6162
printf %s\\n \
@@ -80,7 +81,7 @@ jobs:
8081
BUILD_ARGS+="--build-arg=debian_version=$debian_version"
8182
fi
8283
83-
if [ '${{ inputs.bioconda_utils }}' ]; then
84+
if [ ! -z "${bioconda_utils}" ]; then
8485
# Due to different nomenclature used by conda-forge and buildah, we
8586
# need to map archs to base images.
8687
archs_and_images='
@@ -93,7 +94,10 @@ jobs:
9394
if [ ! -z "${busybox_version}" ]; then
9495
BUILD_ARGS+="--build-arg=busybox_version=$busybox_version"
9596
96-
# Make a busybox image that we'll use further below.
97+
# Make a busybox image that we'll use further below. As shown in the
98+
# Dockerfile.busybox, this uses the build-busybox script which in turn
99+
# cross-compiles for x86_64 and aarch64, and these are later copied
100+
# into an arch-specific container.
97101
# --iidfile prints the built image ID to the specified file so we can
98102
# refer to the image later
99103
iidfile="$( mktemp )"
@@ -128,38 +132,37 @@ jobs:
128132
image_id="$( cat "${iidfile}" )"
129133
rm "${iidfile}"
130134
131-
# Extract various package info and version info...
135+
# Extract various package info and version info, then store that info as labels
132136
container="$( buildah from "${image_id}" )"
133137
run() { buildah run "${container}" "${@}" ; }
134-
135-
# Incrementally make labels
136-
137138
deb_list="$( run cat /.deb.lst | tr '\n' '|' | sed 's/|$//' )"
138-
139139
pkg_list="$( run cat /.pkg.lst | tr '\n' '|' | sed 's/|$//' )"
140140
glibc="$( run sh -c 'exec "$( find -xdev -name libc.so.6 -print -quit )"' | sed '1!d' )"
141141
debian="$( run cat /etc/debian_version | sed '1!d' )"
142142
bash="$( run bash --version | sed '1!d' )"
143143
144-
buildah rm "${container}"
145-
146-
LABELS=""
147-
LABELS+="--label=deb-list=${deb_list} "
148-
LABELS+="--label=pkg-list=${pkg_list} "
149-
LABELS+="--label=glibc=${glibc} "
150-
LABELS+="--label=debian=${debian} "
151-
LABELS+="--label=bash=${bash} "
152-
if [ '${{ inputs.bioconda_utils }}' ]; then
144+
if [ ! -z "${bioconda_utils}" ]; then
153145
bioconda_utils="$(
154146
run sh -c '. /opt/conda/etc/profile.d/conda.sh && conda activate base && bioconda-utils --version' \
155147
| rev | cut -f1 -d " " | rev
156148
)"
157-
LABELS+="--label=bioconda-utils=${bioconda_utils} "
149+
buildah config --label=bioconda-utils="${bioconda_utils}" ${container}
158150
fi
159151
160-
# ...then store that info as labels for the image
152+
if [ ! -z "${busybox_version}" ]; then
153+
buildah config --label=busybox-version="${busybox_version}"
154+
fi
155+
156+
157+
buildah rm "${container}"
161158
container="$( buildah from "${image_id}" )"
162-
buildah config $LABELS "${container}"
159+
buildah config \
160+
--label=glibc="${glibc}" \
161+
--label=debian="${debian}" \
162+
--label=bash="${bash}" \
163+
--label=deb-list="${deb_list}" \
164+
--label=pkg-list="${pkg_list}" \
165+
"${container}"
163166
164167
# Store the new image (now with labels)
165168
image_id="$( buildah commit "${container}" )"
@@ -173,8 +176,11 @@ jobs:
173176
buildah manifest add \
174177
"${image_name}:${tag}" \
175178
"${image_id}"
179+
180+
buildah inspect -t image ${image_name}:${tag}
176181
done
177182
done
183+
buidah_inspect -t manifest ${image_name}
178184
179185
- name: Test
180186
run: |

0 commit comments

Comments
 (0)