Bug #10671

[API Server] Fill in finish time when pipeline instance is marked with final state

Added by Tom Morris almost 5 years ago. Updated almost 5 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
12/06/2016
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
0.5

Subtasks

Task #10736: Review 10671-pipeline-instance-finish-timeResolvedLucas Di Pentima


Related issues

Related to Arvados - Bug #10516: [CWL][Workbench] Update stats calculations for CWL running on Crunch v1Resolved01/04/2017

Associated revisions

Revision 96d90c85
Added by Lucas Di Pentima almost 5 years ago

Merge branch '10671-pipeline-instance-finish-time'
Closes #10671

History

#1 Updated by Tom Morris almost 5 years ago

  • Target version set to Arvados Future Sprints
  • Story points set to 0.5

If the client provides no end time or it's null then the API server fills in the current time.

#2 Updated by Tom Morris almost 5 years ago

  • Target version changed from Arvados Future Sprints to 2017-01-04 sprint

#3 Updated by Lucas Di Pentima almost 5 years ago

  • Assigned To set to Lucas Di Pentima

#4 Updated by Lucas Di Pentima almost 5 years ago

  • Status changed from New to In Progress

#5 Updated by Lucas Di Pentima almost 5 years ago

Test run: https://ci.curoverse.com/job/developer-run-tests/111/ (test run 110 failed on sdk/python but didn't on my local run, so re-running to see if it was just a temporary issue)
Updated: 4115524460e89f36b99f2fb5de1adebd86daaf4a

Added a before_save filter to PipelineInstance model to update started_at and finished_at dates when changing states.

#6 Updated by Tom Clegg almost 5 years ago

I think it would be good to ensure started_at isn't nil when changing state to Failed or Complete too, in case a client creates a new object with state=Complete.

I don't think it would affect anything in practice as things stand, but I think conceptually (and for the sake of our future selves) this should be before_validation rather than before_save -- e.g., if we were validating started_at and finished_at, we would want to validate after applying these defaults, not after.

other than those points, LGTM

#7 Updated by Lucas Di Pentima almost 5 years ago

Updates: 4f03b29b3efb42a48c3f397942d5b618b89390eb
Test running at https://ci.curoverse.com/job/developer-run-tests/114/

When the pipeline instances is finished (either completed or failed) and started_at is nil, it will have the exact same time as finished_at.

#8 Updated by Lucas Di Pentima almost 5 years ago

  • Status changed from In Progress to Resolved

Applied in changeset arvados|commit:96d90c859cede094d83cbaf5409418e9ab0c2c19.

Also available in: Atom PDF