NVIDIA / NVIDIA/cccl

[FEA]: Extend devcontainer/launch.sh to build custom containers on the fly

Open
#126 1 comment 0 reactions 0 assignees View on GitHub
infra
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

# Summary

Our devcontainer infrastructure provides convenient, standardized development environments across a wide range of our support matrix.

At present, we provide a set of prebuild devcontainers in the `.devcontainer` directory for environments like `cuda11.1-gcc7`. These devcontainers can be used via `vscode` directly or by using the `.devcontainer/launch.sh` script to open vscode with the specified container, e.g., `./devcontainer/launch.sh 12.1 gcc12`.

We do not provide prebuilt containers for all possible combinations of CUDA and host compiler versions as this would be impractical.

However, we oftentimes need to test environments outside of this predefined set in order to reproduce and triage issues. This is exceptionally inconvenient without a corresponding devcontainer as it requires stepping outside the normal developer workflow.

# Proposed Solution

We do not need to prebuild all possible combinations in order to provide a devcontainer for a custom environment. We can build a devcontainer.json on the fly if a prebuilt container is not available.

Furthermore, this can be abstracted behind the `.devcontainer/launch.sh` script such that it will launch a prebuilt devcontainer if available, and otherwise generate one for you.

### Tasks
- [ ] Create a `build_devcontainer.sh` script that takes a CUDA version and host compiler to generate a `devcontainer.json` file using the scripts from https://github.com/rapidsai/devcontainers
- [ ] Update the `launch.sh` script to invoke the `build_devcontainer.sh` script if the requested environment is not already available.

# Additional Context

It will be challenging to make the `build_devcontainer.sh` robust enough to handle all possible combinations of CUDA/host compiler versions as the selection of CUDA/host compiler impacts the required version of Ubuntu, which then also impacts the availability of specific host compiler versions. We will need to see if it is possible to detect invalid combinations.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.