forked from taginfo/dockerized-taginfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
170 lines (130 loc) · 6.25 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
.PHONY: all
all: refresh build
test: build testdatainit init ca-zz-genservices ca-zz-test peakcheck
refresh:
docker pull abiosoft/caddy
docker pull ruby:2.5-alpine3.7
docker pull jwilder/nginx-proxy
docker pull jwilder/whoami
docker pull mdillon/postgis:10
docker pull ubuntu:18.04
build:
cd ./docker && docker build -t taginfo_job -f taginfo_job.Dockerfile . && cd ..
cd ./docker && docker build -t taginfo_view -f taginfo_view.Dockerfile . && cd ..
docker images | grep taginfo
dev:
docker-compose run --rm taginfo_dev /bin/bash
dev_view:
docker run -it --rm taginfo_view sh
cleanold:
sudo rm ./service/*/*/data/old/*
sudo rm ./service/*/*/input/area.osm.pbf
df -h | grep /dev
down:
docker-compose down
testdatainit:
mkdir -p ./ne
cp ./testdata/planet.osm.pbf ./import_admin/
cp ./testdata/NE1_50M_SR.zip ./ne/
cd ./ne && unzip -o NE1_50M_SR.zip
cp ./ne/NE1_50M_SR/NE1_50M_SR.tif ./ne/ne.tif
cp ./ne/NE1_50M_SR/NE1_50M_SR.prj ./ne/ne.prj
cp ./ne/NE1_50M_SR/NE1_50M_SR.tfw ./ne/ne.tfw
ls ./ne/* -la
ca-zz-genservices:
./taginfo_genconfig.sh central-america zz 30000 "--" "length(osm.iso)=2 or substr(osm.iso,1,2) in ('nl') "
ca-zz-test:
cd ./service/zz && ./service_create.sh && cd ../..
cd ./service/zz && ./service_job.sh && cd ../..
cd ./service/zz && ./service_down.sh && cd ../..
naturalearth:
docker-compose run --rm -T taginfo_dev /osm/setup/natural_earth_download.sh
init:
docker-compose run --rm -T taginfo_dev /osm/setup/init.sh
genservices: af-genservices aq-genservices as-genservices ao-genservices ca-genservices eu-genservices na-genservices ru-genservices sa-genservices
af-genservices:
./taginfo_genconfig.sh africa af 10000 "where iso not in('bv')" "length(osm.iso)=2 or substr(osm.iso,1,2) in ('fr','nl','es','dk') "
aq-genservices:
./taginfo_genconfig.sh antarctica aq 12000 "--" "1=1 "
as-genservices:
./taginfo_genconfig.sh asia as 14000 "where (area_pct > 0.8) and (iso not in ('ru','fr','nl'))" "length(osm.iso)=2 or substr(osm.iso,1,2) in ('fr','nl','es','dk') "
ao-genservices:
./taginfo_genconfig.sh australia-oceania ao 16000 "--" "length(osm.iso)=2 or substr(osm.iso,1,2) in ('fr','nl','es','us') "
ca-genservices:
./taginfo_genconfig.sh central-america ca 18000 "--" "length(osm.iso)=2 or substr(osm.iso,1,2) in ('fr','nl','es','dk') "
eu-genservices:
./taginfo_genconfig.sh europe eu 20000 "where iso not in ('fr','de')" "length(osm.iso)=2 or substr(osm.iso,1,2) in ('fr','nl','es','dk') "
na-genservices:
./taginfo_genconfig.sh north-america na 22000 "where iso not in ('us','ca')" "length(osm.iso)=2 or substr(osm.iso,1,2) in ('fr','nl','es','dk','us','ca') "
ru-genservices:
./taginfo_genconfig.sh russia ru 24000 "where iso like 'ru-%'" "length(osm.iso)>2"
sa-genservices:
./taginfo_genconfig.sh south-america sa 26000 "--" "length(osm.iso)=2 or substr(osm.iso,1,2) in ('fr','nl') "
runservices:
./taginfo_run_service_refresh.sh africa af 10000
./taginfo_run_service_refresh.sh antarctica aq 12000
./taginfo_run_service_refresh.sh asia as 14000
./taginfo_run_service_refresh.sh australia-oceania ao 16000
./taginfo_run_service_refresh.sh central-america ca 18000
./taginfo_run_service_refresh.sh europe eu 20000
./taginfo_run_service_refresh.sh north-america na 22000
./taginfo_run_service_refresh.sh russia ru 24000
./taginfo_run_service_refresh.sh south-america sa 26000
genproxy:
docker-compose run --rm -T taginfo_dev /osm/setup/genhugo.sh
startproxy:
pushd ./service/ca
docker-compose -f docker-compose-proxy.yml up -d
popd
service-create:
cd ./service/af && ./service_create.sh && cd ../..
cd ./service/ao && ./service_create.sh && cd ../..
cd ./service/aq && ./service_create.sh && cd ../..
cd ./service/as && ./service_create.sh && cd ../..
cd ./service/ca && ./service_create.sh && cd ../..
cd ./service/eu && ./service_create.sh && cd ../..
cd ./service/na && ./service_create.sh && cd ../..
cd ./service/ru && ./service_create.sh && cd ../..
cd ./service/sa && ./service_create.sh && cd ../..
service-up:
cd ./service/af && ./service_up.sh && cd ../..
cd ./service/ao && ./service_up.sh && cd ../..
cd ./service/aq && ./service_up.sh && cd ../..
cd ./service/as && ./service_up.sh && cd ../..
cd ./service/ca && ./service_up.sh && cd ../..
cd ./service/eu && ./service_up.sh && cd ../..
cd ./service/na && ./service_up.sh && cd ../..
cd ./service/ru && ./service_up.sh && cd ../..
cd ./service/sa && ./service_up.sh && cd ../..
service-down:
cd ./service/af && ./service_down.sh && cd ../..
cd ./service/ao && ./service_down.sh && cd ../..
cd ./service/aq && ./service_down.sh && cd ../..
cd ./service/as && ./service_down.sh && cd ../..
cd ./service/ca && ./service_down.sh && cd ../..
cd ./service/eu && ./service_down.sh && cd ../..
cd ./service/na && ./service_down.sh && cd ../..
cd ./service/ru && ./service_down.sh && cd ../..
cd ./service/sa && ./service_down.sh && cd ../..
service-job:
cd ./service/af && ./service_job.sh && cd ../..
cd ./service/ao && ./service_job.sh && cd ../..
cd ./service/aq && ./service_job.sh && cd ../..
cd ./service/as && ./service_job.sh && cd ../..
cd ./service/ca && ./service_job.sh && cd ../..
cd ./service/eu && ./service_job.sh && cd ../..
cd ./service/na && ./service_job.sh && cd ../..
cd ./service/ru && ./service_job.sh && cd ../..
cd ./service/sa && ./service_job.sh && cd ../..
peakcheck:
cat ./service/*/*/sources/log/*.log | grep peak: | cut -d':' -f3 | sort -h | uniq
cat ./service/*/*/joblog/*.log | grep "Peak" | cut -d':' -f3 | sort -h | uniq
dockerstat:
docker stats --format "table {{.Name}}\t {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}"
listtemposmpbf:
ls ./service/*/*/input/*.osm.pbf
listoldtaginfo:
ls ./service/*/*/data/old/*
rmtempdata:
rm -f ./service/*/*/input/*.osm.pbf
rm -f ./service/*/*/data/old/*