Skip to content

Commit

Permalink
Handle multi-arch container images (#315)
Browse files Browse the repository at this point in the history
Closes #263. See also #309 for other fixes to the pipeline that relies
on these helpers.

---------

Co-authored-by: Terry Kong <[email protected]>
  • Loading branch information
olupton and terrykong authored Dec 7, 2023
1 parent ab05876 commit f6d52f0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 45 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/_triage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ jobs:
filter_valid_tags() {
fgrep -x -f <(echo "$ALL_BASE_TAGS")
}
start_date=${BASE_IMAGE##*nightly-}
end_date=$(get_build_date ${{ secrets.GITHUB_TOKEN }} $BROKEN_IMAGE )
start_date=$(get_build_date $BASE_IMAGE linux amd64)
end_date=$(get_build_date $BROKEN_IMAGE linux amd64)
if ! docker manifest inspect ${BASE_IMAGE} >/dev/null 2>&1; then
echo "Script assumes $BASE_IMAGE exists, but it wasn't found"
exit 1
Expand Down Expand Up @@ -453,4 +453,4 @@ jobs:
assignee: ${{ steps.summary-table.outputs.ASSIGNEE }}
labels: "[\"auto-triage\"]"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 4 additions & 6 deletions .github/workflows/scripts/get_build_date.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/bin/bash

source $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/inspect_remote_img.sh
get_build_date() {
if [[ $# -ne 2 ]]; then
echo 'get_build_date $GH_TOKEN $IMAGE'
echo 'Example: get_build_date XXXXXXXXXXXX ghcr.io/nvidia/t5x:latest'
if [[ $# -ne 3 ]]; then
echo 'get_build_date $IMAGE $OS $ARCH'
echo 'Example: get_build_date ghcr.io/nvidia/upstream-t5x:latest linux amd64'
echo 'Returns the BUILD_DATE of a tagged remote image (no download)'
return 1
fi
inspect_remote_img $@ | jq -r '.config.Labels["org.opencontainers.image.created"]'
skopeo inspect --override-arch "${3}" --override-os "${2}" "docker://${1}" | jq -r '.Labels["org.opencontainers.image.created"]'
}
10 changes: 4 additions & 6 deletions .github/workflows/scripts/get_remote_env.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/bash

source $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/inspect_remote_img.sh
get_remote_env() {
if [[ $# -ne 2 ]]; then
echo 'get_remote_env $GH_TOKEN $IMAGE'
echo 'Example: get_remote_env XXXXXXXXXXXX ghcr.io/nvidia/t5x:latest'
if [[ $# -ne 3 ]]; then
echo 'get_remote_env $IMAGE $OS $ARCH'
echo 'Example: get_remote_env ghcr.io/nvidia/upstream-t5x:latest linux amd64'
echo 'Returns the ENV of a tagged remote image (no download)'
echo 'Useful to inspect CUDA env vars'
return 1
fi
inspect_remote_img $@ | jq .config.Env
skopeo inspect --override-arch "${3}" --override-os "${2}" "docker://${1}" | jq -r '.Env'
}
10 changes: 4 additions & 6 deletions .github/workflows/scripts/get_remote_labels.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/bin/bash

source $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/inspect_remote_img.sh
get_remote_labels() {
if [[ $# -ne 2 ]]; then
echo '[get_remote_labels](./get_remote_labels.sh) $GH_TOKEN $IMAGE'
echo 'Example: get_remote_labels XXXXXXXXXXXX ghcr.io/nvidia/t5x:latest'
if [[ $# -ne 3 ]]; then
echo 'get_remote_labels $IMAGE $OS $ARCH'
echo 'Example: get_remote_labels ghcr.io/nvidia/upstream-t5x:latest linux amd64'
echo 'Returns the opencontainer annotation labels of a tagged remote image (no download)'
return 1
fi
inspect_remote_img $@ | jq .config.Labels
skopeo inspect --override-arch "${3}" --override-os "${2}" "docker://${1}" | jq -r '.Labels'
}
24 changes: 0 additions & 24 deletions .github/workflows/scripts/inspect_remote_img.sh

This file was deleted.

0 comments on commit f6d52f0

Please sign in to comment.