-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
65 lines (48 loc) · 1.92 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
WORK_DIR ?= $(PWD)
DOCKER_IMAGE ?= feel/ganimede
###########################
# General targets
###########################
test:
docker exec -it ganimede /bin/bash -c 'papermill work/tests/test_notebook.ipynb /tmp/test_notebook_output.ipynb'
docker exec -it ganimede /bin/bash -c 'papermill -k pysparkkernel work/tests/test_sparkmagic.ipynb /tmp/test_sparkmagic_output.ipynb'
docker exec -it ganimede /bin/bash -c 'work/tests/test_tools_imports.py'
docker exec -it ganimede /bin/bash -c 'work/tests/test_libraries_imports.py'
###########################
# Docker related targets
###########################
# `--pull` attempts to pull latest version of base image:
docker-build:
docker image build --rm --pull -t $(DOCKER_IMAGE) -f Dockerfile .
docker-push:
echo "$(DOCKER_PASSWORD)" | docker login -u "$(DOCKER_USERNAME)" --password-stdin docker.io
docker push $(DOCKER_IMAGE)
docker-pull:
docker pull $(DOCKER_IMAGE)
docker-run-base:
docker run -p 8888:8888 \
$(DOCKER_ARGS) \
-v "$(WORK_DIR)":/home/jovyan/work \
-e JUPYTER_ENABLE_LAB="1" \
--name ganimede $(DOCKER_IMAGE) start-ganimede.sh --LabApp.token=''
docker-run: DOCKER_ARGS += --rm
docker-run: docker-run-base
docker-background-run: DOCKER_ARGS += -d
docker-background-run: docker-run
docker-boot-run: DOCKER_ARGS += -d --restart unless-stopped
docker-boot-run: docker-run-base
docker-shell:
docker exec $(DOCKER_ARGS) -it ganimede /bin/bash
docker-shell-root: DOCKER_ARGS += -u root
docker-shell-root: docker-shell
###########################
# Systemd related targets
###########################
setup-systemd-service:
mkdir -p ${HOME}/.config/systemd/user/
cp ganimede.service ${HOME}/.config/systemd/user/
sed -i -e "s@%h@$(WORK_DIR)@g" ${HOME}/.config/systemd/user/ganimede.service
systemctl --user daemon-reload
systemctl --user enable ganimede.service
start-systemd-service: setup-systemd-service
systemctl --user start ganimede.service