-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
43 lines (41 loc) · 2.37 KB
/
buildspec.yml
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
version: 0.2
env:
variables:
# WARNING! you _must_ set this in the codebuild GUI.
BUCKET_PREFIX: ""
# this is set to the latest available planet if you don't override it in the GUI!
PLANET_DATE: ""
# set this to a unique identifier for the run. Defaults to the planet date.
RUN_ID: ""
# versions (git hashes, branches or tags) of software to install on the TPS instance. note that the version of cron.py that's run is determined by the uploaded version of the codebuild package, not this environment variable!
RAW_TILES_VERSION: master
TILEQUEUE_VERSION: master
VECTOR_DATASOURCE_VERSION: master
TILEOPS_VERSION: master
# overrides for Batch job environment, which can override the config. for example, if we wanted to override the meta-batch S3 store name (i.e: bucket), then we could set META_BATCH__TILEQUEUE__STORE__NAME=whatever.
JOB_ENV_OVERRIDES: ""
# number of database replicas to use, and number of vCPUs to request in the Batch environment. these numbers should be balanced, as having too many Batch jobs hammering the databases can result in lower or even zero progress as they all contend for database connection slots.
NUM_DB_REPLICAS: 10
MAX_VCPUS: 32768
phases:
install:
commands:
- pip install pipenv
# temporary hack around https://github.com/pypa/pipenv/issues/2924
- pipenv run pip install pip==18.0
- pipenv sync
build:
commands:
# set planet date to latest planet, if it wasn't already set by the environment.
- >
if [ -z "$PLANET_DATE" ]; then
PLANET_DATE=`curl -Is https://planet.openstreetmap.org/planet/planet-latest.osm.bz2 |
grep "Location: " |
sed 's,.*/planet-\([0-9]\{6\}\).osm.bz2\r$,\1,;t ok;q 1;:ok'`;
fi
# set a run ID to the planet date, if it wasn't already overridden in the environment.
- >
if [ -z "$RUN_ID" ]; then
RUN_ID="$PLANET_DATE";
fi
- pipenv run python batch-setup/cron.py --bucket-prefix $BUCKET_PREFIX --raw-tiles-version $RAW_TILES_VERSION --tilequeue-version $TILEQUEUE_VERSION --vector-datasource-version $VECTOR_DATASOURCE_VERSION --tileops-version $TILEOPS_VERSION --ec2-instance-type t2.medium --run-id $RUN_ID $PLANET_DATE --max-vcpus $MAX_VCPUS --num-db-replicas $NUM_DB_REPLICAS --job-env-overrides $JOB_ENV_OVERRIDES