mirror of
https://github.com/NVIDIA/nv-ingest.git
synced 2025-01-05 18:58:13 +03:00
VSCode .devcontainer (#290)
This commit is contained in:
47
.devcontainer/Dockerfile
Normal file
47
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,47 @@
|
||||
# SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES.
|
||||
# All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# syntax=docker/dockerfile:1.3
|
||||
|
||||
ARG BASE_IMG=nvcr.io/nvidia/cuda
|
||||
ARG BASE_IMG_TAG=12.4.1-base-ubuntu22.04
|
||||
|
||||
# Use NVIDIA cuda
|
||||
FROM $BASE_IMG:$BASE_IMG_TAG AS base
|
||||
|
||||
ARG RELEASE_TYPE="dev"
|
||||
ARG VERSION=""
|
||||
ARG VERSION_REV="0"
|
||||
|
||||
# Install necessary dependencies using apt-get
|
||||
RUN apt-get update && apt-get install -y \
|
||||
wget \
|
||||
bzip2 \
|
||||
ca-certificates \
|
||||
curl \
|
||||
libgl1-mesa-glx \
|
||||
vim \
|
||||
git \
|
||||
&& apt-get clean
|
||||
|
||||
RUN wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" -O /tmp/miniforge.sh \
|
||||
&& bash /tmp/miniforge.sh -b -p /opt/conda \
|
||||
&& rm /tmp/miniforge.sh
|
||||
|
||||
# Add conda to the PATH
|
||||
ENV PATH=/opt/conda/bin:$PATH
|
||||
|
||||
# Install Mamba, a faster alternative to conda, within the base environment
|
||||
RUN conda install -y mamba -n base -c conda-forge
|
||||
|
||||
COPY conda/environments/nv_ingest_environment.yml /workspace/nv_ingest_environment.yml
|
||||
|
||||
# Create nv_ingest base environment
|
||||
RUN mamba env create -f /workspace/nv_ingest_environment.yml \
|
||||
&& conda clean --all --yes
|
||||
|
||||
# Set default shell to bash
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
# Activate the environment (make it default for subsequent commands)
|
||||
RUN echo "source activate nv_ingest_runtime" >> ~/.bashrc
|
||||
28
.devcontainer/README.md
Normal file
28
.devcontainer/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
# NV-Ingest Devcontainer
|
||||
|
||||
The nv-ingest devcontainer is provided as a quick-to-set-up development and exploration environment for use with [Visual Studio Code](https://code.visualstudio.com) (Code). The devcontainer is a lightweight container which mounts-in a Conda environment with cached packages, alleviating long Conda download times on subsequent launches. It provides a simple framework for adding developer-centric [scripts](#development-scripts), and incorporates some helpful Code plugins.
|
||||
|
||||
More information about devcontainers can be found at [`containers.dev`](https://containers.dev/).
|
||||
|
||||
## Getting Started
|
||||
|
||||
To get started, simply open the nv-ingest repository root folder within Code. A window should appear at the bottom-right corner of the editor asking if you would like to reopen the workspace inside of the dev container. After clicking the confirmation dialog, the container will first build, then launch, then remote-attach.
|
||||
|
||||
If the window does not appear, or you would like to rebuild the container, click ctrl-shift-p and search for `Dev Containers: Rebuild and Reopen in Container`. Hit enter, and the container will first build, then launch, then remote-attach.
|
||||
62
.devcontainer/devcontainer.json
Normal file
62
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"build": {
|
||||
"context": "..",
|
||||
"dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile",
|
||||
},
|
||||
"privileged": true,
|
||||
"hostRequirements": {
|
||||
"gpu": "optional"
|
||||
},
|
||||
"capAdd": [
|
||||
"SYS_NICE",
|
||||
"SYS_PTRACE"
|
||||
],
|
||||
"containerEnv": {
|
||||
"HOST_REPO_ROOT": "${localWorkspaceFolder}",
|
||||
"REPO_ROOT": "~/dev/nv-ingest"
|
||||
},
|
||||
"workspaceFolder": "/workspace",
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=consistent",
|
||||
"forwardPorts": [ 7670, 7671 ],
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"cschlosser.doxdocgen", // Adding docstrings to C++ code
|
||||
"eamodio.gitlens", // Enhanced Git support
|
||||
"eeyore.yapf", // Python code formatter
|
||||
"josetr.cmake-language-support-vscode", // CMake language support
|
||||
"llvm-vs-code-extensions.vscode-clangd",
|
||||
"llvm-vs-code-extensions.vscode-clangd", // Clangd language server for C++
|
||||
"matepek.vscode-catch2-test-adapter",
|
||||
"mechatroner.rainbow-csv", // Colorizing CSV files
|
||||
"mhutchie.git-graph", // Visualizing Git history and branching
|
||||
"ms-azuretools.vscode-docker", // Docker support
|
||||
"ms-python.debugpy", // Python debugger
|
||||
"ms-python.flake8", // Python linter
|
||||
"ms-python.isort", // Python import sorter
|
||||
"ms-python.pylint", // Python linter
|
||||
"ms-python.python", // Python language support
|
||||
"ms-python.vscode-pylance", // Python language server
|
||||
"ms-toolsai.jupyter", // Jupyter notebook support
|
||||
"ms-vscode.cmake-tools", // CMake support for building
|
||||
"ms-vscode.cpptools", // C++ language support
|
||||
"njpwerner.autodocstring", // Adding docstrings to python code
|
||||
"nvidia.nsight-vscode-edition", // CUDA integration and debugging
|
||||
"stkb.rewrap", // Wrapping all text in any language
|
||||
"twxs.cmake",
|
||||
"vadimcn.vscode-lldb", // LLDB debugger (better than GDB for C++ debugging)
|
||||
"xaver.clang-format"
|
||||
],
|
||||
"settings": {
|
||||
"cmake.cmakePath": "/tmp/.current-conda-env/bin/cmake",
|
||||
"C_Cpp.intelliSenseEngine": "disabled",
|
||||
"python.terminal.activateEnvironment": false,
|
||||
"files.watcherExclude": {
|
||||
"**/.git/objects/**": true,
|
||||
"**/.git/subtree-cache/**": true,
|
||||
"**/.cache/**": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user