This repository was archived by the owner on Dec 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (54 loc) · 1.32 KB
/
Makefile
File metadata and controls
68 lines (54 loc) · 1.32 KB
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
65
66
67
68
DOCKER_REPO=gcr.io/brainscode-140622/tf-ipynb
TAG=v35
NBDIME_URL=http://host.docker.internal:8081/d/
CHART := tf-ipynb
HELM := $(shell which helm)
.PHONY: build
build: #lint
docker build -t ${DOCKER_REPO}:${TAG} .
.PHONY: run
run:
docker run -it -p 8080:80 \
-v /tmp/notebooks:/notebooks \
-v "${PWD}"/cluster_setup/:/secrets \
-e NBDIME_URL=${NBDIME_URL} \
-e GOOGLE_APPLICATION_CREDENTIALS="/secrets/tf2up.json" \
${DOCKER_REPO}:${TAG}
.PHONY: push
push:
gcloud docker -- push ${DOCKER_REPO}:${TAG}
# TODO: add env here
.PHONY: deploy
deploy:
${HELM} lint ${CHART}
${HELM} upgrade --install ${CHART} ./${CHART} \
--debug #--dry-run
.PHONY: purge
purge:
helm del --purge ${CHART}
# ====== nbdime part
.PHONY: nbbuild
nbbuild:
docker build -t ${DOCKER_REPO}.nbdime:${TAG} -f Dockerfile.nbdime .
.PHONY: nbrun
nbrun:
docker run -it -p 8081:81 \
-v /tmp/notebooks:/notebooks \
${DOCKER_REPO}.nbdime:${TAG}
.PHONY: nbpush
nbpush:
gcloud docker -- push ${DOCKER_REPO}.nbdime:${TAG}
# ===== GCP
.PHONY: keys_update
keys_update:
kubectl delete secret tf2up-key || true
kubectl create secret generic tf2up-key \
--from-file=google.json=cluster_setup/tf2up.json
# ===== lint
.PHONY: lint
lint:
mypy \
--config-file=configs/mypy.ini \
src/
@echo '========================================'
pylint src/main.py