aws-samples / aws-samples/aws-healthomics-tutorials
Throttling error on 200-omics_workflows.ipynb
- Dominant language
- Python
- Stars
- 94
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
Error on notebook "notebooks/200-omics_workflows.ipynb"
The error happens at the end in the "Using HealthOmics Workflows RunGroups" section. When launching multiple runs with different parameters, it seems that the server didnt like me shipping runs too fast and throws an throttling error before the second run is launched. My solution was to add a simple "time.sleep(10)" at the end of the for cycle and that make it work just fine. Importing the time library would be necessary. Small but useful change suggestion i guess. A snippet of the problematic code and suggested solution:
```
rg_runs = []
run_inputs = [
{"greeting": "Hello", "addressee": "AWS"},
{"greeting": "Bonjour", "addressee": "HealthOmics"},
{"greeting": "Hola", "addressee": "Workflows"},
]
for run_num, run_input in enumerate(run_inputs):
run = omics.start_run(
workflowId=workflow['id'],
name=f"{workflow['name']} - {run_num} :: {run_input}",
roleArn=role['Role']['Arn'],
parameters=run_input,
outputUri=output_uri,
runGroupId=run_group['id'], # <-- here is where we specify the run group
)
print(f"({run_num}) workflow {workflow['id']}, run group {run_group['id']}, run {run['id']}, input {run_input}")
rg_runs += [run]
time.sleep(10) # <-- SUGGESTED solution to throttling error.
```
Anyways thank you for this resource, is quite valuable
Contributor guide
Assessment
This issue has not been assessed yet.