Skip to content

Instantly share code, notes, and snippets.

@crcrpar
Last active August 29, 2020 06:30
Show Gist options
  • Save crcrpar/5657bb198c2651f7ac0cdaa03a863137 to your computer and use it in GitHub Desktop.
Save crcrpar/5657bb198c2651f7ac0cdaa03a863137 to your computer and use it in GitHub Desktop.
VSCode Dev Container Configuration for Optuna
If you want to use VSCode's fantastic feature: Dev Container, put the `devcontainer.json` in `.devcontainer` directory.
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.128.0/containers/docker-existing-dockerfile
{
"name": "Optuna Dev",
// 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",
// If you want to use the official built images, uncomment below and comment out the above line
// "image": "optuna/optuna:py3.7-dev",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",
"workspaceFolder": "/workspace",
// Set *default* container specific settings.json values on container create.
"settings": {
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/.hg/store/**": true
},
"python.pythonPath": "/usr/local/bin/python3",
"python.formatting.provider": "black",
"python.linting.lintOnSave": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Path": "/usr/local/bin/flake8",
"python.linting.mypyEnabled": true,
"python.linting.mypyPath": "/usr/local/bin/mypy",
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"redhat.vscode-yaml",
"bungcip.better-toml",
"lextudio.restructuredtext",
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Uncomment the next line to run commands after the container is created - for example installing curl.
// Uncomment the below if you are using Optuna official docker images like optuna/optuna:py3.7-dev
// "postCreateCommand": "pip install -e '.[testing,integration]'",
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment