-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevcontainer.json
87 lines (87 loc) · 3.94 KB
/
devcontainer.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "nlp-research-template:latest",
// Put your own built docker image here
"image": "konstantinjdobler/nlp-research-template:latest",
//-------------------------------------------------
// ---- Alternative: let VS Code build the image---
// ------------------------------------------------
// "build": {
// // Sets the run context to one level up instead of the .devcontainer folder.
// "context": "..",
// // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
// "dockerfile": "../Dockerfile",
// // "args": {
// // "OS_SELECTOR": "ubuntu" // force ubuntu base OS for devcontainer, necessary if you want to use "features"
// // }
// },
////////////////////////////////////////////////////////////
// -----------------------------------
// CUSTOMIZE SOME THINGS BELOW HERE !!!!!
// -----------------------------------
////////////////////////////////////////////////////////////
// Specify which GPU device you want to use (e.g "device=0")
"runArgs": [
"--ipc=host",
// "--gpus",
// "device=CHANGE_ME"
],
// ------------------------------------------------------------
// Setup your mounts and env vars like for a docker run command
// ------------------------------------------------------------
// Mount cache files like HuggingFace datasets cache. The user directory inside the container is /home/mamba/
// Paths need to be absolute, so we use the localEnv variable to get the local user home directory
// Check HF_DATASETS_CACHE, WANDB_DATA_DIR, XDG_CACHE_HOME etc. env vars to see what you need to mount
// "mounts": [
// "source=/scratch/YOUR_USERNAME/data,target=/scratch/YOUR_USERNAME/data,type=bind",
// "source=/scratch/YOUR_USERNAME/cache,target=/scratch/YOUR_USERNAME/cache,type=bind"
// ],
"mounts": [
"source=${localEnv:HOME}/.netrc,target=/home/mamba/.netrc,type=bind", // this is to get WANDB_API_KEY from .netrc
"source=${localEnv:HOME}/.gitconfig,target=/home/mamba/.gitconfig,type=bind", // this is to get git credentials
"source=${localEnv:HOME}/.cache,target=/home/mamba/.cache,type=bind", // general cache directory
],
"remoteEnv": {
"WANDB_API_KEY": "${localEnv:WANDB_API_KEY}",
// "WANDB_DATA_DIR": "${localEnv:WANDB_DATA_DIR}",
// "WANDB_DIR": "${localEnv:WANDB_DIR}",
// "HF_DATASETS_CACHE": "${localEnv:HF_DATASETS_CACHE}",
// "XDG_CACHE_HOME": "${localEnv:XDG_CACHE_HOME}", // if you use a custom cache dir
},
////////////////////////////////////////////////////////////////////
// -----------------------------------------------------
// END CUSTOMIZATION OF ENV VARS, MOUNTS, RUN ARGS etc.
// -----------------------------------------------------
////////////////////////////////////////////////////////////////////
// Features to add to the dev container. More info: https://containers.dev/features.
// Doesn't work with centOS / RHEL base images, which we use
// "features": {
// "ghcr.io/devcontainers/features/git:1.1.5": {},
// },
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
// These depend on your preferences, we just want to give our recommendations here.
"extensions": [
"ms-python.python",
"VisualStudioExptTeam.vscodeintellicode",
"ms-python.vscode-pylance",
"github.copilot",
"kevinrose.vsc-python-indent",
"ms-python.black-formatter",
"charliermarsh.ruff",
"ms-azuretools.vscode-docker",
// nice to have below
"jgclark.vscode-todo-highlight",
"percy.vscode-pydata-viewer",
"njqdev.vscode-python-typehint",
"foxundermoon.shell-format"
]
}
},
"postCreateCommand": "pipx install conda-lock"
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": []
}