From 3021ffa1b2d1a36855baa214fa8490070275b47b Mon Sep 17 00:00:00 2001 From: Matthew Mazzola Date: Sun, 3 Mar 2024 18:02:07 +0000 Subject: [PATCH] Update devcontainer --- .devcontainer/Dockerfile | 30 ++++++++++++++++++++++++++++++ .devcontainer/devcontainer.env | 1 - .devcontainer/devcontainer.json | 30 +++++++++++++++++------------- .devcontainer/postCreateCommand.sh | 1 + requirements.txt | 7 +++++++ 5 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 requirements.txt diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..e1bb3f8 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -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 + diff --git a/.devcontainer/devcontainer.env b/.devcontainer/devcontainer.env index 9b9352a..9188edc 100644 --- a/.devcontainer/devcontainer.env +++ b/.devcontainer/devcontainer.env @@ -1,3 +1,2 @@ # Control the number of GPUs visible to scripts CUDA_VISIBLE_DEVICES=0,1 - diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 38ab34a..4a9277a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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, @@ -27,7 +29,9 @@ "path": "/usr/bin/zsh" }, }, - "[python]": {} + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter" + }, }, "extensions": [ "aaron-bond.better-comments", @@ -54,7 +58,7 @@ "yzhang.markdown-all-in-one" ] } - }, + }, "runArgs": [ "--gpus", "all", diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 17c7332..7866df6 100644 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -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!" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..424e956 --- /dev/null +++ b/requirements.txt @@ -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