Skip to content

Commit

Permalink
Merge pull request #6 from ogamache/devcontainer
Browse files Browse the repository at this point in the history
Created docker devcontainer
  • Loading branch information
willGuimont authored Jan 19, 2024
2 parents 79e3820 + be3784a commit 806aa70
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
@@ -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


23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
}
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/

0 comments on commit 806aa70

Please sign in to comment.