diff --git a/CHANGELOG.md b/CHANGELOG.md index 94e8375816b..d937d8edad1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - PR #941 Regression python/cudf fix - PR #945 Simplified benchmark --no-rmm-reinit option, updated default options - PR #946 Install meta packages for dependencies +- PR #953 fix setting RAFT_DIR from the RAFT_PATH env var - PR #954 Update cuGraph error handling to use RAFT ## Bug Fixes @@ -98,6 +99,7 @@ - PR #923 Updated pagerank with @afender 's temp fix for double-free crash - PR #928 Fix scikit learn test install to work with libgcc-ng 7.3 - PR 935 Merge +- PR #956 Use new gpuCI image in local build script # cuGraph 0.13.0 (31 Mar 2020) diff --git a/ci/local/build.sh b/ci/local/build.sh index c6f7f1a51e2..ef198c719eb 100755 --- a/ci/local/build.sh +++ b/ci/local/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -DOCKER_IMAGE="gpuci/rapidsai-base:cuda10.0-ubuntu16.04-gcc5-py3.6" +DOCKER_IMAGE="gpuci/rapidsai:cuda10.0-ubuntu16.04-gcc5-py3.6" REPO_PATH=${PWD} RAPIDS_DIR_IN_CONTAINER="/rapids" CPP_BUILD_DIR="cpp/build" @@ -139,4 +139,4 @@ docker run --rm -it ${GPU_OPTS} \ -v "$PASSWD_FILE":/etc/passwd:ro \ -v "$GROUP_FILE":/etc/group:ro \ --cap-add=SYS_PTRACE \ - "${DOCKER_IMAGE}" bash -c "${COMMAND}" \ No newline at end of file + "${DOCKER_IMAGE}" bash -c "${COMMAND}" diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 4d0b03c76fd..2f284c97712 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -263,7 +263,7 @@ endif(NOT NCCL_PATH) if(DEFINED ENV{RAFT_PATH}) message(STATUS "RAFT_PATH environment variable detected.") message(STATUS "RAFT_DIR set to $ENV{RAFT_PATH}") - set(RAFT_DIR ENV{RAFT_PATH}) + set(RAFT_DIR "$ENV{RAFT_PATH}") ExternalProject_Add(raft DOWNLOAD_COMMAND "" diff --git a/python/setuputils.py b/python/setuputils.py index a7e663125d3..f2de886255d 100644 --- a/python/setuputils.py +++ b/python/setuputils.py @@ -22,6 +22,8 @@ import sys import warnings +from pathlib import Path + def get_environment_option(name): ENV_VARIABLE = os.environ.get(name, False) @@ -73,6 +75,8 @@ def use_raft_package(raft_path, cpp_build_path, """ Function to use the python code in RAFT in package.raft + - If RAFT symlink already exists, don't change anything. Use setup.py clean + if you want to change RAFT location. - Uses RAFT located in $RAFT_PATH if $RAFT_PATH exists. - Otherwise it will look for RAFT in the libcugraph build folder, located either in the default location ../cpp/build or in @@ -86,38 +90,55 @@ def use_raft_package(raft_path, cpp_build_path, Path to the C++ include folder of RAFT """ - if not raft_path: + if os.path.islink('cugraph/raft'): + raft_path = os.path.realpath('cugraph/raft') + # walk up two dirs from `python/raft` + raft_path = os.path.join(raft_path, '..', '..') + print("-- Using existing RAFT folder") + elif isinstance(raft_path, (str, os.PathLike)): + print('-- Using RAFT_PATH argument') + elif os.environ.get('RAFT_PATH', False) is not False: + raft_path = str(os.environ['RAFT_PATH']) + print('-- Using RAFT_PATH environment variable') + else: raft_path, raft_cloned = \ clone_repo_if_needed('raft', cpp_build_path, git_info_file=git_info_file) + raft_path = os.path.join('../', raft_path) - else: - print("-- Using RAFT_PATH variable, RAFT found at " + - str(os.environ['RAFT_PATH'])) - raft_path = os.environ['RAFT_PATH'] + raft_path = os.path.realpath(raft_path) + print('-- RAFT found at: ' + str(raft_path)) try: - os.symlink('../' + raft_path + 'python/raft', 'cugraph/raft') + os.symlink( + os.path.join(raft_path, 'python/raft'), + os.path.join('cugraph/raft') + ) except FileExistsError: - os.remove('cugraph/raft') - os.symlink('../' + raft_path + 'python/raft', 'cugraph/raft') + os.remove(os.path.join('cugraph/raft')) + os.symlink( + os.path.join(raft_path, 'python/raft'), + os.path.join('cugraph/raft') + ) - return raft_path + 'cpp/include' + return os.path.join(raft_path, 'cpp/include') -def clone_repo_if_needed(name, cpp_build_path, - git_info_file='../cpp/cmake/Dependencies.cmake'): - if cpp_build_path: - cpp_build_path = '../' + cpp_build_path - else: - cpp_build_path = '../cpp/build/' +def clone_repo_if_needed(name, cpp_build_path=None, + git_info_file=None): + if git_info_file is None: + git_info_file = _get_repo_path() + '/cpp/CMakeLists.txt' + + if cpp_build_path is None or cpp_build_path is False: + cpp_build_path = _get_repo_path() + '/cpp/build/' repo_cloned = get_submodule_dependency(name, cpp_build_path=cpp_build_path, git_info_file=git_info_file) if repo_cloned: - repo_path = '_external_repositories/' + name + '/' + repo_path = ( + _get_repo_path() + '/python/_external_repositories/' + name + '/') else: repo_path = os.path.join(cpp_build_path, name + '/src/' + name + '/') @@ -257,3 +278,8 @@ def get_repo_cmake_info(names, file_path): results[name] = res return results + + +def _get_repo_path(): + python_dir = Path(__file__).resolve() + return str(python_dir.parent.parent.absolute())