Skip to content

Commit

Permalink
Publish ci-conda image tag (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
AyodeAwe authored Sep 20, 2023
1 parent 7f9d049 commit e8a65f9
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 7 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ jobs:
LINUX_VER: ${{ inputs.LINUX_VER }}
PYTHON_VER: ${{ inputs.PYTHON_VER }}
ARCH: ${{ matrix.ARCH }}
- name: Generate Additional Tag
id: generate-additional-tag
run: ci/generate-tags.sh
env:
CURRENT_TAG: ${{ inputs.IMAGE_NAME }}-${{ matrix.ARCH }}
- name: Build image
uses: docker/build-push-action@v4
with:
Expand All @@ -66,4 +71,4 @@ jobs:
pull: true
build-args: |
${{ steps.generate-build-args.outputs.ARGS }}
tags: ${{ inputs.IMAGE_NAME }}-${{ matrix.ARCH }}
tags: ${{ steps.generate-additional-tag.outputs.TAG }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This repository includes the following CI images for RAPIDS:

- `ci` images are conda CI images used for building RAPIDS.
- `ci-conda` images are conda CI images used for building RAPIDS.
- `ci-wheel` images are for building manylinux-compliant wheels. They are also used to build pure-Python wheels, and for publishing wheels with twine.
- `citestwheel` images are for running wheel tests.

Expand Down
File renamed without changes.
28 changes: 27 additions & 1 deletion ci/create-multiarch-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail

PREFIX="conda"
if [[ "${IMAGE_REPO}" != "ci" ]]; then
if [[ "${IMAGE_REPO}" != "ci-conda" ]]; then
PREFIX="wheels"
fi

Expand Down Expand Up @@ -31,3 +31,29 @@ if [[
echo "Skipping 'latest' manifest creation for PR workflow."
fi
fi

# publish rapidsai/ci manifests too
if [[ $IMAGE_NAME =~ ci-conda ]]; then
IMAGE_NAME=$(echo "$IMAGE_NAME" | sed 's/ci-conda/ci/')
source_tags=()
tag="${IMAGE_NAME}"
for arch in $(echo "${ARCHES}" | jq .[] -r); do
source_tags+=("${tag}-${arch}")
done

docker manifest create "${tag}" "${source_tags[@]}"
docker manifest push "${tag}"
if [[
"${LATEST_UBUNTU_VER}" == "${LINUX_VER}" &&
"${LATEST_CUDA_VER}" == "${CUDA_VER}" &&
"${LATEST_PYTHON_VER}" == "${PYTHON_VER}"
]]; then
# only create a 'latest' manifest if it is a non-PR workflow.
if [[ "${BUILD_TYPE}" != "pull-request" ]]; then
docker manifest create "rapidsai/${IMAGE_REPO}:latest" "${source_tags[@]}"
docker manifest push "rapidsai/${IMAGE_REPO}:latest"
else
echo "Skipping 'latest' manifest creation for PR workflow."
fi
fi
fi
12 changes: 12 additions & 0 deletions ci/generate-tags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -euo pipefail

if [[ ! "$CURRENT_TAG" =~ "ci-conda" ]]; then
echo "TAG=$CURRENT_TAG" > "$GITHUB_OUTPUT"
exit 0
fi

CI_TAG=$(echo "$CURRENT_TAG" | sed 's/ci-conda/ci/')

echo "TAG=$CURRENT_TAG,$CI_TAG" | tee --append "$GITHUB_OUTPUT"

14 changes: 14 additions & 0 deletions ci/remove-temp-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,17 @@ for arch in $(echo "$ARCHES" | jq .[] -r); do
-H "Authorization: JWT $HUB_TOKEN" \
"https://hub.docker.com/v2/repositories/$full_repo_name/tags/$tag-$arch/"
done

# delete rapidsai/ci imgs too
if [[ $IMAGE_NAME =~ ci-conda ]]; then
IMAGE_NAME=$(echo "$IMAGE_NAME" | sed 's/ci-conda/ci/')
full_repo_name=${IMAGE_NAME%%:*}
tag=${IMAGE_NAME##*:}

for arch in $(echo "$ARCHES" | jq .[] -r); do
curl --fail-with-body -i -X DELETE \
-H "Accept: application/json" \
-H "Authorization: JWT $HUB_TOKEN" \
"https://hub.docker.com/v2/repositories/$full_repo_name/tags/$tag-$arch/"
done
fi
8 changes: 4 additions & 4 deletions matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ LINUX_VER:
- "centos7"
- "rockylinux8"
IMAGE_REPO:
- "ci"
- "ci-conda"
- "ci-wheel"
- "citestwheel"
exclude:
# ci:
# ci-conda:
- LINUX_VER: "ubuntu22.04"
CUDA_VER: "11.2.2"
- LINUX_VER: "ubuntu22.04"
Expand Down Expand Up @@ -63,6 +63,6 @@ exclude:
- LINUX_VER: "ubuntu22.04"
IMAGE_REPO: "ci-wheel"

# exclude ci for ubuntu18.04
# exclude ci-conda for ubuntu18.04
- LINUX_VER: "ubuntu18.04"
IMAGE_REPO: "ci"
IMAGE_REPO: "ci-conda"

0 comments on commit e8a65f9

Please sign in to comment.