From 921a9abc18d64fb6903994ba65ae03959347efe1 Mon Sep 17 00:00:00 2001 From: Michael Sarahan Date: Tue, 9 Jan 2024 13:07:24 -0800 Subject: [PATCH 1/4] add initial devcontainers --- .devcontainer/Dockerfile | 35 ++++++++++++++++ .devcontainer/README.md | 35 ++++++++++++++++ .../cuda11.8-conda/devcontainer.json | 37 +++++++++++++++++ .devcontainer/cuda11.8-pip/devcontainer.json | 37 +++++++++++++++++ .../cuda12.0-conda/devcontainer.json | 37 +++++++++++++++++ .devcontainer/cuda12.0-pip/devcontainer.json | 41 +++++++++++++++++++ .devcontainer/manifest.yaml | 35 ++++++++++++++++ 7 files changed, 257 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/README.md create mode 100644 .devcontainer/cuda11.8-conda/devcontainer.json create mode 100644 .devcontainer/cuda11.8-pip/devcontainer.json create mode 100644 .devcontainer/cuda12.0-conda/devcontainer.json create mode 100644 .devcontainer/cuda12.0-pip/devcontainer.json create mode 100644 .devcontainer/manifest.yaml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..c19bb689 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,35 @@ +# syntax=docker/dockerfile:1.5 + +ARG BASE +ARG PYTHON_PACKAGE_MANAGER=conda + +FROM ${BASE} as pip-base + +RUN apt update -y \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + librdkafka-dev \ + && rm -rf /tmp/* /var/tmp/* /var/cache/apt/* /var/lib/apt/lists/*; + +ENV DEFAULT_VIRTUAL_ENV=rapids + +FROM ${BASE} as conda-base + +ENV DEFAULT_CONDA_ENV=rapids + +FROM ${PYTHON_PACKAGE_MANAGER}-base + +ARG CUDA +ENV CUDAARCHS="RAPIDS" +ENV CUDA_VERSION="${CUDA_VERSION:-${CUDA}}" + +ARG PYTHON_PACKAGE_MANAGER +ENV PYTHON_PACKAGE_MANAGER="${PYTHON_PACKAGE_MANAGER}" + +ENV PYTHONSAFEPATH="1" +ENV PYTHONUNBUFFERED="1" +ENV PYTHONDONTWRITEBYTECODE="1" + +ENV SCCACHE_REGION="us-east-2" +ENV SCCACHE_BUCKET="rapids-sccache-devs" +ENV VAULT_HOST="https://vault.ops.k8s.rapids.ai" +ENV HISTFILE="/home/coder/.cache/._bash_history" diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 00000000..91ee7ef8 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,35 @@ +# cuDF Development Containers + +This directory contains [devcontainer configurations](https://containers.dev/implementors/json_reference/) for using VSCode to [develop in a container](https://code.visualstudio.com/docs/devcontainers/containers) via the `Remote Containers` [extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) or [GitHub Codespaces](https://github.com/codespaces). + +This container is a turnkey development environment for building and testing the cuDF C++ and Python libraries. + +## Table of Contents + +* [Prerequisites](#prerequisites) +* [Host bind mounts](#host-bind-mounts) +* [Launch a Dev Container](#launch-a-dev-container) + +## Prerequisites + +* [VSCode](https://code.visualstudio.com/download) +* [VSCode Remote Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) + +## Host bind mounts + +By default, the following directories are bind-mounted into the devcontainer: + +* `${repo}:/home/coder/cudf` +* `${repo}/../.aws:/home/coder/.aws` +* `${repo}/../.local:/home/coder/.local` +* `${repo}/../.cache:/home/coder/.cache` +* `${repo}/../.conda:/home/coder/.conda` +* `${repo}/../.config:/home/coder/.config` + +This ensures caches, configurations, dependencies, and your commits are persisted on the host across container runs. + +## Launch a Dev Container + +To launch a devcontainer from VSCode, open the cuDF repo and select the "Reopen in Container" button in the bottom right:
+ +Alternatively, open the VSCode command palette (typically `cmd/ctrl + shift + P`) and run the "Rebuild and Reopen in Container" command. diff --git a/.devcontainer/cuda11.8-conda/devcontainer.json b/.devcontainer/cuda11.8-conda/devcontainer.json new file mode 100644 index 00000000..286fbf7a --- /dev/null +++ b/.devcontainer/cuda11.8-conda/devcontainer.json @@ -0,0 +1,37 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "11.8", + "PYTHON_PACKAGE_MANAGER": "conda", + "BASE": "rapidsai/devcontainers:24.02-cpp-cuda11.8-mambaforge-ubuntu22.04" + } + }, + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.2": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda11.8-envs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/pkgs,target=/home/coder/.conda/pkgs,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/${localWorkspaceFolderBasename}-cuda11.8-envs,target=/home/coder/.conda/envs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.devcontainer/cuda11.8-pip/devcontainer.json b/.devcontainer/cuda11.8-pip/devcontainer.json new file mode 100644 index 00000000..29d052aa --- /dev/null +++ b/.devcontainer/cuda11.8-pip/devcontainer.json @@ -0,0 +1,37 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "11.8", + "PYTHON_PACKAGE_MANAGER": "pip", + "BASE": "rapidsai/devcontainers:24.02-cpp-llvm16-cuda11.8-ubuntu22.04" + } + }, + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/ucx:24.2": {"version": "1.14.1"}, + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.2": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda11.8-venvs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.local/share/${localWorkspaceFolderBasename}-cuda11.8-venvs,target=/home/coder/.local/share/venvs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.devcontainer/cuda12.0-conda/devcontainer.json b/.devcontainer/cuda12.0-conda/devcontainer.json new file mode 100644 index 00000000..6d6dc584 --- /dev/null +++ b/.devcontainer/cuda12.0-conda/devcontainer.json @@ -0,0 +1,37 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "12.0", + "PYTHON_PACKAGE_MANAGER": "conda", + "BASE": "rapidsai/devcontainers:24.02-cpp-mambaforge-ubuntu22.04" + } + }, + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.2": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda12.0-envs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/pkgs,target=/home/coder/.conda/pkgs,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/${localWorkspaceFolderBasename}-cuda12.0-envs,target=/home/coder/.conda/envs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.devcontainer/cuda12.0-pip/devcontainer.json b/.devcontainer/cuda12.0-pip/devcontainer.json new file mode 100644 index 00000000..7c4420d4 --- /dev/null +++ b/.devcontainer/cuda12.0-pip/devcontainer.json @@ -0,0 +1,41 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "12.0", + "PYTHON_PACKAGE_MANAGER": "pip", + "BASE": "rapidsai/devcontainers:24.02-cpp-llvm16-cuda12.0-ubuntu22.04" + } + }, + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/ucx:24.2": {"version": "1.14.1"}, + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.2": {} + + }, + "containerEnv": { + "PROJECT_MANIFEST_YML": "/home/coder/ucxx/.devcontainer/manifest.yaml" + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda12.0-venvs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.local/share/${localWorkspaceFolderBasename}-cuda12.0-venvs,target=/home/coder/.local/share/venvs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.devcontainer/manifest.yaml b/.devcontainer/manifest.yaml new file mode 100644 index 00000000..58aa1353 --- /dev/null +++ b/.devcontainer/manifest.yaml @@ -0,0 +1,35 @@ +x-git-defaults: &git_defaults + host: github + tag: branch-24.02 + upstream: rapidsai + +repos: + +- name: rmm + path: rmm + cpp: + - name: rmm + sub_dir: "" + depends: [] + python: + - name: rmm + sub_dir: python + depends: [] + git: + repo: rmm + <<: *git_defaults + +- name: ucxx + path: ucxx + git: + repo: ucxx + <<: *git_defaults + tag: branch-0.36 + cpp: + - name: ucxx + sub_dir: "cpp" + depends: [] + python: + - name: ucxx + sub_dir: "python" + depends: [] \ No newline at end of file From 939fea6364dac450619a1e6b5fc71ea19b6eae69 Mon Sep 17 00:00:00 2001 From: Michael Sarahan Date: Tue, 9 Jan 2024 13:09:50 -0800 Subject: [PATCH 2/4] DO NOT MERGE: wheel tweaks --- dependencies.yaml | 59 ++++++++++++++++++++++++++++++++++++++----- python/pyproject.toml | 11 ++++---- 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/dependencies.yaml b/dependencies.yaml index e649c7f4..4c4b24e5 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -1,7 +1,7 @@ # Dependency list for https://github.com/rapidsai/dependency-file-generator files: all: - output: conda + output: [conda, pyproject] matrix: cuda: ["11.8", "12.0"] arch: [x86_64] @@ -70,7 +70,7 @@ dependencies: - fmt>=10.1.1,<11 - &gmock gmock>=1.13.0 - >est gtest>=1.13.0 - - librmm==24.2.* + - librmm==24.02.* - ninja - spdlog>=1.12.0,<1.13 build_python: @@ -80,13 +80,35 @@ dependencies: - *cmake_ver - cython>=3.0.0 - ninja - - rmm==24.2.* - output_types: conda packages: - scikit-build-core>=0.7.0 + - rmm==24.2.* - output_types: [requirements, pyproject] packages: - scikit-build-core[pyproject]>=0.7.0 + - output_types: [requirements, pyproject] + packages: + # pip recognizes the index as a global option for the requirements.txt file + # This index is needed for rmm. + - --extra-index-url=https://pypi.nvidia.com + - --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple + # we need --pre for rmm 24.2, as all current versions are pre-release (alpha) + - --pre + + # requires https://github.com/rapidsai/dependency-file-generator/pull/48 + # specific: + # - output_types: [requirements, pyproject] + # matrices: + # - matrix: {cuda: "12.*"} + # packages: + # - rmm-cu12==24.2.* + # - matrix: {cuda: "11.*"} + # packages: + # - rmm-cu11==24.2.* + # - matrix: null + # packages: null + checks: common: - output_types: [conda, requirements] @@ -160,7 +182,7 @@ dependencies: common: - output_types: [conda, requirements, pyproject] packages: - - numpy>=1.21 + - numpy>=1.21,<1.25 - pynvml>=11.4.1 - output_types: [conda] packages: @@ -177,11 +199,36 @@ dependencies: - output_types: [conda, requirements, pyproject] packages: - cloudpickle - - cudf==24.2.* - - cupy - dask - distributed - numba>=0.57.1 - pytest - pytest-asyncio - pytest-rerunfailures + - output_types: [conda] + packages: + - cudf==24.2.* + - cupy + - output_types: [requirements] + packages: + # pip recognizes the index as a global option for the requirements.txt file + # This index is needed for cudf. + - --extra-index-url=https://pypi.nvidia.com + - --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple + # we need --pre for rmm 24.2, as all current versions are pre-release (alpha) + - --pre + + # requires https://github.com/rapidsai/dependency-file-generator/pull/48 + # specific: + # - output_types: [requirements, pyproject] + # matrices: + # - matrix: {cuda: "12.*"} + # packages: + # - cudf-cu12==24.2.* + # - cupy-cuda12x + # - matrix: {cuda: "11.*"} + # packages: + # - cudf-cu11==24.2.* + # - cupy-cuda11x + # - matrix: null + # packages: null diff --git a/python/pyproject.toml b/python/pyproject.toml index f36ad1c4..7da89bfa 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -7,9 +7,10 @@ requires = [ "cmake>=3.26.4", "cython>=3.0.0", "ninja", - "rmm==24.2.*", + "rmm-cu12==24.2.*", "scikit-build-core[pyproject]>=0.7.0", -] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../dependencies.yaml and run `rapids-dependency-file-generator`. +] # This list is normally generated by `rapids-dependency-file-generator` but has been manually edited to change rmm to rmm-cu12. +# See https://github.com/rapidsai/dependency-file-generator/pull/48 for outstanding work [project] name = "ucxx" @@ -22,7 +23,7 @@ authors = [ license = { text = "BSD-3-Clause" } requires-python = ">=3.9" dependencies = [ - "numpy>=1.21", + "numpy>=1.21,<1.25", "pynvml>=11.4.1", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../dependencies.yaml and run `rapids-dependency-file-generator`. classifiers = [ @@ -40,8 +41,8 @@ classifiers = [ [project.optional-dependencies] test = [ "cloudpickle", - "cudf==24.2.*", - "cupy", + "cudf-cu12==24.2.*", + "cupy-cuda12", "dask", "distributed", "numba>=0.57.1", From 157da8c625ce7e224f066956bf6d07e11d351bd4 Mon Sep 17 00:00:00 2001 From: Michael Sarahan Date: Wed, 10 Jan 2024 10:58:44 -0800 Subject: [PATCH 3/4] remove custom manifest.yaml; ucxx is added upstream --- .devcontainer/cuda12.0-pip/devcontainer.json | 3 -- .devcontainer/manifest.yaml | 35 -------------------- 2 files changed, 38 deletions(-) delete mode 100644 .devcontainer/manifest.yaml diff --git a/.devcontainer/cuda12.0-pip/devcontainer.json b/.devcontainer/cuda12.0-pip/devcontainer.json index 7c4420d4..454c04ec 100644 --- a/.devcontainer/cuda12.0-pip/devcontainer.json +++ b/.devcontainer/cuda12.0-pip/devcontainer.json @@ -14,9 +14,6 @@ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.2": {} }, - "containerEnv": { - "PROJECT_MANIFEST_YML": "/home/coder/ucxx/.devcontainer/manifest.yaml" - }, "overrideFeatureInstallOrder": [ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" ], diff --git a/.devcontainer/manifest.yaml b/.devcontainer/manifest.yaml deleted file mode 100644 index 58aa1353..00000000 --- a/.devcontainer/manifest.yaml +++ /dev/null @@ -1,35 +0,0 @@ -x-git-defaults: &git_defaults - host: github - tag: branch-24.02 - upstream: rapidsai - -repos: - -- name: rmm - path: rmm - cpp: - - name: rmm - sub_dir: "" - depends: [] - python: - - name: rmm - sub_dir: python - depends: [] - git: - repo: rmm - <<: *git_defaults - -- name: ucxx - path: ucxx - git: - repo: ucxx - <<: *git_defaults - tag: branch-0.36 - cpp: - - name: ucxx - sub_dir: "cpp" - depends: [] - python: - - name: ucxx - sub_dir: "python" - depends: [] \ No newline at end of file From fff77b91cb564a696dabb97c6fe47f05cc8e98a6 Mon Sep 17 00:00:00 2001 From: Mike Sarahan Date: Wed, 10 Jan 2024 13:15:41 -0600 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Peter Andreas Entschev --- .devcontainer/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 91ee7ef8..d8b3cee5 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1,8 +1,8 @@ -# cuDF Development Containers +# UCXX Development Containers This directory contains [devcontainer configurations](https://containers.dev/implementors/json_reference/) for using VSCode to [develop in a container](https://code.visualstudio.com/docs/devcontainers/containers) via the `Remote Containers` [extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) or [GitHub Codespaces](https://github.com/codespaces). -This container is a turnkey development environment for building and testing the cuDF C++ and Python libraries. +This container is a turnkey development environment for building and testing the UCXX C++ and Python libraries. ## Table of Contents @@ -19,7 +19,7 @@ This container is a turnkey development environment for building and testing the By default, the following directories are bind-mounted into the devcontainer: -* `${repo}:/home/coder/cudf` +* `${repo}:/home/coder/ucxx` * `${repo}/../.aws:/home/coder/.aws` * `${repo}/../.local:/home/coder/.local` * `${repo}/../.cache:/home/coder/.cache` @@ -30,6 +30,6 @@ This ensures caches, configurations, dependencies, and your commits are persiste ## Launch a Dev Container -To launch a devcontainer from VSCode, open the cuDF repo and select the "Reopen in Container" button in the bottom right:
+To launch a devcontainer from VSCode, open the UCXX repo and select the "Reopen in Container" button in the bottom right:
Alternatively, open the VSCode command palette (typically `cmd/ctrl + shift + P`) and run the "Rebuild and Reopen in Container" command.