-
Notifications
You must be signed in to change notification settings - Fork 0
/
environment.sh.sample
executable file
·101 lines (75 loc) · 3.21 KB
/
environment.sh.sample
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
#!/bin/bash
# Make sure that necessary executables are installed
for b in jq aws
do
command -v $b >/dev/null 2>&1 || { echo >&2 "I require $b but it's not installed. Aborting."; exit 1; }
done
# Set allexport mode, all variables defined in this block will get exported
set -a
# Name of the stack being created
: ${HLS_STACKNAME:=hls}
# Required env settings
# LAADS DAAC Token
HLS_LAADS_TOKEN="<your token>"
# Bucket used for processing output
HLS_OUTPUT_BUCKET=hls-global
HLS_OUTPUT_BUCKET_HISTORIC=hls-gobal-historic
# Role for copying to output bucket
HLS_OUTPUT_BUCKET_ROLE_ARN=arn:aws:iam::611670965994:role/gcc-S3Test
# Landsat SNS topic
HLS_LANDSAT_SNS_TOPIC=arn:aws:sns:us-west-2:673253540267:public-c2-notify
HLS_LANDASAT_HISTORIC_SNS_TOPIC=arn:aws:sns:us-west-2:018923174646:landsat-historic-LandsatHistoricTopic643F0596-1TIGFB893SX3B
# Bucket for merged GIBS tile output.
HLS_GIBS_OUTPUT_BUCKET=hls-browse-imagery
HLS_LAADS_BUCKET_BOOTSTRAP=hls-development-laads-bucket
HLS_GIBS_OUTPUT_BUCKET_HISTORIC=hls-browse-imagery-historic
# Optional env settings
# Image for Sentinel processing
HLS_SENTINEL_ECR_URI="018923174646.dkr.ecr.us-west-2.amazonaws.com/hls-sentinel:latest"
# Image for Landsat AC processing
HLS_LANDSAT_ECR_URI="018923174646.dkr.ecr.us-west-2.amazonaws.com/hls-landsat-c2:latest"
# Image for Landsat tile processing
HLS_LANDSAT_TILE_ECR_URI="018923174646.dkr.ecr.us-west-2.amazonaws.com/hls-landsat-c2:latest"
# Image for LAADS processing
HLS_LAADS_ECR_URI="018923174646.dkr.ecr.us-west-2.amazonaws.com/hls-laads:latest"
# Schedule for updating Laads data
HLS_LAADS_CRON="cron(0 0/12 * * ? *)"
# Schedule to process incomplete Landsat tiles
HLS_LANDSAT_INCOMPLETE_CRON="cron(0 12 * * ? *)"
# Schedule to reprocess Setinel errors.
HLS_SENTINEL_ERRORS_CRON="cron(0 20 * * ? *)"
# Number of days to go back for Landsat incomplete reprocessing.
HLS_LANDSAT_DAYS_PRIOR=4
# Maximum retries to reprocess a failed Sentinel granule.
HLS_SENTINEL_RETRY_LIMIT=3
# Maximum retries to reprocess an L30 AC or MGRS tiling failure.
HLS_LANDSAT_RETRY_LIMIT=3
# Max vcpus for Batch compute environment
HLS_MAXV_CPUS=1200
# Replace existing output in S3 buckets.
HLS_REPLACE_EXISTING=true
# ssh keyname for use with Batch instance debugging.
HLS_SSH_KEYNAME=hls-mount
# Sentinel serverless downloader function role arn.
HLS_DOWNLOADER_FUNCTION_ARN=something
# GCC Specific environment settings.
GCC=false
HLS_GCC_ACCOUNT=account_id
AWS_DEFAULT_REGION=region_for_account
HLS_GCC_VPCID=vpcid
HLS_GCC_BOUNDARY_ARN=boudary_policy_arn
# Use Cloudwatch metrics for containers
# HLS_USE_CLOUD_WATCH=true
# end of allexport mode
set +a
# Set environment variables for all outputs set up in cloud formation
stack_info=$(aws cloudformation describe-stacks --stack-name ${HLS_STACKNAME} --output json)
if [[ "$stack_info" =~ "OutputKey" ]]; then
l=$(echo "$stack_info" | jq ".Stacks[].Outputs | length")
for ((i=0;i<$l;++i)); do
key=$(echo "$stack_info" | jq ".Stacks[].Outputs[$i].OutputKey" | sed -e 's/^"//' -e 's/"$//')
keyupper=$(echo "$key" | awk '{print toupper($0)}')
val=$(echo "$stack_info" | jq ".Stacks[].Outputs[$i].OutputValue" | sed -e 's/^"//' -e 's/"$//')
export "HLSSTACK_$keyupper"="$val"
done
fi