feat: YAY, working devcontainers

Former-commit-id: d8d73b022405033c85e4c70645f1e73a388ded9d [formerly 644d6ccb89271e4ae024ddf2151e6ce3df7fdba6]
Former-commit-id: e1097534f05dddef9e6473112ff558c5df2a8001
This commit is contained in:
Laurent Fainsin 2022-09-13 11:06:06 +02:00
parent fe75873865
commit 8959b99947
4 changed files with 37 additions and 15 deletions

View file

@ -2,8 +2,13 @@ FROM nvidia/cuda:11.7.1-cudnn8-devel-ubuntu20.04
WORKDIR /workspace
ARG USERNAME=vscode
ARG UID=1000
ARG GID=${UID}
COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive UID=1000 GID=1000 \
RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& /bin/bash /tmp/library-scripts/common-debian.sh \
&& apt-get install -y python3 python3-pip && pip install --upgrade pip --no-input \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts

View file

@ -4,8 +4,20 @@
"service": "dev",
"remoteUser": "vscode",
"workspaceFolder": "/workspace",
"postAttachCommand": "poetry install --with all",
"extensions": [
"ms-vscode-remote.remote-containers",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig",
"njpwerner.autodocstring",
"ms-python.python",
"ms-toolsai.jupyter"
],
"runArgs": [
"--gpus",
"all"
],
"forwardPorts": [
8080
],
"postAttachCommand": "poetry install --with all"
]
}

View file

@ -1,18 +1,6 @@
version: "3"
services:
# development container
dev:
container_name: dev
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspace
stdin_open: true
# network_mode: service:wandb
# wandb dashboard
wandb:
hostname: wandb-local
@ -23,3 +11,20 @@ services:
ports:
- 8080:8080
restart: unless-stopped
# development container
dev:
container_name: dev
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspace
stdin_open: true
network_mode: service:wandb
deploy:
resources:
reservations:
devices:
- capabilities:
- gpu

View file