Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .devcontainer/cuda12.9-conda/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"--rm",
"--name",
"${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-26.12-cuda12.9-conda",
"--env-file",
"${localWorkspaceFolder}/.devcontainer/.env",
"--env-file",
"${localWorkspaceFolder}/.devcontainer/cuda12.9-conda/.env",
"--ulimit",
"nofile=500000"
],
Expand Down Expand Up @@ -51,7 +55,7 @@
"./features/src/utils",
"./features/src/rapids-build-utils"
],
"initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda12.9-envs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt}"],
"initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda12.9-envs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt} && touch .devcontainer{,/cuda12.9-conda}/.env"],
"postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; fi"],
"workspaceFolder": "/home/coder",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/devcontainers,type=bind,consistency=consistent",
Expand Down
6 changes: 5 additions & 1 deletion .devcontainer/cuda12.9-pip/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"--rm",
"--name",
"${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-26.12-cuda12.9-pip",
"--env-file",
"${localWorkspaceFolder}/.devcontainer/.env",
"--env-file",
"${localWorkspaceFolder}/.devcontainer/cuda12.9-pip/.env",
"--ulimit",
"nofile=500000"
],
Expand All @@ -39,7 +43,7 @@
"./features/src/utils",
"./features/src/rapids-build-utils"
],
"initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda12.9-venvs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt}"],
"initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda12.9-venvs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt} && touch .devcontainer{,/cuda12.9-pip}/.env"],
"postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; fi"],
"workspaceFolder": "/home/coder",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/devcontainers,type=bind,consistency=consistent",
Expand Down
6 changes: 5 additions & 1 deletion .devcontainer/cuda13.3-conda/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"--rm",
"--name",
"${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-26.12-cuda13.3-conda",
"--env-file",
"${localWorkspaceFolder}/.devcontainer/.env",
"--env-file",
"${localWorkspaceFolder}/.devcontainer/cuda13.3-conda/.env",
"--ulimit",
"nofile=500000"
],
Expand Down Expand Up @@ -51,7 +55,7 @@
"./features/src/utils",
"./features/src/rapids-build-utils"
],
"initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda13.3-envs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt}"],
"initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda13.3-envs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt} && touch .devcontainer{,/cuda13.3-conda}/.env"],
"postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; fi"],
"workspaceFolder": "/home/coder",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/devcontainers,type=bind,consistency=consistent",
Expand Down
6 changes: 5 additions & 1 deletion .devcontainer/cuda13.3-pip/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"--rm",
"--name",
"${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-26.12-cuda13.3-pip",
"--env-file",
"${localWorkspaceFolder}/.devcontainer/.env",
"--env-file",
"${localWorkspaceFolder}/.devcontainer/cuda13.3-pip/.env",
"--ulimit",
"nofile=500000"
],
Expand All @@ -39,7 +43,7 @@
"./features/src/utils",
"./features/src/rapids-build-utils"
],
"initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda13.3-venvs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt}"],
"initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda13.3-venvs,log/devcontainer-utils} ${localWorkspaceFolder}/../{rmm,dask-cuda,kvikio,ucxx,cudf,rapidsmpf,raft,cuvs,cuml,nvforest,cugraph,cugraph-gnn,nx-cugraph,cuopt} && touch .devcontainer{,/cuda13.3-pip}/.env"],
"postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; fi"],
"workspaceFolder": "/home/coder",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/devcontainers,type=bind,consistency=consistent",
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
/.scratch
/.vscode/server
/features/src/*.[0-9]
/.devcontainer/.env
/.devcontainer/*/.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "NVIDIA RAPIDS devcontainer build utilities",
"id": "rapids-build-utils",
"version": "26.12.3",
"version": "26.12.4",
"description": "A feature to install the RAPIDS devcontainer build utilities",
"containerEnv": {
"BASH_ENV": "/etc/bash.bash_env"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ generate_script() {
if test -n "${bin:+x}"; then
(
cat - \
| envsubst '$HOME $NAME $SRC_PATH $PY_ENV $PY_SRC $PY_LIB $PY_TEST $BIN_DIR $CPP_ENV $CPP_LIB $CPP_SRC $CPP_TEST $CPP_CMAKE_ARGS $CPP_CPACK_ARGS $CPP_DEPS $CPP_MAX_TOTAL_SYSTEM_MEMORY $CPP_MAX_DEVICE_OBJ_MEMORY_USAGE $CPP_MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL $GIT_TAG $GIT_SSH_URL $GIT_HTTPS_URL $GIT_REPO $GIT_HOST $GIT_UPSTREAM $PIP_WHEEL_ARGS $PIP_INSTALL_ARGS' \
| envsubst '$HOME $NAME $SRC_PATH $PY_ENV $PY_SRC $PY_LIB $PY_TEST $BIN_DIR $CPP_ENV $CPP_LIB $CPP_SRC $CPP_TEST $CPP_CMAKE_ARGS $CPP_CPACK_ARGS $CPP_DEPS $CPP_MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL $GIT_TAG $GIT_SSH_URL $GIT_HTTPS_URL $GIT_REPO $GIT_HOST $GIT_UPSTREAM $PIP_WHEEL_ARGS $PIP_INSTALL_ARGS' \
| tee "${TMP_SCRIPT_DIR}/${bin}" >/dev/null;

chmod +x "${TMP_SCRIPT_DIR}/${bin}";
Expand Down Expand Up @@ -221,8 +221,6 @@ generate_scripts() {
local cpp_cmake_args;
local cpp_cpack_args;
local cpp_depends_length;
local cpp_max_total_system_memory;
local cpp_max_device_obj_memory_usage;
local cpp_max_device_obj_to_compile_in_parallel;

local py_env;
Expand Down Expand Up @@ -292,8 +290,6 @@ generate_scripts() {
cpp_cmake_args="${repo}_cpp_${j}_args_cmake";
cpp_cpack_args="${repo}_cpp_${j}_args_cpack";
cpp_depends_length="${repo}_cpp_${j}_depends_length";
cpp_max_total_system_memory="${repo}_cpp_${j}_parallelism_max_total_system_memory";
cpp_max_device_obj_memory_usage="${repo}_cpp_${j}_parallelism_max_device_obj_memory_usage";
cpp_max_device_obj_to_compile_in_parallel="${repo}_cpp_${j}_parallelism_max_device_obj_to_compile_in_parallel";
cpp_path=~/"${!repo_path:-}${!cpp_sub_dir:+/${!cpp_sub_dir}}";

Expand Down Expand Up @@ -334,8 +330,6 @@ generate_scripts() {
CPP_DEPS="${cpp_deps[*]}" \
CPP_CMAKE_ARGS="${!cpp_cmake_args:-}" \
CPP_CPACK_ARGS="${!cpp_cpack_args:-}" \
CPP_MAX_TOTAL_SYSTEM_MEMORY="${!cpp_max_total_system_memory:-}" \
CPP_MAX_DEVICE_OBJ_MEMORY_USAGE="${!cpp_max_device_obj_memory_usage:-}" \
CPP_MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL="${!cpp_max_device_obj_to_compile_in_parallel:-}" \
generate_cpp_scripts ;
NAME="${repo_name:-}" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ make_conda_env() {
# ninja -j$(ulimit -n) fails with `ninja: FATAL: pipe: Too many open files`.
# This appears to have been fixed 13 years ago (https://github.com/ninja-build/ninja/issues/233),
# so that fix needs to be integrated into the kitware pip ninja builds.
rapids-make-conda-dependencies --exclude <(echo ninja) "${OPTS[@]}" > "${new_env_path}";
local -a excluded_packages="(ninja ${RAPIDS_BUILD_UTILS_EXCLUDED_CONDA_PACKAGES:-})";

rapids-make-conda-dependencies \
--exclude <(printf '%s\n' "${excluded_packages[@]}") \
"${OPTS[@]}" \
> "${new_env_path}";

if test -f "${new_env_path}" && test "$(wc -l "${new_env_path}" | cut -d' ' -f1)" -gt 0; then

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ make_pip_env() {
local -r new_env_path="$(realpath -m "/tmp/${env_file_name}")";
local -r old_env_path="$(realpath -m "${HOME}/.local/share/venvs/${env_file_name}")";

local -a excluded_packages=(ninja);
# Create the python env without ninja.
# ninja -$(ulimit -n) fails with `ninja: FATAL: pipe: Too many open files`.
# This appears to have been fixed 13 years ago (https://github.com/ninja-build/ninja/issues/233),
# so that fix needs to be integrated into the kitware pip ninja builds.
local -a excluded_packages="(ninja ${RAPIDS_BUILD_UTILS_EXCLUDED_PIP_PACKAGES:-})";

# The PyPI OpenMPI wheel bundles its own UCX libraries. Do not install it when the
# devcontainer is configured to use system UCX, because loading those bundled
Expand All @@ -53,10 +57,6 @@ make_pip_env() {
excluded_packages+=(openmpi);
fi

# Create the python env without ninja.
# ninja -$(ulimit -n) fails with `ninja: FATAL: pipe: Too many open files`.
# This appears to have been fixed 13 years ago (https://github.com/ninja-build/ninja/issues/233),
# so that fix needs to be integrated into the kitware pip ninja builds.
rapids-make-pip-dependencies \
--exclude <(printf '%s\n' "${excluded_packages[@]}") \
"${OPTS[@]}" \
Expand Down Expand Up @@ -96,12 +96,12 @@ make_pip_env() {
python -m pip install "${pre[@]}" -U -r "${new_env_path}";
fi

cp -a "${new_env_path}" "${old_env_path}";

# Keep excluded packages out of reused venvs as well as newly-created ones.
# shellcheck disable=SC1090
. "${HOME}/.local/share/venvs/${env_name}/bin/activate";
python -m pip uninstall -y "${excluded_packages[@]}" >/dev/null 2>&1;

cp -a "${new_env_path}" "${old_env_path}";
python -m pip uninstall -y "${excluded_packages[@]}" >/dev/null 2>&1 || :
fi
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ build_${CPP_LIB}_cpp() {

eval "$(\
PARALLEL_LEVEL=${PARALLEL_LEVEL:-$(nproc --all)} \
MAX_TOTAL_SYSTEM_MEMORY="${MAX_TOTAL_SYSTEM_MEMORY:-${CPP_MAX_TOTAL_SYSTEM_MEMORY}}" \
MAX_DEVICE_OBJ_MEMORY_USAGE="${MAX_DEVICE_OBJ_MEMORY_USAGE:-${CPP_MAX_DEVICE_OBJ_MEMORY_USAGE}}" \
MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL="${MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL:-${CPP_MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL}}" \
rapids-get-num-archs-jobs-and-load "$@" \
2>/dev/null \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ configure_${CPP_LIB}_cpp() {

eval "$(\
PARALLEL_LEVEL=${PARALLEL_LEVEL:-$(nproc --all)} \
MAX_TOTAL_SYSTEM_MEMORY="${MAX_TOTAL_SYSTEM_MEMORY:-${CPP_MAX_TOTAL_SYSTEM_MEMORY}}" \
MAX_DEVICE_OBJ_MEMORY_USAGE="${MAX_DEVICE_OBJ_MEMORY_USAGE:-${CPP_MAX_DEVICE_OBJ_MEMORY_USAGE}}" \
MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL="${MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL:-${CPP_MAX_DEVICE_OBJ_TO_COMPILE_IN_PARALLEL}}" \
rapids-get-num-archs-jobs-and-load "$@" \
2>/dev/null \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ repos:
- name: raft
sub_dir: cpp
depends: [rmm]
parallelism:
max_device_obj_memory_usage: 3Gi
args: {cmake: -DRAFT_COMPILE_LIBRARY=ON}
test: ci/run_ctests.sh
python:
Expand All @@ -181,8 +179,6 @@ repos:
- name: cuvs
sub_dir: cpp
depends: [kvikio, rmm, raft]
parallelism:
max_device_obj_memory_usage: 3Gi
args: {cmake: -DBUILD_C_LIBRARY=ON}
test: ci/run_ctests.sh
env: |
Expand All @@ -207,8 +203,6 @@ repos:
- name: nvforest
sub_dir: cpp
depends: [rmm, raft]
parallelism:
max_device_obj_memory_usage: 3Gi
test: ci/run_ctests.sh
python:
- name: libnvforest
Expand All @@ -227,8 +221,6 @@ repos:
- name: cuml
sub_dir: cpp
depends: [rmm, raft, cuvs, nvforest]
parallelism:
max_device_obj_memory_usage: 3Gi
test: ci/run_ctests.sh
python:
- name: libcuml
Expand Down
2 changes: 1 addition & 1 deletion features/src/utils/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "devcontainer-utils",
"id": "utils",
"version": "26.12.0",
"version": "26.12.1",
"description": "A feature to install RAPIDS devcontainer utility scripts",
"containerEnv": {
"BASH_ENV": "/etc/bash.bash_env"
Expand Down
1 change: 1 addition & 0 deletions features/src/utils/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ declare -a commands_and_sources=(
"configure-sccache-dist sccache/dist/configure.sh"
"sccache-dist-status sccache/dist/status.sh"
"list-active-sccache-dist-compiles sccache/dist/list-active-compiles.sh"
"print-sccache-dist-compile-times sccache/dist/print-compile-times.sh"
)

# Install alternatives
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _creds_github_generate() {
--role-arn "${AWS_ROLE_ARN}"
--aud "${AWS_AUDIENCE:-sts.amazonaws.com}"
--duration "${AWS_S3_TTL:-${VAULT_S3_TTL:-43200}}"
--idp-url "${AWS_IDP_URL:-https://token.gha-runners.nvidia.com}"
--idp-url "${AWS_IDP_URL:-https://token.rapids.nvidia.com}"
);

mkdir -p ~/.aws;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash

# Usage:
# devcontainer-utils-print-sccache-dist-compile-times [OPTION]...
#
# Print all active sccache-dist compilations
#
# Boolean options:
# -h,--help Print this text.
#
# Options that require values:
# -p,--port <port> Read the logfile for the sccache client running on <port>.
# (default: ${SCCACHE_SERVER_PORT:-4226})
#

_print_sccache_dist_compile_times() {
local -;
set -euo pipefail;

eval "$(devcontainer-utils-parse-args "$0" "$@" <&0)";

# shellcheck disable=SC1091
. devcontainer-utils-debug-output 'devcontainer_utils_debug' 'sccache print-sccache-dist-compile-times';

if ! pgrep sccache >/dev/null 2>&1; then
return 0;
fi

local sccache_port="${p:-${port:-${SCCACHE_SERVER_PORT:-4226}}}";
local logfile="${SCCACHE_ERROR_LOG:-/tmp/sccache.log}";

logfile="$(dirname "$logfile")/$(basename -s .log "$logfile").${sccache_port}.log";

join -1 3 -2 2 \
<(grep 'Running job' "$logfile" |
cut -d' ' -f1,4,5 |
tr -d '[],' |
sed -r 's/^(.*):$/\1/' |
sort -k3) \
<(grep 'Fetched' "$logfile" |
cut -d' ' -f1,5 | tr -d '[],' |
sort -k2) |
awk '{
gsub(/[-TZ:]/, " ", $2);
gsub(/[-TZ:]/, " ", $4);
print $3, (mktime($4) - mktime($2)) "s"
}'
}

_print_sccache_dist_compile_times "$@" <&0;
Loading