Skip to content

Commit 2b681e1

Browse files
committed
fix utils scenario tests
1 parent 0c45b28 commit 2b681e1

File tree

6 files changed

+32
-30
lines changed

6 files changed

+32
-30
lines changed

.github/workflows/build-all-rapids-repos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
done
6363
6464
# Install the latest sccache client
65-
devcontainer-utils-install-sccache --repo trxcllnt/sccache --version latest;
65+
devcontainer-utils-install-sccache --repo trxcllnt/sccache;
6666
6767
# Configure the sccache client to talk to the build cluster
6868
devcontainer-utils-init-sccache-dist \

features/src/rapids-build-utils/opt/rapids-build-utils/bin/get-num-archs-jobs-and-load.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ get_num_archs_jobs_and_load() {
2727
# shellcheck disable=SC1091
2828
. devcontainer-utils-debug-output 'rapids_build_utils_debug' 'get-num-archs-jobs-and-load';
2929

30-
# nproc --all returns 2x the number of physical cores in Ubuntu24.04+,
30+
# nproc --all returns 2x the number of threads in Ubuntu24.04+,
3131
# so instead we cound the number of processors in /proc/cpuinfo
3232
local -r n_cpus="$(grep -cP 'processor\s+:' /proc/cpuinfo)";
3333

features/src/utils/opt/devcontainer/bin/post-attach-command.sh

+12-16
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,27 @@ if ! test -n "${SKIP_DEVCONTAINER_UTILS_POST_ATTACH_COMMAND:+x}"; then
44
# shellcheck disable=SC1091
55
. devcontainer-utils-init-git-interactive;
66

7+
# Reset sccache-dist configuration
8+
devcontainer-utils-init-sccache-dist;
9+
10+
# Initialize the GitHub CLI with the appropriate user scopes
11+
# shellcheck disable=SC1091
12+
. devcontainer-utils-creds-s3-init;
13+
714
# Update sccache client configuration to enable/disable sccache-dist
815
if test -n "${DEVCONTAINER_UTILS_ENABLE_SCCACHE_DIST:+x}"; then
916
if test -n "${SCCACHE_DIST_TOKEN:+x}"; then
10-
devcontainer-utils-install-sccache --repo trxcllnt/sccache --version latest;
17+
devcontainer-utils-install-sccache --repo trxcllnt/sccache;
1118
# Update ~/.config/sccache/config to use $SCCACHE_DIST_TOKEN
1219
devcontainer-utils-init-sccache-dist \
1320
--enable-sccache-dist - <<< " \
1421
--auth-type 'token' \
1522
--auth-token '${SCCACHE_DIST_TOKEN}' \
1623
";
17-
else
18-
# Initialize the GitHub CLI with the appropriate user scopes
19-
# shellcheck disable=SC1091
20-
. devcontainer-utils-init-github-cli;
21-
if gh auth status >/dev/null 2>&1; then
22-
devcontainer-utils-install-sccache --repo trxcllnt/sccache --version latest;
23-
# Update ~/.config/sccache/config to use gh token auth
24-
devcontainer-utils-init-sccache-dist --enable-with-github-auth;
25-
fi
24+
elif gh auth status >/dev/null 2>&1; then
25+
devcontainer-utils-install-sccache --repo trxcllnt/sccache;
26+
# Update ~/.config/sccache/config to use gh token auth
27+
devcontainer-utils-init-sccache-dist --enable-with-github-auth;
2628
fi
27-
else
28-
# Delete sccache-dist configuration from ~/.config/sccache/config
29-
devcontainer-utils-init-sccache-dist;
3029
fi
31-
32-
# shellcheck disable=SC1091
33-
. devcontainer-utils-creds-s3-init;
3430
fi

features/test/utils/ubuntu18.04.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,20 @@ reset_state() {
5050
unset AWS_SESSION_TOKEN;
5151
unset AWS_SECRET_ACCESS_KEY;
5252

53+
while pgrep sccache >/dev/null 2>&1; do
54+
devcontainer-utils-stop-sccache --kill-all;
55+
done
56+
5357
rm -rf ~/.aws/ ~/.config/gh/ ~/.config/sccache/config;
5458
cp /tmp/.bashrc-clean ~/.bashrc;
5559
sudo cp /usr/bin/sccache{.orig,};
5660
echo "#! /usr/bin/env bash" | sudo tee "${utils_profile_script}" >/dev/null;
5761
sudo chmod +x "${utils_profile_script}";
5862
. ~/.bashrc;
59-
60-
devcontainer-utils-stop-sccache --kill-all;
6163
}
6264

6365
write_bad_creds() {
64-
devcontainer-utils-vault-s3-creds-persist <<< "
66+
devcontainer-utils-creds-s3-persist <<< "
6567
--stamp='$(date '+%s')'
6668
--bucket='${rw_sccache_bucket:-}'
6769
--region='${rw_sccache_region:-}'
@@ -84,7 +86,7 @@ expect_local_disk_cache_is_used() {
8486
}
8587

8688
expect_sccache_dist_auth_token_is_gh_token() {
87-
set -ex;
89+
set -e;
8890
test -f ~/.config/sccache/config;
8991
grep -qE "[dist.auth]" ~/.config/sccache/config;
9092
grep -qE "type = \"token\"" ~/.config/sccache/config;

features/test/utils/ubuntu20.04.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,20 @@ reset_state() {
5050
unset AWS_SESSION_TOKEN;
5151
unset AWS_SECRET_ACCESS_KEY;
5252

53+
while pgrep sccache >/dev/null 2>&1; do
54+
devcontainer-utils-stop-sccache --kill-all;
55+
done
56+
5357
rm -rf ~/.aws/ ~/.config/gh/ ~/.config/sccache/config;
5458
cp /tmp/.bashrc-clean ~/.bashrc;
5559
sudo cp /usr/bin/sccache{.orig,};
5660
echo "#! /usr/bin/env bash" | sudo tee "${utils_profile_script}" >/dev/null;
5761
sudo chmod +x "${utils_profile_script}";
5862
. ~/.bashrc;
59-
60-
devcontainer-utils-stop-sccache --kill-all;
6163
}
6264

6365
write_bad_creds() {
64-
devcontainer-utils-vault-s3-creds-persist <<< "
66+
devcontainer-utils-creds-s3-persist <<< "
6567
--stamp='$(date '+%s')'
6668
--bucket='${rw_sccache_bucket:-}'
6769
--region='${rw_sccache_region:-}'
@@ -84,7 +86,7 @@ expect_local_disk_cache_is_used() {
8486
}
8587

8688
expect_sccache_dist_auth_token_is_gh_token() {
87-
set -ex;
89+
set -e;
8890
test -f ~/.config/sccache/config;
8991
grep -qE "[dist.auth]" ~/.config/sccache/config;
9092
grep -qE "type = \"token\"" ~/.config/sccache/config;

features/test/utils/ubuntu22.04.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,20 @@ reset_state() {
5050
unset AWS_SESSION_TOKEN;
5151
unset AWS_SECRET_ACCESS_KEY;
5252

53+
while pgrep sccache >/dev/null 2>&1; do
54+
devcontainer-utils-stop-sccache --kill-all;
55+
done
56+
5357
rm -rf ~/.aws/ ~/.config/gh/ ~/.config/sccache/config;
5458
cp /tmp/.bashrc-clean ~/.bashrc;
5559
sudo cp /usr/bin/sccache{.orig,};
5660
echo "#! /usr/bin/env bash" | sudo tee "${utils_profile_script}" >/dev/null;
5761
sudo chmod +x "${utils_profile_script}";
5862
. ~/.bashrc;
59-
60-
devcontainer-utils-stop-sccache --kill-all;
6163
}
6264

6365
write_bad_creds() {
64-
devcontainer-utils-vault-s3-creds-persist <<< "
66+
devcontainer-utils-creds-s3-persist <<< "
6567
--stamp='$(date '+%s')'
6668
--bucket='${rw_sccache_bucket:-}'
6769
--region='${rw_sccache_region:-}'
@@ -84,7 +86,7 @@ expect_local_disk_cache_is_used() {
8486
}
8587

8688
expect_sccache_dist_auth_token_is_gh_token() {
87-
set -ex;
89+
set -e;
8890
test -f ~/.config/sccache/config;
8991
grep -qE "[dist.auth]" ~/.config/sccache/config;
9092
grep -qE "type = \"token\"" ~/.config/sccache/config;

0 commit comments

Comments
 (0)