Story #15350
closed
[Documentation] Add Python SDK recipe on how to get a container request's real state
Added by Lucas Di Pentima over 5 years ago.
Updated almost 5 years ago.
Estimated time:
(Total: 0.00 h)
Release relationship:
Auto
Description
CR's state depends both on its actual state and the container's.
Add a recipe to our Python SDK Cookbook to get the same state as the workbench show to the user.
Documentation update at ee6ee144d - branch 15350-pysdk-cookbook-recipe
Adds a Python SDK recipe to get a container request's state as done on workbench.
Lucas Di Pentima wrote:
Documentation update at ee6ee144d - branch 15350-pysdk-cookbook-recipe
Adds a Python SDK recipe to get a container request's state as done on workbench.
- Might be a little easier to read if you store c['state'] in a variable. Up to you.
- Is it worth differentiating between Locked and Queued (i.e. return
c['state']
on line 14 or remove the else and let it fall through)?
- Could simplify the
elif c['state'] = = 'Complete'
clause to check for non-zero and let the return c['state']
fall through to the end.
- Can remove the last else in the
elif c['state'] == 'Running'
clause.
Eric Biagiotti wrote:
- Might be a little easier to read if you store c['state'] in a variable. Up to you.
I'm not sure, because I would also need to store cr['state']
on another, getting something like cr_state
and c_state
, both very similar.
- Is it worth differentiating between Locked and Queued (i.e. return
c['state']
on line 14 or remove the else and let it fall through)?
I based the recipe in what workbench does (https://github.com/curoverse/arvados/blob/master/apps/workbench/app/models/container_work_unit.rb#L101-L133), so I think it would be preferable to keep the same behavior.
- Could simplify the
elif c['state'] = = 'Complete'
clause to check for non-zero and let the return c['state']
fall through to the end.
- Can remove the last else in the
elif c['state'] == 'Running'
clause.
Done both, thanks!
Updates at 4a55551f6
- Status changed from In Progress to Resolved
- Related to Bug #15672: List of subprocesses limited in process view added
Also available in: Atom
PDF