Skip to content

Commit

Permalink
Fix sccache
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Jacobelli <[email protected]>
  • Loading branch information
jjacobelli committed Jun 17, 2022
1 parent d729754 commit 86d3234
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 51 deletions.
5 changes: 1 addition & 4 deletions ci/cpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
32 changes: 3 additions & 29 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -61,28 +60,13 @@ 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
gpuci_conda_retry mambabuild --no-build-id --croot "${CONDA_BLD_DIR}" conda/recipes/pyraft -c "${CONDA_ARTIFACT_PATH}" --python="${PYTHON}"
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
################################################################################
Expand All @@ -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"
Expand All @@ -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}.*"
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_distance.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_headers.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_nn.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion conda/recipes/libraft/build_libraft_tests.sh
Original file line number Diff line number Diff line change
@@ -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
25 changes: 13 additions & 12 deletions conda/recipes/libraft/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/pylibraft/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion conda/recipes/pyraft/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 86d3234

Please sign in to comment.