diff --git a/.devcontainer/compose.yaml b/.devcontainer/compose.yaml new file mode 100644 index 0000000..c0a929f --- /dev/null +++ b/.devcontainer/compose.yaml @@ -0,0 +1,19 @@ +version: '2.23' +services: + service_container_lab: + build: + context: ../ + dockerfile: ./Dockerfile + container_name: laboratoires_container + stdin_open: true + tty: true + deploy: + resources: + reservations: + devices: + - driver: nvidia + capabilities: [gpu] + volumes: + - ../:/workspace:cached + + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..0a61029 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,23 @@ +{ + "name": "deep-learning-class-dev", + "dockerComposeFile": [ + "compose.yaml" // the docker compose file that we want to run + ], + "workspaceFolder": "/workspace/", + // "workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/project,type=bind", + "service": "service_container_lab", // The service in docker-compose.yml that we want vs code to use as a dev containers + "shutdownAction": "stopCompose", + "customizations": { + "vscode": { + "extensions": [ + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance", + "ms-python.python", + "ms-toolsai.jupyter-keymap" + ] + } + } +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..197e064 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM nvidia/cuda:11.4.3-base-ubuntu20.04 + +# Set environment variables +ENV DEBIAN_FRONTEND=noninteractive + +# Install system dependencies +RUN apt-get update && \ + apt-get install -y \ + git \ + python3-pip \ + python3-dev \ + python3-opencv \ + libglib2.0-0 + +# WORKDIR /workspace/ + +# Install any python packages you need +COPY ./requirements.txt requirements.txt +COPY ./setup.py setup.py +COPY ./deeplib/ deeplib/ + +# Upgrade pip +RUN python3 -m pip install --upgrade pip + +# Install PyTorch and torchvision +RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 +RUN python3 -m pip install -r requirements.txt +RUN pip install . + + +# Set the working directory +WORKDIR /workspace/