input
reads in SWOT shapefile data from a Hydrocron query and produces time series data saved as NetCDF files. The input module runs on the reach-level meaning it is parallelizable by SWORD reach identifier.
Build a Docker image: docker build -t input .
Command line arguments:
- -i: index to reach identifier to execute on
- -r: path to reach node JSON file
- -o: path to write output data to
- -s: path to SWORD files
- -t: temporal range to search with
- -v: SWORD version
- -p: prefix for AWS environment
Execute a Docker container:
AWS credentials will need to be passed as environment variables to the container so that input
may access AWS infrastructure to generate JSON files.
# Credentials
export aws_key=XXXXXXXXXXXXXX
export aws_secret=XXXXXXXXXXXXXXXXXXXXXXXXXX
# Docker run command
docker run --rm --name input -e AWS_ACCESS_KEY_ID=$aws_key -e AWS_SECRET_ACCESS_KEY=$aws_secret -e AWS_DEFAULT_REGION=us-west-2 -e AWS_BATCH_JOB_ARRAY_INDEX=26 -v /mnt/input:/data input:latest -i "-235" -r /data/reaches.json -o /data/output -s /data/sword -t "&start_time=2020-09-01T00:00:00Z&end_time=2025-10-30T00:00:00Z&" -v 16 -p confluence-dev1
There is a script to deploy the Docker container image and Terraform AWS infrastructure found in the deploy
directory.
Script to deploy Terraform and Docker image AWS infrastructure
REQUIRES:
- jq (https://jqlang.github.io/jq/)
- docker (https://docs.docker.com/desktop/) > version Docker 1.5
- AWS CLI (https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
- Terraform (https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)
Command line arguments:
[1] registry: Registry URI [2] repository: Name of repository to create [3] prefix: Prefix to use for AWS resources associated with environment deploying to [4] s3_state_bucket: Name of the S3 bucket to store Terraform state in (no need for s3:// prefix) [5] profile: Name of profile used to authenticate AWS CLI commands
Example usage: ``./deploy.sh "account-id.dkr.ecr.region.amazonaws.com" "container-image-name" "prefix-for-environment" "s3-state-bucket-name" "confluence-named-profile"`
Note: Run the script from the deploy directory.