Hannes Kuchelmeister commited on
Commit
8d9de2d
1 Parent(s): 1486604

make docker-files runnable on GPUs

Browse files
models/DockerfileCUDA ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM pytorch/pytorch:1.9.1-cuda11.1-cudnn8-runtime
2
+
3
+ WORKDIR /usr/src/app
4
+
5
+ RUN apt-get update
6
+ RUN apt-get install libgl1 -y
7
+
8
+ COPY requirements.txt ./
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ COPY . .
12
+
models/docker-compose.cuda.yml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3"
2
+ services:
3
+ model-cuda:
4
+ build:
5
+ context: .
6
+ dockerfile: DockerfileCUDA
7
+ tty: true
8
+ deploy:
9
+ resources:
10
+ reservations:
11
+ devices:
12
+ - driver: nvidia
13
+ count: 1
14
+ capabilities: [gpu]
15
+ volumes:
16
+ - ./logs/:/usr/src/app/logs:z
17
+ - ./data/:/usr/src/app/data:z
18
+ - ./configs:/usr/src/app/configs:z
19
+ command: sh -c "python train.py logger=tensorboard trainer.gpus=1"
20
+ tensorboard:
21
+ image: tensorflow/tensorflow
22
+ volumes:
23
+ - ./logs:/logs:z
24
+ command: sh -c "tensorboard --logdir /logs --bind_all"
25
+ ports:
26
+ - 8008:6006
models/docker-compose.yml CHANGED
@@ -1,7 +1,10 @@
1
  version: "3"
2
  services:
3
  model:
4
- build: .
 
 
 
5
  volumes:
6
  - ./logs/:/usr/src/app/logs:z
7
  - ./data/:/usr/src/app/data:z
@@ -13,4 +16,4 @@ services:
13
  - ./logs:/logs:z
14
  command: sh -c "tensorboard --logdir /logs --bind_all"
15
  ports:
16
- - 6006:6006
 
1
  version: "3"
2
  services:
3
  model:
4
+ build:
5
+ context: .
6
+ dockerfile: Dockerfile
7
+ tty: true
8
  volumes:
9
  - ./logs/:/usr/src/app/logs:z
10
  - ./data/:/usr/src/app/data:z
 
16
  - ./logs:/logs:z
17
  command: sh -c "tensorboard --logdir /logs --bind_all"
18
  ports:
19
+ - 8008:6006