-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.windows-airgap.yml
More file actions
149 lines (144 loc) · 5.13 KB
/
Copy pathcompose.windows-airgap.yml
File metadata and controls
149 lines (144 loc) · 5.13 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
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
services:
tiles-generator:
profiles: ["generate"]
image: "${TILES_IMAGE:?Set TILES_IMAGE to the Artifactory tile-generator image}"
pull_policy: missing
restart: "no"
env_file:
- .env.windows-airgap
environment:
RELEASE: "${OVERTURE_RELEASE:?Set OVERTURE_RELEASE}"
THEME: "${THEME:-places}"
BBOX: "${BBOX:-}"
SOURCE_PATH: "s3://${S3_BUCKET:?Set S3_BUCKET}/${SOURCE_RELEASE_PREFIX:-release}/${OVERTURE_RELEASE:?Set OVERTURE_RELEASE}"
OUTPUT: /output
PRESERVE_PARQUET: "${PRESERVE_PARQUET:-true}"
S3_REGION: "${S3_REGION:?Set S3_REGION}"
AWS_REGION: "${S3_REGION:?Set S3_REGION}"
S3_ENDPOINT_URL: "${S3_ENDPOINT_URL:?Set S3_ENDPOINT_URL}"
AWS_EC2_METADATA_DISABLED: "true"
volumes:
- tiles_output:/output/tiles
- parquet_output:/output/data
security_opt:
- no-new-privileges:true
publish-pmtiles:
image: "${TILES_IMAGE:?Set TILES_IMAGE to the Artifactory tile-generator image}"
pull_policy: missing
restart: "no"
env_file:
- .env.windows-airgap
environment:
RELEASE: "${OVERTURE_RELEASE:?Set OVERTURE_RELEASE}"
PMTILES_S3_PATH: "s3://${S3_BUCKET:?Set S3_BUCKET}/${PMTILES_RELEASE_PREFIX:-pmtiles/release}/${OVERTURE_RELEASE:?Set OVERTURE_RELEASE}"
S3_REGION: "${S3_REGION:?Set S3_REGION}"
AWS_REGION: "${S3_REGION:?Set S3_REGION}"
S3_ENDPOINT_URL: "${S3_ENDPOINT_URL:?Set S3_ENDPOINT_URL}"
AWS_EC2_METADATA_DISABLED: "true"
entrypoint:
- /bin/bash
- -euc
command:
- |
test -d "/output/tiles/$$RELEASE"
test -n "$$(find "/output/tiles/$$RELEASE" -maxdepth 1 -type f -name '*.pmtiles' -print -quit)"
s5cmd sync "/output/tiles/$$RELEASE/*" "$${PMTILES_S3_PATH%/}/"
s5cmd ls "$${PMTILES_S3_PATH%/}/*.pmtiles"
volumes:
- tiles_output:/output/tiles:ro
security_opt:
- no-new-privileges:true
catalog:
image: "${CATALOG_IMAGE:?Set CATALOG_IMAGE to the Artifactory Node runtime image}"
pull_policy: missing
restart: "no"
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
RELEASE: "${OVERTURE_RELEASE:?Set OVERTURE_RELEASE}"
BBOX: "${BBOX:-}"
DOWNLOAD_MIN_ZOOM: "${DOWNLOAD_MIN_ZOOM:-15}"
PMTILES_HTTP_BASE: "${PMTILES_HTTP_BASE:?Set PMTILES_HTTP_BASE to the browser-accessible PMTiles release URL}"
depends_on:
publish-pmtiles:
condition: service_completed_successfully
entrypoint:
- /bin/sh
- -euc
command:
- |
if [ -n "$$BBOX" ]; then
node /app/generate-airgap-catalog.mjs \
--release "$$RELEASE" \
--tiles-dir "/output/tiles/$$RELEASE" \
--data-dir "/output/data/release/$$RELEASE" \
--out-dir /output/catalog \
--bbox "$$BBOX" \
--tile-base "$$PMTILES_HTTP_BASE"
else
node /app/generate-airgap-catalog.mjs \
--release "$$RELEASE" \
--tiles-dir "/output/tiles/$$RELEASE" \
--data-dir "/output/data/release/$$RELEASE" \
--out-dir /output/catalog \
--tile-base "$$PMTILES_HTTP_BASE"
fi
node -e '
const fs = require("node:fs");
const release = process.env.RELEASE;
const minZoom = Number(process.env.DOWNLOAD_MIN_ZOOM);
if (!Number.isInteger(minZoom) || minZoom < 0 || minZoom > 24) {
throw new Error("DOWNLOAD_MIN_ZOOM must be an integer from 0 through 24");
}
const config = {
stacCatalogUrl: "/catalog/catalog.json",
downloadBaseUrl: `/data/release/$${release}/`,
releaseId: release,
geocoderBaseUrl: null,
features: { search: false, download: true, externalDocs: false },
download: { minZoom },
};
fs.writeFileSync("/output/config/viewer-config.json", `$${JSON.stringify(config, null, 2)}\n`);
'
volumes:
- ./scripts/generate-airgap-catalog.mjs:/app/generate-airgap-catalog.mjs:ro
- tiles_output:/output/tiles:ro
- parquet_output:/output/data:ro
- catalog_output:/output/catalog
- viewer_config:/output/config
tmpfs:
- /tmp
viewer:
image: "${VIEWER_IMAGE:?Set VIEWER_IMAGE to the Artifactory viewer image}"
pull_policy: missing
restart: unless-stopped
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
depends_on:
catalog:
condition: service_completed_successfully
ports:
- "${VIEWER_PORT:-8088}:8080"
volumes:
- parquet_output:/usr/share/nginx/html/data:ro
- catalog_output:/usr/share/nginx/html/catalog:ro
- viewer_config:/usr/share/nginx/html/config:ro
tmpfs:
- /tmp
- /var/cache/nginx
- /var/run
volumes:
tiles_output:
name: "${OUTPUT_VOLUME_PREFIX:-overture-airgap}-tiles"
parquet_output:
name: "${OUTPUT_VOLUME_PREFIX:-overture-airgap}-data"
catalog_output:
name: "${OUTPUT_VOLUME_PREFIX:-overture-airgap}-catalog"
viewer_config:
name: "${OUTPUT_VOLUME_PREFIX:-overture-airgap}-config"