-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
151 lines (126 loc) · 5.66 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
.PHONY: clean dirs dev images gwvolman_src wholetale_src dms_src home_src sources \
rebuild_dashboard watch_dashboard \
restart_worker restart_girder globus_handler_src status update_src
SUBDIRS = src volumes/ps volumes/workspaces volumes/homes volumes/base volumes/versions volumes/runs volumes/licenses volumes/mountpoints volumes/tmp
TAG = latest
MEM_LIMIT = 2048
NODE = node --max_old_space_size=${MEM_LIMIT}
NG = ${NODE} ./node_modules/@angular/cli/bin/ng
YARN = /usr/local/bin/yarn
images:
docker pull traefik:alpine
docker pull mongo:3.2
docker pull redis:latest
docker pull registry:2.6
docker pull node:carbon-slim
docker pull wholetale/girder:$(TAG)
docker pull wholetale/gwvolman:$(TAG)
docker pull wholetale/repo2docker_wholetale:$(TAG)
docker pull wholetale/ngx-dashboard:$(TAG)
src/girderfs:
git clone https://github.com/whole-tale/girderfs src/girderfs
src/gwvolman:
git clone https://github.com/whole-tale/gwvolman src/gwvolman
src/wholetale:
git clone https://github.com/whole-tale/girder_wholetale src/wholetale
src/wt_data_manager:
git clone https://github.com/whole-tale/girder_wt_data_manager src/wt_data_manager
src/wt_home_dir:
git clone https://github.com/whole-tale/wt_home_dirs src/wt_home_dir
src/wt_versioning:
git clone https://github.com/whole-tale/wt_versioning src/wt_versioning
src/virtual_resources:
git clone https://github.com/whole-tale/virtual_resources src/virtual_resources
src/globus_handler:
git clone https://github.com/whole-tale/globus_handler src/globus_handler
src/ngx-dashboard:
git clone https://github.com/whole-tale/ngx-dashboard src/ngx-dashboard
sources: src src/gwvolman src/wholetale src/wt_data_manager src/wt_home_dir src/globus_handler src/girderfs src/ngx-dashboard src/virtual_resources src/wt_versioning
dirs: $(SUBDIRS)
$(SUBDIRS):
@sudo mkdir -p $@
services: dirs sources
dev: services
. ./.env && docker stack config --compose-file docker-stack.yml | docker stack deploy --compose-file - wt
cid=$$(docker ps --filter=name=wt_girder -q);
while [ -z $${cid} ] ; do \
echo $${cid} ; \
sleep 1 ; \
cid=$$(docker ps --filter=name=wt_girder -q) ; \
done; \
true
docker exec -ti $$(docker ps --filter=name=wt_girder -q) girder-install plugin plugins/wt_data_manager plugins/wholetale plugins/wt_home_dir plugins/globus_handler plugins/virtual_resources plugins/wt_versioning
docker exec -ti $$(docker ps --filter=name=wt_girder -q) girder-install web --dev --plugins=oauth,gravatar,jobs,worker,wt_data_manager,wholetale,wt_home_dir,globus_handler
docker exec --user=root -ti $$(docker ps --filter=name=wt_girder -q) pip install -r /gwvolman/requirements.txt -e /gwvolman
docker exec --user=root -ti $$(docker ps --filter=name=wt_girder -q) pip install -e /girderfs
./setup_girder.py
restart_girder:
which jq || (echo "Please install jq to execute the 'restart_girder' make target" && exit 1)
docker exec --user=root -ti $$(docker ps --filter=name=wt_girder -q) pip install -r /gwvolman/requirements.txt -e /gwvolman
docker exec -ti $$(docker ps --filter=name=wt_girder -q) \
curl -XPUT -s 'http://localhost:8080/api/v1/system/restart' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Content-Length: 0' \
--header "Girder-Token: $$(docker exec -ti $$(docker ps --filter=name=wt_girder -q) \
curl 'http://localhost:8080/api/v1/user/authentication' \
--basic --user admin:arglebargle123 \
| jq -r .authToken.token)"
rebuild_dashboard:
docker run \
--rm \
--user=$${UID}:$${GID} \
-ti \
-e NODE_OPTIONS=--max-old-space-size=4096 \
-v $${PWD}/src/ngx-dashboard:/srv/app \
--entrypoint /bin/sh \
-w /srv/app node:fermium \
-c 'yarn install --network-timeout=360000 && \
./node_modules/@angular/cli/bin/ng build --deleteOutputPath=false --progress'
watch_dashboard:
docker run \
--rm \
--user=$${UID}:$${GID} \
-ti \
-e NODE_OPTIONS=--max-old-space-size=4096 \
-v $${PWD}/src/ngx-dashboard:/srv/app \
-w /srv/app \
--entrypoint /bin/sh \
node:fermium \
-c 'yarn install --network-timeout=360000 && \
./node_modules/@angular/cli/bin/ng build --watch --poll 15000 --deleteOutputPath=false --progress'
restart_worker:
docker exec --user=root -ti $$(docker ps --filter=name=wt_girder -q) pip install -e /gwvolman
docker service update --force --image=$$(docker service inspect wt_celery_worker --format={{.Spec.TaskTemplate.ContainerSpec.Image}}) wt_celery_worker
tail_girder_err:
docker exec -ti $$(docker ps --filter=name=wt_girder -q) \
tail -n 200 /home/girder/.girder/logs/error.log
reset_girder:
docker exec -ti $$(docker ps --filter=name=wt_girder -q) \
python3 -c 'from girder.models import getDbConnection;getDbConnection().drop_database("girder")'
clean:
-./destroy_instances.py
-docker stack rm wt
limit=15 ; \
until [ -z "$$(docker service ls --filter label=com.docker.stack.namespace=wt -q)" ] || [ "$${limit}" -lt 0 ]; do \
sleep 2 ; \
limit="$$((limit-1))" ; \
done; true
limit=15 ; \
until [ -z "$$(docker network ls --filter label=com.docker.stack.namespace=wt -q)" ] || [ "$${limit}" -lt 0 ]; do \
sleep 2 ; \
limit="$$((limit-1))" ; \
done; true
for dir in volumes/mountpoints/* ; do \
for subdir in $$dir/* ; do \
sudo umount -lf $$subdir || true ; \
done \
done; true
for dir in ps workspaces homes base versions runs mountpoints ; do \
sudo rm -rf volumes/$$dir ; \
done; true
-docker volume rm wt_mongo-cfg wt_mongo-data
status:
@-./scripts/git_status.sh
update_src:
@-./scripts/git_pull_master.sh