manual v3 #103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: manual v3 | |
on: | |
workflow_dispatch: | |
inputs: | |
algo_name: | |
description: 'Algorithm name' | |
required: true | |
default: 'eis-feds-dask-coordinator-v3' | |
github_ref: | |
description: 'Branch name or version tag, e.g: 1.2.3' | |
required: true | |
username: | |
description: 'Your MAAP username' | |
required: true | |
queue: | |
description: 'Queue' | |
required: false | |
default: 'maap-dps-eis-worker-128gb' | |
maap_image_env: | |
description: 'MAAP image environment' | |
required: false | |
default: 'ubuntu' | |
json_params: | |
description: 'JSON encoded params to pass to the job e.g.: {"regnm": "NewMexicoV3", "bbox": "[-125,31,-101,49]", "tst": "[2020,8,1,\"AM\"]", "ted": "[2020,10,1,\"PM\"]", "operation": "--coordinate-all"}' | |
required: true | |
jobs: | |
run_dps_job_v3: | |
if: | | |
${{ vars.SCHEDULER_ENABLED == 'true' }} && | |
contains('["ranchodeluxe", "mccabete", "jsignell", "zebbecker", "eorland"]', github.actor) | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v2 | |
- name: pip install fireatlas | |
run: | | |
pip install . | |
- name: get docker GID and set DOCKER_GID environment variable | |
run: | | |
echo "DOCKER_GID=$(getent group docker | cut -d: -f3)" >> $GITHUB_ENV | |
- name: get current user UID and set UID environment variable | |
run: | | |
echo "UID=$(id -u)" >> $GITHUB_ENV | |
- name: print DOCKER_GID and UID | |
run: | | |
echo "Docker GID: $DOCKER_GID" | |
echo "User UID: $UID" | |
- name: install jq | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y jq | |
- name: override the default flag for manual runs | |
id: json_params | |
run: | | |
JSON_INPUT='${{ inputs.json_params }}' | |
JSON_OVERRIDE='{"operation": "--coordinate-all-no-veda-copy"}' | |
MERGED_JSON=$(jq -s '.[0] * .[1]' <(echo "$JSON_INPUT") <(echo "$JSON_OVERRIDE")) | |
MERGED_JSON_STRING=$(echo "$MERGED_JSON" | jq -c .) | |
echo "JSON params: $MERGED_JSON_STRING" | |
echo "json_params=$MERGED_JSON_STRING" >> $GITHUB_OUTPUT | |
- name: kick off the DPS job | |
uses: Earth-Information-System/fireatlas/.github/actions/run-dps-job-v3@conus-dps | |
with: | |
algo_name: ${{ inputs.algo_name }} | |
github_ref: ${{ inputs.github_ref }} | |
username: ${{ inputs.username }} | |
queue: ${{ inputs.queue }} | |
maap_image_env: ${{ inputs.maap_image_env }} | |
maap_pgt_secret: ${{ secrets.MAAP_PGT }} | |
json_params: ${{ steps.json_params.outputs.json_params }} | |