Project

General

Profile

Actions

Story #12917

open

Users should be able to see if a container failed from the container_request method

Added by Bryan Cosca almost 7 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
(Total: 0.00 h)
Story points:
2.0
Release:
Release relationship:
Auto

Description

Users should be able to see the exit code or state=[“Queued”, “Locked”, “Running”, “Cancelled” and “Complete”] from the container_request api method, rather than having to go another layer deeper to the container api method.

Proposed solution

Add a general "include" option to the index (list) method.

include=container includes the contents of the record associated with container_uuid

Can only be used on fields ending in _uuid

A query like this would return:

?include=container

{
  "items": [
    {
      "kind": "arvados#container_request",
      "uuid": "abc-123",
      "container_uuid": "xyz-123" 
      ...
    }
  ],
  "includes": [
    {
      "uuid": "xyz-123",
      "state": "Completed",
      "exit_code": 0,
      ...
    }
  ]
}

Initially we will only adopt this syntax but initially limiting the implementation to only container requests. This should be implemented on the controller side.

If used for anything other than include=container on container_request it should return an API error.

Discussion points for future:

  • selecting fields in the includes
  • Permission enforcement. Permission to read a container is based on permission to read the container_request, but this is not true generally. For example, permission to read a container request doesn't grant permission to read output_uuid.
  • Straightforward to set up a join when the _uuid field points to exactly one record type (only collections, only containers, etc) but more complex when it can point to multiple (owner_uuid, head/tail_uuid on links)

Subtasks 1 (1 open0 closed)

Task #13355: ReviewNewTom Clegg

Actions

Related issues 3 (1 open2 closed)

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

Actions
Has duplicate Arvados - Story #13145: Include container status & exit code in container request responseDuplicate

Actions
Blocks Arvados - Story #13327: Use new API container_request?include=containerNew

Actions
Actions #2

Updated by Tom Morris almost 7 years ago

  • Target version set to To Be Groomed
Actions #3

Updated by Peter Amstutz almost 7 years ago

Suggest adding virtual fields container_state and container_exit_code which have the value of the corresponding fields of the record with container_uuid, or null if no container is assigned.

Alternately, we could add a query parameter which specifies that we want the entire container record embedded in the response.

Actions #4

Updated by Tom Morris almost 7 years ago

  • Subject changed from Users should be able to see if a CR failed from the CR method to Users should be able to see if a container failed from the container_request method
Actions #5

Updated by Tom Clegg almost 7 years ago

IMO, these aren't container_request fields so they shouldn't appear as container_request fields.

Suggest we support an "include container record" flag in container_requests#index and #show requests, and return the whole container record.

Since we're not (yet?) using jsonapi, we need to choose a response format for this. We should use something that can extend to other similar situations, like "include created_by_user record".

Actions #6

Updated by Peter Amstutz over 6 years ago

  • Description updated (diff)
Actions #7

Updated by Peter Amstutz over 6 years ago

  • Description updated (diff)
Actions #9

Updated by Peter Amstutz over 6 years ago

  • Description updated (diff)
Actions #10

Updated by Peter Amstutz over 6 years ago

  • Description updated (diff)
Actions #11

Updated by Peter Amstutz over 6 years ago

  • Description updated (diff)
Actions #12

Updated by Tom Morris over 6 years ago

  • Related to Story #13327: Use new API container_request?include=container added
Actions #13

Updated by Peter Amstutz over 6 years ago

  • Description updated (diff)
  • Story points set to 2.0
Actions #14

Updated by Peter Amstutz over 6 years ago

Just one thought, we have wandered a little bit from the original goal of making the API easier for getting container status from container_request. Returing a separate "includes" section takes a similar amount of Python code to interpret as the current approach that requires making a second API call. Embedding the record in each item so that one can can write items0[container][state] is much simpler for the user (ie Bryan).

That said, "includes" is a more general solution that is better suited for other use cases like optimizing Workbench queries and so probably still the one we go with.

Actions #15

Updated by Tom Clegg over 6 years ago

Perhaps the client library could offer a "join response items" convenience function that assigns includes[x] to items[y][f] for all items[y][f+'_uuid']==includes[x]['uuid']...?

Actions #16

Updated by Tom Morris over 6 years ago

  • Target version changed from To Be Groomed to 2018-04-25 Sprint
Actions #17

Updated by Tom Morris over 6 years ago

  • Assigned To set to Peter Amstutz
Actions #18

Updated by Peter Amstutz over 6 years ago

  • Has duplicate Story #13145: Include container status & exit code in container request response added
Actions #20

Updated by Peter Amstutz over 6 years ago

  • Target version changed from 2018-04-25 Sprint to 2018-05-09 Sprint
Actions #21

Updated by Tom Morris over 6 years ago

  • Assigned To deleted (Peter Amstutz)
  • Target version changed from 2018-05-09 Sprint to Arvados Future Sprints
Actions #22

Updated by Tom Morris about 5 years ago

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

Updated by Peter Amstutz almost 5 years ago

  • Target version changed from Arvados Future Sprints to 2020-02-12 Sprint
Actions #24

Updated by Lucas Di Pentima almost 5 years ago

  • Assigned To set to Lucas Di Pentima
Actions #25

Updated by Lucas Di Pentima almost 5 years ago

  • Description updated (diff)
Actions #26

Updated by Lucas Di Pentima almost 5 years ago

  • Related to deleted (Story #13327: Use new API container_request?include=container)
Actions #27

Updated by Lucas Di Pentima almost 5 years ago

  • Blocks Story #13327: Use new API container_request?include=container added
Actions #28

Updated by Lucas Di Pentima almost 5 years ago

  • Status changed from New to In Progress
Actions #30

Updated by Lucas Di Pentima almost 5 years ago

  • Target version changed from 2020-02-12 Sprint to 2020-02-26 Sprint
Actions #31

Updated by Lucas Di Pentima almost 5 years ago

  • Status changed from In Progress to New
  • Target version deleted (2020-02-26 Sprint)
Actions #32

Updated by Lucas Di Pentima almost 5 years ago

  • Category set to API
  • Assigned To deleted (Lucas Di Pentima)
Actions #33

Updated by Stanislaw Adaszewski over 4 years ago

Again speaking privately here. This seems important. Workbenches are slow because of small API issues like this one. [uuid, in, [...]] filter to retrieve corresponding containers seems always a bit on the slow side. Thank you in advance.

Actions #34

Updated by Lucas Di Pentima almost 2 years ago

  • Release set to 60
Actions

Also available in: Atom PDF