Skip to content

Commit 07a0b27

Browse files
authored
restart sccache to apply new configuration (#658)
1 parent 6ff72a5 commit 07a0b27

1 file changed

Lines changed: 54 additions & 14 deletions

File tree

.github/workflows/test-rapids-build-times.yml

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
SCCACHE_DIST_MAX_RETRIES=inf
7070
SCCACHE_DIST_FALLBACK_TO_LOCAL_COMPILE=false
7171
SCCACHE_DIST_AUTH_TOKEN_VAR=RAPIDS_AUX_SECRET_1
72+
TIME=real:\t%E
7273
${{ matrix.env }}
7374
build_command: |
7475
function begin_group() {
@@ -99,24 +100,54 @@ jobs:
99100
begin_group "$group";
100101
101102
echo "Working directory: $(pwd)";
102-
echo "Running command: ${command[*]}";
103+
echo "Running command: ${command[*]@Q}";
103104
"${command[@]}" || exit_code=$?;
104105
105106
end_group "$group" "$exit_code"
106107
107108
return "$exit_code"
108109
}
109110
111+
# convert ucx branch names
112+
convert_ucx_branch() {
113+
local -;
114+
set -euo pipefail;
115+
116+
local repo="$1"
117+
local custom_branch="$2"
118+
local normalized_branch="${custom_branch}"
119+
120+
if [[ "${repo}" == "ucx"* ]]; then
121+
# Only convert branches that match the pattern release/YY.MM
122+
if [[ "${custom_branch}" =~ ^release/[0-9]{2}\.[0-9]{2}$ ]]; then
123+
RAPIDS_VERSION=$(echo "${custom_branch}" | awk '{split($0, a, "/"); print a[2]}')
124+
# Get UCX version associated w/ RAPIDS version
125+
UCX_VERSION="$(curl -sL https://version.gpuci.io/rapids/${RAPIDS_VERSION})"
126+
normalized_branch="release/${UCX_VERSION}"
127+
fi
128+
fi
129+
130+
echo "${normalized_branch}"
131+
}
132+
110133
# Clone all the repos
111-
run_command "Clone RAPIDS repositories" \
112-
clone-all -j$(nproc) -b ${{ inputs.branch }} -v -q --clone-upstream --depth 1 --single-branch --shallow-submodules --no-update-env;
134+
time run_command "Clone RAPIDS repositories" bash -c "\
135+
RAPIDS_TO_UCXX_BRANCH=\"$(convert_ucx_branch ucxx '${{ inputs.branch }}')\";
136+
CLONE_ARGS=(-j$(nproc) -q -v --clone-upstream --depth 1 --single-branch --shallow-submodules --no-update-env);
137+
clone-all -b \"${{ inputs.branch }}\" \${CLONE_ARGS[*]} >/dev/null 2>&1;
138+
clone-ucxx -b \"\$RAPIDS_TO_UCXX_BRANCH\" \${CLONE_ARGS[*]} >/dev/null 2>&1;
139+
" 2>&1
140+
141+
sleep 1
142+
143+
time run_command "Create RAPIDS python environment" bash -c "\
144+
rapids-post-start-command >/dev/null" 2>&1
113145
114-
run_command "Create RAPIDS python environment" \
115-
rapids-post-start-command;
146+
sleep 1
116147
117148
# Configure all the C++ libs
118-
run_command "Configure C++ libraries" bash -c "\
119-
time configure-all \
149+
time run_command "Configure C++ libraries" bash -c "\
150+
configure-all \
120151
-j${PARALLEL_LEVEL} \
121152
-GNinja \
122153
-Wno-dev \
@@ -125,15 +156,24 @@ jobs:
125156
-DBUILD_PRIMS_BENCH=ON \
126157
-DBUILD_SHARED_LIBS=ON \
127158
-DRAFT_COMPILE_LIBRARY=ON \
128-
-DBUILD_CUGRAPH_MG_TESTS=ON"
159+
-DBUILD_CUGRAPH_MG_TESTS=ON \
160+
>/dev/null" 2>&1
161+
162+
sleep 1
129163
130164
for ENVVAR in "SCCACHE_RECACHE=1" \
131165
"SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE=0" \
132166
"SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE=1" ; do
133167
168+
# Restart sccache
169+
run_command "Start sccache (${ENVVAR})" bash -c "\
170+
${ENVVAR} devcontainer-utils-start-sccache --kill-all >/dev/null 2>&1"
171+
134172
# Build all the C++ libs
135-
run_command "Build C++ libraries (${ENVVAR})" bash -c "
136-
time ${ENVVAR} build-all-cpp -j${PARALLEL_LEVEL}"
173+
time run_command "Build C++ libraries (${ENVVAR})" bash -c "\
174+
${ENVVAR} build-all-cpp -j${PARALLEL_LEVEL} >/dev/null" 2>&1
175+
176+
sleep 1
137177
138178
# Print cache and dist stats
139179
run_command "sccache stats (${ENVVAR})" \
@@ -142,10 +182,10 @@ jobs:
142182
# Print build times
143183
run_command "Build times (${ENVVAR})" bash -c "\
144184
find /var/log/devcontainer-utils/ -type f -name 'build-*-time.log' -print0 \
145-
| xargs -0 -n1 grep -H real | sed 's/real\t/ /g' || :" # Nonfatal if not found
185+
| xargs -0 -n1 grep -H real | sed 's/real\t/ /g' || : # Nonfatal if not found"
146186
147187
# Clean
148-
sccache -z >/dev/null 2>&1
149-
find /var/log/devcontainer-utils/ -type f -name 'build-*-time.log' -delete
150-
find ~/ -maxdepth 4 -type l -path '*/cpp/build/latest' -print0 | xargs -P$(nproc) -0 -n1 ninja clean -C
188+
run_command "Clean (${ENVVAR})" bash -c "\
189+
find /var/log/devcontainer-utils/ -type f -name 'build-*-time.log' -delete >/dev/null 2>&1 || : # Nonfatal if not found
190+
find ~/ -maxdepth 4 -type l -path '*/cpp/build/latest' -print0 | xargs -P$(nproc) -0 -n1 ninja clean -C >/dev/null 2>&1 || : # Nonfatal if not found"
151191
done

0 commit comments

Comments
 (0)