Project

General

Profile

Actions

Idea #15350

closed

[Documentation] Add Python SDK recipe on how to get a container request's real state

Added by Lucas Di Pentima almost 5 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Documentation
Target version:
Story points:
0.5
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.


Subtasks 1 (0 open1 closed)

Task #15352: Review 15350-pysdk-cookbook-recipeResolvedEric Biagiotti06/11/2019Actions

Related issues

Related to Arvados Workbench 2 - Bug #15672: List of subprocesses limited in process viewResolvedLucas Di Pentima12/16/2019Actions
Actions #1

Updated by Lucas Di Pentima almost 5 years ago

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.

Actions #2

Updated by Eric Biagiotti almost 5 years ago

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.
Actions #3

Updated by Lucas Di Pentima almost 5 years ago

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

Actions #4

Updated by Lucas Di Pentima almost 5 years ago

  • Status changed from In Progress to Resolved
Actions #5

Updated by Tom Morris over 4 years ago

  • Related to Bug #15672: List of subprocesses limited in process view added
Actions #6

Updated by Peter Amstutz about 4 years ago

  • Release set to 22
Actions

Also available in: Atom PDF