-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
31 lines (23 loc) · 1.01 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
REPO_NAME := $(shell basename `git rev-parse --show-toplevel` | tr '[:upper:]' '[:lower:]')
DOCKER_REGISTRY := mathematiguy
IMAGE := ${REPO_NAME}.sif
RUN ?= singularity exec ${FLAGS} --nv ${IMAGE}
FLAGS ?= -B $$(pwd):/code --pwd /code
SINGULARITY_ARGS ?=
.PHONY: sandbox container shell root-shell docker docker-push docker-pull enter enter-root
jupyter:
${RUN} jupyter lab --ip 0.0.0.0 --port=8888 --NotebookApp.password=$(shell singularity exec ${IMAGE} python -c "from notebook.auth import passwd; print(passwd('jupyter', 'sha1'))")
REMOTE ?= cn-f001
push:
rsync -rvahzP ${IMAGE} ${REMOTE}.server.mila.quebec:${SCRATCH}
${REPO_NAME}_sandbox:
singularity build --sandbox ${REPO_NAME}_sandbox ${IMAGE}
sandbox: ${REPO_NAME}_sandbox
sudo singularity shell --writable ${REPO_NAME}_sandbox
container: ${IMAGE}
${IMAGE}:
sudo singularity build ${IMAGE} ${SINGULARITY_ARGS} Singularity
shell:
singularity shell ${FLAGS} ${IMAGE} ${SINGULARITY_ARGS}
root-shell:
sudo singularity shell ${FLAGS} ${IMAGE} ${SINGULARITY_ARGS}