Skip to content

Commit

Permalink
Allow RAPIDS workflows to run on arbitrary tags/version. (#3945)
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper authored Feb 26, 2025
1 parent 00b545b commit 9f238da
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build-rapids.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
name: Build all RAPIDS repositories

on:
workflow_dispatch:
workflow_call:
inputs:
override_cccl_tag:
description: "If set, override the tag used for the CCCL repository."
required: false
default: ""
type: string
override_cccl_version:
description: "If set, override the version used by rapids-cmake to patch CCCL."
required: false
default: ""
type: string
enable_slack_alerts:
description: "If true, a message will be posted to the CCCL GHA CI Alert channel if the workflow fails."
required: false
Expand Down Expand Up @@ -57,6 +68,8 @@ jobs:
role-duration-seconds: 43200 # 12h
- name: Run command # Do not change this step's name, it is checked in parse-job-times.py
env:
CCCL_TAG: ${{ inputs.override_cccl_tag }}
CCCL_VERSION: ${{ inputs.override_cccl_version }}
CI: true
RAPIDS_LIBS: ${{ matrix.libs }}
# Uncomment any of these to customize the git repo and branch for a RAPIDS lib:
Expand Down Expand Up @@ -146,6 +159,8 @@ jobs:
--docker \
--cuda ${{matrix.cuda}} \
--host rapids-conda \
--env "CCCL_TAG=${CCCL_TAG}" \
--env "CCCL_VERSION=${CCCL_VERSION}" \
--env "AWS_ROLE_ARN=" \
--env "AWS_REGION=$AWS_REGION" \
--env "SCCACHE_REGION=$AWS_REGION" \
Expand Down
31 changes: 29 additions & 2 deletions ci/rapids/post-create-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,36 @@ _create_rapids_cmake_override_json() {
rapids_cmake_upstream="$(yq '.x-git-defaults.upstream' /opt/rapids-build-utils/manifest.yaml)";
fi

# Define CCCL_TAG to override the default CCCL SHA. Otherwise the current HEAD of the local checkout is used.
if test -n "${CCCL_TAG-}"; then
# If CCCL_TAG is defined, fetch it to the local checkout
git fetch origin "${CCCL_TAG}";
cccl_sha="$(git -C "${HOME}/cccl" rev-parse FETCH_HEAD)";
else
cccl_sha="$(git -C "${HOME}/cccl" rev-parse HEAD)";
fi
echo "CCCL_VERSION: ${CCCL_VERSION-}";
echo "CCCL_TAG: ${CCCL_TAG-}";
echo "cccl_sha: ${cccl_sha}";

echo
echo "Replacing CCCL repo information in rapids-cmake versions.json:";
curl -fsSL -o- "https://raw.githubusercontent.com/${rapids_cmake_upstream}/rapids-cmake/${rapids_cmake_tag}/rapids-cmake/cpm/versions.json" \
| jq -r ".packages.CCCL *= {\"git_url\": \"${HOME}/cccl\", \"git_tag\": \"$(git -C "${HOME}/cccl" rev-parse HEAD)\", \"always_download\": true}" \
| tee ~/rapids-cmake-override-versions.json;
| jq -r ".packages.CCCL *= {\"git_url\": \"${HOME}/cccl\", \"git_tag\": \"${cccl_sha}\", \"always_download\": true}" \
> ~/rapids-cmake-override-versions-cccl-repo.json;

if test -n "${CCCL_VERSION-}"; then
echo "Patching CCCL_VERSION in rapids-cmake versions.json:";
jq -r ".packages.CCCL.version = \"${CCCL_VERSION}\"" ~/rapids-cmake-override-versions-cccl-repo.json \
> ~/rapids-cmake-override-versions.json;
else
echo "Using the default CCCL version in rapids-cmake versions.json:";
mv ~/rapids-cmake-override-versions-cccl-repo.json ~/rapids-cmake-override-versions.json;
fi

echo
echo "Final rapids-cmake-override-versions.json:";
cat ~/rapids-cmake-override-versions.json;

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

0 comments on commit 9f238da

Please sign in to comment.