Add cuspatial devcontainers by trxcllnt · Pull Request #960 · rapidsai/cuspatial (original) (raw)
Description
This PR adds some devcontainers to help simplify building the cuspatial
C++ and Python libraries.
The devcontainers can be launched in one of two ways:
- By clicking the "Reopen in Container" button that VSCode shows when opening the repo (or by using the "Rebuild and Reopen in Container" command from the command palette):
- By using the
.devcontainer/launch.sh
script, which launches new VSCode windows and instances of the devcontainer.
launch.sh
takes two arguments, a mode
and a package manager
.
The mode
argument determines how the devcontainer interacts with the files on the host:
isolated
means the devcontainer doesn't mount thecuspatial
source from the host, and is unique to this container instance. Use this mode if you want to launch two separate devcontainers that can each be checked out to two independent branches ofcuspatial
.- Be sure to push any commits you want to persist. Once this container is removed, any unpushed changes will be lost!
single
means the devcontainer will mount thecuspatial
source from the host, but install RMM and cuDF via the package manager. This is the default option.unified
means the devcontainer will mountrmm
,cudf,
andcuspatial
sources from the host (and assumes RMM and cuDF are siblings to the cuspatial dir). In this mode, RMM and cuDF will not be installed, but the devcontainer will install the dependencies required to build all three.
The package manager
argument can be either conda
, or pip
. This determines whether the devcontainer uses conda
or pip
to install the dependencies (the default is conda
). pip
is experimental/not working for normal dev, and is currently meant to aid in pip packaging work.
Examples:
Launch a devcontainer that only mounts cuspatial and installs dependencies via conda
$ .devcontainer/launch.sh
Launch a devcontainer that is isolated from changes on the host and installs dependencies via conda
$ .devcontainer/launch.sh isolated
Launch a devcontainer that mounts rmm, cudf, and cuspatial from the host and installs dependencies via conda
$ .devcontainer/launch.sh unified conda
Launch a devcontainer that is isolated from changes on the host and installs dependencies via pip
$ .devcontainer/launch.sh isolated pip
Inside the devcontainer, you can use tab-completion to explore the available commands.
Clone one of the RAPIDS repositories into the container
$ clone-
Configure the C++ CMake of (command accepts additional CMake arguments)
$ configure--cpp
Optionally configure the C++ CMake of and build the C++ (command accepts additional CMake arguments)
$ build--cpp
Optionally build the C++, then build the Python library (command accepts additional CMake arguments)
$ build--python
You can, of course, use CMake, ninja, pip install -e .
etc. directly too. The above commands are only meant as aids/shortcuts! They are simple shell scripts, and you can inspect their contents via e.g. code $(which configure-cuspatial-cpp)
.
All the code repos are in the $HOME
dir, so cleaning is straightforward:
Clean cuspatial C++
$ rm -rf ~/cuspatial/cpp/build
Clean cuspatial Python
$ rm -rf ~/cuspatial/python/cuspatial/_skbuild
Checklist
- I am familiar with the Contributing Guidelines.
- New or existing tests cover these changes.
- The documentation is up to date with these changes.