Skip to content

Commit 4f1eb87

Browse files
committed
Allow RAPIDS workflows to run on arbitrary tags/version.
1 parent cd6a090 commit 4f1eb87

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

.github/workflows/build-rapids.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
name: Build all RAPIDS repositories
22

33
on:
4+
workflow_dispatch:
45
workflow_call:
56
inputs:
7+
override_cccl_tag:
8+
description: "If set, override the tag used for the CCCL repository."
9+
required: false
10+
default: ""
11+
type: string
12+
override_cccl_version:
13+
description: "If set, override the version used by rapids-cmake to patch CCCL."
14+
required: false
15+
default: ""
16+
type: string
617
enable_slack_alerts:
718
description: "If true, a message will be posted to the CCCL GHA CI Alert channel if the workflow fails."
819
required: false
@@ -57,6 +68,8 @@ jobs:
5768
role-duration-seconds: 43200 # 12h
5869
- name: Run command # Do not change this step's name, it is checked in parse-job-times.py
5970
env:
71+
CCCL_TAG: ${{ inputs.override_cccl_tag }}
72+
CCCL_VERSION: ${{ inputs.override_cccl_version }}
6073
CI: true
6174
RAPIDS_LIBS: ${{ matrix.libs }}
6275
# Uncomment any of these to customize the git repo and branch for a RAPIDS lib:
@@ -146,6 +159,8 @@ jobs:
146159
--docker \
147160
--cuda ${{matrix.cuda}} \
148161
--host rapids-conda \
162+
--env "CCCL_TAG=${CCCL_TAG}" \
163+
--env "CCCL_VERSION=${CCCL_VERSION}" \
149164
--env "AWS_ROLE_ARN=" \
150165
--env "AWS_REGION=$AWS_REGION" \
151166
--env "SCCACHE_REGION=$AWS_REGION" \

ci/rapids/post-create-command.sh

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,36 @@ _create_rapids_cmake_override_json() {
6464
rapids_cmake_upstream="$(yq '.x-git-defaults.upstream' /opt/rapids-build-utils/manifest.yaml)";
6565
fi
6666

67+
# Define CCCL_TAG to override the default CCCL SHA. Otherwise the current HEAD of the local checkout is used.
68+
if test -n "${CCCL_TAG-}"; then
69+
# If CCCL_TAG is defined, fetch it to the local checkout
70+
git fetch origin "${CCCL_TAG}";
71+
cccl_sha="$(git -C "${HOME}/cccl" rev-parse FETCH_HEAD)";
72+
else
73+
cccl_sha="$(git -C "${HOME}/cccl" rev-parse HEAD)";
74+
fi
75+
echo "CCCL_VERSION: ${CCCL_VERSION-}";
76+
echo "CCCL_TAG: ${CCCL_TAG-}";
77+
echo "cccl_sha: ${cccl_sha}";
78+
79+
echo
80+
echo "Replacing CCCL repo information in rapids-cmake versions.json:";
6781
curl -fsSL -o- "https://raw.githubusercontent.com/${rapids_cmake_upstream}/rapids-cmake/${rapids_cmake_tag}/rapids-cmake/cpm/versions.json" \
68-
| jq -r ".packages.CCCL *= {\"git_url\": \"${HOME}/cccl\", \"git_tag\": \"$(git -C "${HOME}/cccl" rev-parse HEAD)\", \"always_download\": true}" \
69-
| tee ~/rapids-cmake-override-versions.json;
82+
| jq -r ".packages.CCCL *= {\"git_url\": \"${HOME}/cccl\", \"git_tag\": \"${cccl_sha}\", \"always_download\": true}" \
83+
> ~/rapids-cmake-override-versions-cccl-repo.json;
84+
85+
if test -n "${CCCL_VERSION-}"; then
86+
echo "Patching CCCL_VERSION in rapids-cmake versions.json:";
87+
jq -r ".packages.CCCL.version = \"${CCCL_VERSION}\"" ~/rapids-cmake-override-versions-cccl-repo.json \
88+
> ~/rapids-cmake-override-versions.json;
89+
else
90+
echo "Using the default CCCL version in rapids-cmake versions.json:";
91+
mv ~/rapids-cmake-override-versions-cccl-repo.json ~/rapids-cmake-override-versions.json;
92+
fi
93+
94+
echo
95+
echo "Final rapids-cmake-override-versions.json:";
96+
cat ~/rapids-cmake-override-versions.json;
7097

7198
# Define default CMake args for each repo
7299
local -a cmake_args=(BUILD_TESTS BUILD_BENCHMARKS BUILD_PRIMS_BENCH BUILD_CUGRAPH_MG_TESTS);

0 commit comments

Comments
 (0)