diff --git a/features/src/rapids-build-utils/devcontainer-feature.json b/features/src/rapids-build-utils/devcontainer-feature.json index 4cd36df6..22d41e85 100644 --- a/features/src/rapids-build-utils/devcontainer-feature.json +++ b/features/src/rapids-build-utils/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "NVIDIA RAPIDS devcontainer build utilities", "id": "rapids-build-utils", - "version": "24.6.9", + "version": "24.6.10", "description": "A feature to install the RAPIDS devcontainer build utilities", "containerEnv": { "BASH_ENV": "/etc/bash.bash_env" diff --git a/features/src/rapids-build-utils/install.sh b/features/src/rapids-build-utils/install.sh index 20c5cb80..418edd85 100644 --- a/features/src/rapids-build-utils/install.sh +++ b/features/src/rapids-build-utils/install.sh @@ -7,7 +7,15 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; # install global/common scripts . ./common/install.sh; -check_packages bc jq pigz sudo wget gettext-base bash-completion ca-certificates; +PKGS=(bc jq pigz sudo wget gettext-base bash-completion ca-certificates); + +if ! type /usr/bin/python3 >/dev/null 2>&1; then + PKGS+=(python3 python3-pip); +elif ! /usr/bin/python3 -m pip >/dev/null 2>&1; then + PKGS+=(python3-pip); +fi + +check_packages "${PKGS[@]}"; # Install yq if not installed if ! type yq >/dev/null 2>&1; then @@ -30,9 +38,8 @@ if [[ ! "23.04" > "${DISTRIB_RELEASE}" ]]; then fi # Install the rapids dependency file generator and conda-merge -if type python >/dev/null 2>&1; then - python -m pip install $BREAK_PACKAGES rapids-dependency-file-generator conda-merge toml; -fi +/usr/bin/python3 -m pip install $BREAK_PACKAGES -U pip; +/usr/bin/python3 -m pip install $BREAK_PACKAGES rapids-dependency-file-generator conda-merge toml; # Install RAPIDS build utility scripts to /opt/ diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/python-uses-scikit-build-core.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/python-uses-scikit-build-core.sh index ea699b0f..053ca789 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/python-uses-scikit-build-core.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/python-uses-scikit-build-core.sh @@ -3,4 +3,4 @@ set -e; test -f "${1}/pyproject.toml"; -test "scikit_build_core.build" = "$(/usr/local/python/current/bin/python -c "import toml; print(toml.load('${1}/pyproject.toml')['build-system']['build-backend'])" 2>/dev/null)"; +test "scikit_build_core.build" = "$(/usr/bin/python3 -c "import toml; print(toml.load('${1}/pyproject.toml')['build-system']['build-backend'])" 2>/dev/null)"; diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/python-uses-scikit-build.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/python-uses-scikit-build.sh index 28caf80d..8fe18124 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/python-uses-scikit-build.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/python-uses-scikit-build.sh @@ -3,4 +3,4 @@ set -e; test -f "${1}/pyproject.toml"; -test "True" = "$(/usr/local/python/current/bin/python -c "import toml; print(any('scikit-build-core' not in x and 'scikit-build' in x for x in toml.load('${1}/pyproject.toml')['build-system']['requires']))" 2>/dev/null)"; +test "True" = "$(/usr/bin/python3 -c "import toml; print(any('scikit-build-core' not in x and 'scikit-build' in x for x in toml.load('${1}/pyproject.toml')['build-system']['requires']))" 2>/dev/null)"; diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.build.wheel.tmpl.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.build.wheel.tmpl.sh index 3d10986f..bcdc393b 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.build.wheel.tmpl.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.build.wheel.tmpl.sh @@ -7,6 +7,9 @@ # # @_include_value_options rapids-get-num-archs-jobs-and-load -h; # @_include_cmake_options; +# CMake Install Options: +# --strip Strip before installing. +# # @_include_pip_wheel_options; # @_include_pip_package_index_options; # @_include_pip_general_options; @@ -85,15 +88,22 @@ build_${PY_LIB}_python_wheel() { export ${PY_ENV} PATH="$PATH"; local cudaflags="${CUDAFLAGS:+$CUDAFLAGS }-t=${n_arch}"; + local build_type="$(rapids-select-cmake-build-type "${cmake_args_[@]}")"; local nvcc_append_flags="${NVCC_APPEND_FLAGS:+$NVCC_APPEND_FLAGS }-t=${n_arch}"; - CUDAFLAGS="${cudaflags}" \ - CMAKE_GENERATOR="${G:-Ninja}" \ - PARALLEL_LEVEL="${n_jobs}" \ - CMAKE_ARGS="${cmake_args[*]}" \ - SKBUILD_BUILD_OPTIONS="${ninja_args[*]}" \ - NVCC_APPEND_FLAGS="${nvcc_append_flags}" \ - python -m pip wheel "${pip_args[@]}" \ + CUDAFLAGS="${cudaflags}" \ + CMAKE_GENERATOR="${G:-Ninja}" \ + PARALLEL_LEVEL="${n_jobs}" \ + CMAKE_ARGS="${cmake_args[*]}" \ + SKBUILD_BUILD_OPTIONS="${ninja_args[*]}" \ + SKBUILD_BUILD_TOOL_ARGS="${ninja_args[*]}" \ + SKBUILD_LOGGING_LEVEL="${v:+INFO}" \ + SKBUILD_INSTALL_STRIP="${strip:+True}" \ + SKBUILD_CMAKE_VERBOSE="${v:+True}" \ + SKBUILD_CMAKE_BUILD_TYPE="${build_type}" \ + CMAKE_BUILD_PARALLEL_LEVEL="${n_jobs}" \ + NVCC_APPEND_FLAGS="${nvcc_append_flags}" \ + python -m pip wheel "${pip_args[@]}" \ ; { set +x; } 2>/dev/null; echo -n "${PY_LIB} wheel build time:"; ) 2>&1; diff --git a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.install.tmpl.sh b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.install.tmpl.sh index 175b8c9b..fec19e98 100755 --- a/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.install.tmpl.sh +++ b/features/src/rapids-build-utils/opt/rapids-build-utils/bin/tmpl/python.install.tmpl.sh @@ -7,6 +7,9 @@ # # @_include_value_options rapids-get-num-archs-jobs-and-load -h; # @_include_cmake_options; +# CMake Install Options: +# --strip Strip before installing. +# # @_include_pip_install_options; # @_include_pip_package_index_options; # @_include_pip_general_options; @@ -103,6 +106,7 @@ install_${PY_LIB}_python() { export ${PY_ENV} PATH="$PATH"; local cudaflags="${CUDAFLAGS:+$CUDAFLAGS }-t=${n_arch}"; + local build_type="$(rapids-select-cmake-build-type "${cmake_args_[@]}")"; local nvcc_append_flags="${NVCC_APPEND_FLAGS:+$NVCC_APPEND_FLAGS }-t=${n_arch}"; CUDAFLAGS="${cudaflags}" \ @@ -110,6 +114,12 @@ install_${PY_LIB}_python() { PARALLEL_LEVEL="${n_jobs}" \ CMAKE_ARGS="${cmake_args[*]}" \ SKBUILD_BUILD_OPTIONS="${ninja_args[*]}" \ + SKBUILD_BUILD_TOOL_ARGS="${ninja_args[*]}" \ + SKBUILD_LOGGING_LEVEL="${v:+INFO}" \ + SKBUILD_INSTALL_STRIP="${strip:+True}" \ + SKBUILD_CMAKE_VERBOSE="${v:+True}" \ + SKBUILD_CMAKE_BUILD_TYPE="${build_type}" \ + CMAKE_BUILD_PARALLEL_LEVEL="${n_jobs}" \ NVCC_APPEND_FLAGS="${nvcc_append_flags}" \ python -m pip install "${pip_args[@]}" \ ; diff --git a/features/src/utils/devcontainer-feature.json b/features/src/utils/devcontainer-feature.json index 0e5ec699..0f14b234 100644 --- a/features/src/utils/devcontainer-feature.json +++ b/features/src/utils/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "devcontainer-utils", "id": "utils", - "version": "24.6.0", + "version": "24.6.1", "description": "A feature to install RAPIDS devcontainer utility scripts", "containerEnv": { "BASH_ENV": "/etc/bash.bash_env" diff --git a/features/src/utils/install.sh b/features/src/utils/install.sh index e8b4699e..36c9a062 100644 --- a/features/src/utils/install.sh +++ b/features/src/utils/install.sh @@ -7,18 +7,27 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; # install global/common scripts . ./common/install.sh; -check_packages \ - jq \ - cron \ - curl \ - sudo \ - wget \ - socat \ - tzdata \ - gettext-base \ - openssh-client \ - bash-completion \ - ca-certificates ; +PKGS=( + jq + cron + curl + sudo + wget + socat + tzdata + gettext-base + openssh-client + bash-completion + ca-certificates +); + +if ! type /usr/bin/python3 >/dev/null 2>&1; then + PKGS+=(python3 python3-pip); +elif ! /usr/bin/python3 -m pip >/dev/null 2>&1; then + PKGS+=(python3-pip); +fi + +check_packages "${PKGS[@]}"; source /etc/lsb-release; @@ -27,9 +36,7 @@ if [[ ! "23.04" > "${DISTRIB_RELEASE}" ]]; then fi # upgrade pip -if type python >/dev/null 2>&1; then - python -m pip install $BREAK_PACKAGES -U pip; -fi +/usr/bin/python3 -m pip install $BREAK_PACKAGES -U pip; # Install yq if not installed if ! type yq >/dev/null 2>&1; then