Skip to content

Commit

Permalink
Add .devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmazzola committed Mar 3, 2024
1 parent c9fea23 commit 3350606
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Control the number of GPUs visible to scripts
CUDA_VISIBLE_DEVICES=0,1

68 changes: 68 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {}
},
"postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh",
"customizations": {
"vscode": {
"settings": {
"python.analysis.autoImportCompletions": true,
"python.analysis.autoImportUserSymbols": true,
"python.defaultInterpreterPath": "~/miniconda3/envs/llava/bin/python",
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"isort.check": true,
"dev.containers.copyGitConfig": true,
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh"
},
},
"[python]": {}
},
"extensions": [
"aaron-bond.better-comments",
"alefragnani.Bookmarks",
"dotenv.dotenv-vscode",
"eamodio.gitlens",
"EditorConfig.EditorConfig",
"foxundermoon.shell-format",
"GitHub.copilot",
"lehoanganh298.json-lines-viewer",
"mechatroner.rainbow-csv",
"mhutchie.git-graph",
"ms-azuretools.vscode-docker",
"ms-dotnettools.dotnet-interactive-vscode",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort",
"ms-python.python",
"ms-python.vscode-pylance",
"njpwerner.autodocstring",
"redhat.vscode-yaml",
"stkb.rewrap",
"tamasfe.even-better-toml",
"yzhang.markdown-all-in-one"
]
}
},
"runArgs": [
"--gpus",
"all",
// "--ipc",
// "host",
"--ulimit",
"memlock=-1",
"--env-file",
".devcontainer/devcontainer.env"
],
}
26 changes: 26 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
git config --global safe.directory '*'
git config --global core.editor "code --wait"
git config --global pager.branch false

# Activate conda by default
echo "source /home/vscode/miniconda3/bin/activate" >> ~/.zshrc
echo "source /home/vscode/miniconda3/bin/activate" >> ~/.bashrc

# Use environment by default
echo "conda activate mathvista" >> ~/.zshrc
echo "conda activate mathvista" >> ~/.bashrc

# Activate conda on current shell
source /home/vscode/miniconda3/bin/activate

# Create and activate mathvista environment
conda create -n mathvista python=3.10 -y
conda activate mathvista

# Install Nvidia Cuda Compiler
CUDA_VERSION=11.8
conda install -y -c nvidia cuda=$CUDA_VERSION cuda-nvcc=$CUDA_VERSION

pip install --upgrade pip

echo "postCreateCommand.sh completed!"
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly

0 comments on commit 3350606

Please sign in to comment.