-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
38 lines (26 loc) · 1.38 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
image=$(shell cat IMAGE | cut -d: -f1)
tag=$(shell cat IMAGE | cut -d: -f2)
port?=9000
build: package-build docker-build
package-build:
python3 -m build
docker-build:
docker build ${buildopt} -t ${image} .
docker tag ${image}:latest ${image}:${tag}
docker push ${image}:latest
docker push ${image}:${tag}
docker-amd:
docker build -f Dockerfile.amd -t ${image}:amd .
gpus?=--gpus all
# flags=${gpus} --rm -u $(shell id -u) -w /work -v ${PWD}:/work -e HOME=/work -e DOCKER_WORKDIR=${PWD} -v /var/run/docker.sock:/var/run/docker.sock --entrypoint /work/start_in_venv.sh
flags=${gpus} --rm -u $(shell id -u) --group-add $(shell grep docker /etc/group | cut -f3 -d:) -w /work -v ${PWD}:/work -e HOME=/work -e DOCKER_WORKDIR=${PWD} -v /var/run/docker.sock:/var/run/docker.sock
# flags=--rm -p ${port}:${port} -u $(shell id -u) -w /work -v ${PWD}:/work -e HOME=/work --entrypoint /usr/bin/env
amdflags=--rm -u $(shell id -u) -w /work -v ${PWD}:/work -e HOME=/work --entrypoint /work/start_in_venv.sh -p ${port}:${port} --device=/dev/kfd --device=/dev/dri --shm-size 16G --group-add video --group-add render
lab notebook:
docker run ${flags} -p ${port}:${port} ${image}:${tag} jupyter-$@ --ip 0.0.0.0 --port ${port}
bash:
docker run -ti ${flags} -p ${port}:${port} ${image}:${tag} bash
nonet:
docker run -ti ${flags} ${image}:${tag} bash
amd:
docker run -ti ${amdflags} ${image}:amd bash