Skip to content

Commit

Permalink
Update devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmazzola committed Mar 3, 2024
1 parent 4402408 commit 3021ffa
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 14 deletions.
30 changes: 30 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu-20.04

SHELL [ "bash", "-c" ]

# update apt and install packages
RUN apt update && \
apt install -yq \
ffmpeg \
dkms \
build-essential

# add user tools
RUN sudo apt install -yq \
jq \
jp \
tree

# add git-lfs and install
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash && \
sudo apt-get install -yq git-lfs && \
git lfs install

USER vscode

# Setup conda
RUN cd /tmp && \
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash ./Miniconda3-latest-Linux-x86_64.sh -b && \
rm ./Miniconda3-latest-Linux-x86_64.sh

1 change: 0 additions & 1 deletion .devcontainer/devcontainer.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Control the number of GPUs visible to scripts
CUDA_VISIBLE_DEVICES=0,1

30 changes: 17 additions & 13 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
// 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",
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {}
},
"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.defaultInterpreterPath": "~/miniconda3/envs/mathvista/bin/python",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"isort.check": true,
Expand All @@ -27,7 +29,9 @@
"path": "/usr/bin/zsh"
},
},
"[python]": {}
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
},
"extensions": [
"aaron-bond.better-comments",
Expand All @@ -54,7 +58,7 @@
"yzhang.markdown-all-in-one"
]
}
},
},
"runArgs": [
"--gpus",
"all",
Expand Down
1 change: 1 addition & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ CUDA_VERSION=11.8
conda install -y -c nvidia cuda=$CUDA_VERSION cuda-nvcc=$CUDA_VERSION

pip install --upgrade pip
pip install -r requirements.txt

echo "postCreateCommand.sh completed!"
7 changes: 7 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
datasets==2.18.0
fire==0.5.0
openai==1.13.3
opencv-python==4.9.0.80
pillow==10.2.0
rich==13.7.1
word2number==1.1

0 comments on commit 3021ffa

Please sign in to comment.