This section describes the environment variables that apply to jobs launched by runzi.
Boolean¶
"1", "Y", "YES", "TRUE" evaluate as true. They are not case sensitive.
Local machine env vars¶
Set these in your .env file. Defaults are given in brackets.
NZSHM22_TOSHI_API_ENABLED[false]: if set to true will log general task and children withToshiAPIand store realizations in database usingtoshi-hazard-storeNZSHM22_SCRIPT_WORKER_POOL_SIZE[2]: number of jobs to run simultaneously on local hardware.NZSHM22_TOSHI_API_URL[http://127.0.0.1:5000/graphql]NZSHM22_TOSHI_S3_URL[http://localhost:4569]-
NZSHM22_TOSHI_COGNITO_DOMAIN: Cognito domain used for Scientist (interactive) login and AWS credential federation. -
NZSHM22_RUNZI_ECR_DIGEST: used bytoshi-hazard-storeto record the Docker image digest used to generate hazard cruves. NZSHM22_THS_RLZ_DB: path to location of parquet files where hazard realizations are stored bytoshi-hazard-store. Can be local directory or s3 bucket (s3://)NZSHM22_THS_DISAGG_RLZ_DB: path to location of parquet files where disaggregation realizations are stored bytoshi-hazard-store. Can be local directory or s3 bucket (s3://)NZSHM22_SCRIPT_JVM_HEAP_START[4]: Startup JAVA Memory (per worker)NZSHM22_OPENSHA_ROOT[~/DEV/GNS/opensha-modular]: path to root directory for OpenSHANZSHM22_OPENSHA_JRE[/usr/lib/jvm/java-11-openjdk-amd64/bin/java]: location of java executableNZSHM22_FATJAR[OPENSHA_ROOT]: location of OpenSHA fat jarNZSHM22_SCRIPT_WORK_PATH[cwd / "tmp"]: path to working directory for scripts, configurations, etcNZSHM22_BUILD_PLOTS: if true, inversion reports will build MFD plotsNZSHM22_REPORT_LEVEL:LIGHT,DEFAULT,FULL: the level of detail for inversion reportsNZSHM22_HACK_FAULT_MODELNZSHM22_S3_REPORT_BUCKET: location of inversion and rupture set reportsNZSHM22_S3_UPLOAD_WORKERS: number of simultaneous workers for uploading to s3SPOOF: if true do not run calculations, just perform setup (and API queries/mutations)THS_DATASET_AGGR_URI: location of hazard aggregate datasets; can be local path or s3 URI. Used to lookup hazard curve to find target level at which to calculate disaggregations.NZSHM22_OQ_VENV: path to the OpenQuake virtual environment root (e.g./opt/oq-venv); required for OQ tasks.NZSHM22_OQ_DATADIR: directory whereoq enginewrites HDF5 calc datastores (e.g./oqdata); required for OQ tasks.
The Cognito vars are used for toshi API authentication and AWS permissions. They can alternatively be stored in ~/.toshi/auth_config.json (written by toshi-auth configure). Env vars take precedence over the file; any key absent from the environment is read from the file.
NZSHM22_TOSHI_COGNITO_SCIENTIST_CLIENT_ID: Cognito app client ID for Scientist login.NZSHM22_TOSHI_COGNITO_USER_POOL_ID: Cognito user pool ID.NZSHM22_TOSHI_COGNITO_IDENTITY_POOL_ID: Cognito identity pool ID; used to federate AWS credentials via the identity pool.NZSHM22_TOSHI_COGNITO_REGION: AWS region for Cognito (defaultap-southeast-2).
AWS Batch job definition env vars¶
These must be configured in the AWS Batch job definition (infrastructure). They are not forwarded from the local machine — local job submission always uses Scientist (interactive) credentials instead.
NZSHM22_TOSHI_M2M_SECRET_ARN: ARN of the Secrets Manager secret holding the M2M (machine-to-machine) Cognito client credentials (client_idandclient_secret). When set alongsideNZSHM22_TOSHI_COGNITO_DOMAIN, the container authenticates to the Toshi API using M2M JWT tokens rather than interactive login.NZSHM22_TOSHI_COGNITO_DOMAIN: Cognito domain used for M2M token exchange inside the Batch container.