Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rough draft of making workflow steps optional #1428

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions apps/step-function.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,28 @@
{
"Variable": "$.job_type",
"StringEquals": "{{ job_type }}",
"Next": "{{ job_spec['tasks'][0]['name'] }}"
"Next": "{{ job_spec['tasks'][0]['name'] }}{% if 'run_if' in job_spec['tasks'][0] %}_CHOICE{% endif %}"
}{% if not loop.last %},{% endif %}
{% endfor %}
],
"Default": "JOB_FAILED"
},
{% for job_type, job_spec in job_types.items() %}
{% for task in job_spec['tasks'] %}
{% if 'run_if' in task %}
"{{ task['name'] }}_CHOICE": {
"Type": "Choice",
"Choices": [
{
{% for key, value in task['run_if'].items() %}
"{{ key }}": {{ json.dumps(value) }},
{% endfor %}
"Next": "{{ task['name'] }}"
}
],
"Default": "{% if not loop.last %}{{ loop.nextitem['name'] }}{% if 'run_if' in loop.nextitem %}_CHOICE{% endif %}{% else %}GET_FILES{% endif %}"
},
{% endif %}
"{{ task['name'] }}": {
"Type": "Task",
"Resource": "arn:aws:states:::batch:submitJob.sync",
Expand All @@ -193,7 +207,7 @@
}
},
"ResultPath": "$.results.processing_results.step_{{ loop.index0 }}",
"Next": "{% if not loop.last %}{{ loop.nextitem['name'] }}{% else %}GET_FILES{% endif %}",
"Next": "{% if not loop.last %}{{ loop.nextitem['name'] }}{% if 'run_if' in loop.nextitem %}_CHOICE{% endif %}{% else %}GET_FILES{% endif %}",
"Retry": [
{
"ErrorEquals": [
Expand Down
9 changes: 8 additions & 1 deletion job_spec/INSAR_ISCE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ INSAR_ISCE:
vcpu: 1
memory: 7500
- name: TROPOSPHERE
run_if:
And:
- Variable: $.job_parameters.tropospheric_model
IsPresent: true
- Not:
Variable: $.job_parameters.tropospheric_model
StringEquals: None
image: ghcr.io/dbekaert/raider
command:
- ++process
Expand All @@ -68,4 +75,4 @@ INSAR_ISCE:
- Ref::tropospheric_model
timeout: 10800
vcpu: 1
memory: 7500
memory: 7500