From 86d32347b33cbfee6652c72283c27056ec5c4b9c Mon Sep 17 00:00:00 2001 From: Jordan Jacobelli Date: Fri, 17 Jun 2022 09:08:02 +0200 Subject: [PATCH] Fix sccache Signed-off-by: Jordan Jacobelli --- ci/cpu/build.sh | 5 +-- ci/gpu/build.sh | 32 ++----------------- .../recipes/libraft/build_libraft_distance.sh | 2 +- .../recipes/libraft/build_libraft_headers.sh | 2 +- conda/recipes/libraft/build_libraft_nn.sh | 2 +- conda/recipes/libraft/build_libraft_tests.sh | 2 +- conda/recipes/libraft/meta.yaml | 25 ++++++++------- conda/recipes/pylibraft/build.sh | 2 +- conda/recipes/pyraft/build.sh | 2 +- 9 files changed, 23 insertions(+), 51 deletions(-) diff --git a/ci/cpu/build.sh b/ci/cpu/build.sh index d7bc122f92..8f4fc74b40 100755 --- a/ci/cpu/build.sh +++ b/ci/cpu/build.sh @@ -5,10 +5,6 @@ ######################################### set -e -export SCCACHE_S3_KEY_PREFIX="libraft-$(uname -m)" -export SCCACHE_BUCKET="rapids-sccache" -export SCCACHE_REGION="us-west-2" -export SCCACHE_IDLE_TIMEOUT="32768" # Set path and build parallel level # openmpi dir is required on CentOS for finding MPI libs from cmake if [[ -e /etc/os-release ]] && (grep -qi centos /etc/os-release); then @@ -95,6 +91,7 @@ if [ "$BUILD_LIBRAFT" == "1" ]; then mkdir -p ${CONDA_BLD_DIR}/libraft/work mv ${CONDA_BLD_DIR}/work ${CONDA_BLD_DIR}/libraft/work fi + sccache --show-stats else gpuci_logger "SKIPPING build of conda packages for libraft-nn, libraft-distance, libraft-headers and libraft-tests" fi diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh index 44708f590c..4689b8fcc5 100644 --- a/ci/gpu/build.sh +++ b/ci/gpu/build.sh @@ -21,7 +21,6 @@ export PARALLEL_LEVEL=${PARALLEL_LEVEL:-8} export CUDA_REL=${CUDA_VERSION%.*} CONDA_ARTIFACT_PATH=${WORKSPACE}/ci/artifacts/raft/cpu/.conda-bld/ # notice there is no `linux-64` here - # Set home to the job's workspace export HOME=$WORKSPACE @@ -50,7 +49,7 @@ conda activate rapids # Install pre-built conda packages from previous CI step gpuci_logger "Install libraft conda packages from CPU job" -gpuci_mamba_retry install -y -c "${CONDA_ARTIFACT_PATH}" libraft-headers libraft-distance libraft-nn +gpuci_mamba_retry install -y -c "${CONDA_ARTIFACT_PATH}" libraft-headers libraft-distance libraft-nn libraft-tests gpuci_logger "Check conda environment" conda info @@ -61,18 +60,6 @@ conda list --show-channel-urls # BUILD - Build RAFT tests ################################################################################ -gpuci_logger "Adding ${CONDA_PREFIX}/lib to LD_LIBRARY_PATH" - -export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH - -#gpuci_logger "Build C++ and Python targets" -## These should link against the existing shared libs -#if hasArg --skip-tests; then -# "$WORKSPACE/build.sh" libraft -v -#else -# "$WORKSPACE/build.sh" libraft tests -v -#fi - gpuci_logger "Build and install Python targets" CONDA_BLD_DIR="$WORKSPACE/.conda-bld" gpuci_mamba_retry install boa @@ -80,9 +67,6 @@ gpuci_conda_retry mambabuild --no-build-id --croot "${CONDA_BLD_DIR}" conda/reci gpuci_conda_retry mambabuild --no-build-id --croot "${CONDA_BLD_DIR}" conda/recipes/pylibraft -c "${CONDA_ARTIFACT_PATH}" --python="${PYTHON}" gpuci_mamba_retry install -y -c "${CONDA_BLD_DIR}" -c "${CONDA_ARTIFACT_PATH}" pyraft pylibraft -gpuci_logger "sccache stats" -sccache --show-stats - ################################################################################ # TEST - Run GoogleTest and py.tests for RAFT ################################################################################ @@ -102,17 +86,8 @@ set +x gpuci_logger "Check GPU usage" nvidia-smi -if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then - gpuci_logger "GoogleTest for raft" - set -x - cd $WORKSPACE/cpp/build - GTEST_OUTPUT="xml:${WORKSPACE}/test-results/raft_cpp/" ./test_raft -else - # Install pre-built conda packages from previous CI step - gpuci_logger "Install libraft conda packages from CPU job" - gpuci_mamba_retry install -y -c "${CONDA_ARTIFACT_PATH}" libraft-tests - GTEST_OUTPUT="xml:${WORKSPACE}/test-results/raft_cpp/" $CONDA_PREFIX/bin/libraft/gtests/test_raft -fi +gpuci_logger "GoogleTest for raft" +GTEST_OUTPUT="xml:${WORKSPACE}/test-results/raft_cpp/" $CONDA_PREFIX/bin/libraft/gtests/test_raft gpuci_logger "Python pytest for pyraft" cd "$WORKSPACE/python/raft/raft/test" @@ -122,7 +97,6 @@ gpuci_logger "Python pytest for pylibraft" cd "$WORKSPACE/python/pylibraft/pylibraft/test" python -m pytest --cache-clear --junitxml="$WORKSPACE/junit-pylibraft.xml" -v -s - if [ "$(arch)" = "x86_64" ]; then gpuci_logger "Building docs" gpuci_mamba_retry install "rapids-doc-env=${MINOR_VERSION}.*" diff --git a/conda/recipes/libraft/build_libraft_distance.sh b/conda/recipes/libraft/build_libraft_distance.sh index 8c44584719..35a669d6df 100644 --- a/conda/recipes/libraft/build_libraft_distance.sh +++ b/conda/recipes/libraft/build_libraft_distance.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash # Copyright (c) 2022, NVIDIA CORPORATION. -./build.sh libraft --install -v --allgpuarch --compile-dist --sccache --no-nvtx +./build.sh libraft --install -v --allgpuarch --compile-dist --no-nvtx diff --git a/conda/recipes/libraft/build_libraft_headers.sh b/conda/recipes/libraft/build_libraft_headers.sh index 0176dac2f6..02ef674787 100644 --- a/conda/recipes/libraft/build_libraft_headers.sh +++ b/conda/recipes/libraft/build_libraft_headers.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash # Copyright (c) 2022, NVIDIA CORPORATION. -./build.sh libraft --install -v --allgpuarch --sccache --no-nvtx +./build.sh libraft --install -v --allgpuarch --no-nvtx diff --git a/conda/recipes/libraft/build_libraft_nn.sh b/conda/recipes/libraft/build_libraft_nn.sh index 44e9279315..caa643a356 100644 --- a/conda/recipes/libraft/build_libraft_nn.sh +++ b/conda/recipes/libraft/build_libraft_nn.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash # Copyright (c) 2022, NVIDIA CORPORATION. -./build.sh libraft --install -v --allgpuarch --sccache --compile-nn --no-nvtx +./build.sh libraft --install -v --allgpuarch --compile-nn --no-nvtx diff --git a/conda/recipes/libraft/build_libraft_tests.sh b/conda/recipes/libraft/build_libraft_tests.sh index 4e101f541a..040a2f8b8c 100644 --- a/conda/recipes/libraft/build_libraft_tests.sh +++ b/conda/recipes/libraft/build_libraft_tests.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash # Copyright (c) 2022, NVIDIA CORPORATION. -./build.sh tests bench -v --allgpuarch --sccache --no-nvtx +./build.sh tests bench -v --allgpuarch --no-nvtx cmake --install cpp/build --component testing diff --git a/conda/recipes/libraft/meta.yaml b/conda/recipes/libraft/meta.yaml index 348ae66645..3561c156c8 100644 --- a/conda/recipes/libraft/meta.yaml +++ b/conda/recipes/libraft/meta.yaml @@ -15,23 +15,21 @@ package: source: git_url: ../../.. -build: - script_env: - - PARALLEL_LEVEL - - VERSION_SUFFIX - - PROJECT_FLASH - - CMAKE_GENERATOR - - SCCACHE_S3_KEY_PREFIX=libraft-aarch64 # [aarch64] - - SCCACHE_S3_KEY_PREFIX=libraft-linux64 # [linux64] - - SCCACHE_BUCKET=rapids-sccache - - SCCACHE_REGION=us-west-2 - - SCCACHE_IDLE_TIMEOUT=32768 - outputs: - name: libraft-headers version: {{ version }} script: build_libraft_headers.sh build: + script_env: &script_env + - PARALLEL_LEVEL + - VERSION_SUFFIX + - PROJECT_FLASH + - CMAKE_GENERATOR + - SCCACHE_S3_KEY_PREFIX=libraft-aarch64 # [aarch64] + - SCCACHE_S3_KEY_PREFIX=libraft-linux64 # [linux64] + - SCCACHE_BUCKET=rapids-sccache + - SCCACHE_REGION=us-west-2 + - SCCACHE_IDLE_TIMEOUT=32768 number: {{ GIT_DESCRIBE_NUMBER }} string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} ignore_run_exports_from: @@ -67,6 +65,7 @@ outputs: version: {{ version }} script: build_libraft_distance.sh build: + script_env: *script_env number: {{ GIT_DESCRIBE_NUMBER }} string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} ignore_run_exports_from: @@ -102,6 +101,7 @@ outputs: version: {{ version }} script: build_libraft_nn.sh build: + script_env: *script_env number: {{ GIT_DESCRIBE_NUMBER }} string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} ignore_run_exports_from: @@ -136,6 +136,7 @@ outputs: version: {{ version }} script: build_libraft_tests.sh build: + script_env: *script_env number: {{ GIT_DESCRIBE_NUMBER }} string: cuda{{ cuda_major }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} ignore_run_exports_from: diff --git a/conda/recipes/pylibraft/build.sh b/conda/recipes/pylibraft/build.sh index 558d6fb071..4e64d031ec 100644 --- a/conda/recipes/pylibraft/build.sh +++ b/conda/recipes/pylibraft/build.sh @@ -2,4 +2,4 @@ #!/usr/bin/env bash # This assumes the script is executed from the root of the repo directory -./build.sh pylibraft --install --sccache --no-nvtx +./build.sh pylibraft --install --no-nvtx diff --git a/conda/recipes/pyraft/build.sh b/conda/recipes/pyraft/build.sh index b290d4463c..1462f365ff 100644 --- a/conda/recipes/pyraft/build.sh +++ b/conda/recipes/pyraft/build.sh @@ -3,4 +3,4 @@ # Copyright (c) 2022, NVIDIA CORPORATION. # This assumes the script is executed from the root of the repo directory -./build.sh pyraft --install --sccache --no-nvtx +./build.sh pyraft --install --no-nvtx