This repository was archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
61 lines (52 loc) · 1.87 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
ROOT_REPO:=jupyter/all-spark-notebook:258e25c03cba
CONTAINER_NAME:=declarativewidgets-explorer
REPO:=jupyter/declarativewidgets-explorer:258e25c03cba
define INSTALL_DECLWID_CMD
pip install --no-binary ::all: $$(ls -1 /srv/*.tar.gz | tail -n 1) && \
jupyter declarativewidgets install --user && \
jupyter declarativewidgets activate
endef
define INSTALL_DASHBOARD_CMD
pip install --no-binary ::all: jupyter_dashboards && \
jupyter dashboards install --user && \
jupyter dashboards activate
endef
define INSTALL_LIBS
pip install numexpr
endef
init: node_modules
@-docker $(DOCKER_OPTS) rm -f $(CONTAINER_NAME)
@docker $(DOCKER_OPTS) run -it --user root --name $(CONTAINER_NAME) \
-v `pwd`:/srv \
$(ROOT_REPO) bash -c 'apt-get -qq update && \
apt-get -qq install --yes curl && \
curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash - && \
apt-get -qq install --yes nodejs npm && \
ln -s /usr/bin/nodejs /usr/bin/node && \
npm install -g bower && \
$(INSTALL_DECLWID_CMD) && \
$(INSTALL_DASHBOARD_CMD) && \
$(INSTALL_LIBS)'
@docker $(DOCKER_OPTS) commit $(CONTAINER_NAME) $(REPO)
@-docker $(DOCKER_OPTS) rm -f $(CONTAINER_NAME)
node_modules: package.json
@npm install --quiet
bower_components: node_modules bower.json
@npm run bower -- install $(BOWER_OPTS)
run: PORT_MAP?=-p 8888:8888
run: CMD?=jupyter notebook --no-browser --port 8888 --ip="*"
run:
@docker $(DOCKER_OPTS) run --user root $(OPTIONS) \
$(PORT_MAP) \
-e USE_HTTP=1 \
-v `pwd`:/srv \
-v `pwd`:/root/.local/share/jupyter/nbextensions/declarativewidgets/urth_components/declarativewidgets-explorer \
--workdir '/srv/notebooks' \
--user root \
$(REPO) bash -c '$(CMD)'
test: bower_components
@bower install ../declarativewidgets/elements/urth-core-behaviors/
@bower install ../declarativewidgets/elements/urth-viz-behaviors/
@npm test
clean:
@-rm -rf bower_components node_modules