Actions
Feature #9968
open[Crunch2] [API] Support container request expiry (expires_at)
Status:
New
Priority:
Normal
Assigned To:
-
Category:
Crunch
Target version:
-
Start date:
09/07/2016
Due date:
% Done:
0%
Estimated time:
Story points:
-
Description
See Containers API
Implementation has two parts:
Check for past expiry when creating/updating container requests¶
Filter CRs on expires_at is null or expires_at>now
This will stop a container when its requesting CR is updated to expires_at=now, for example.
Check expiry periodically¶
This can be implemented as a Rails script that runs as a cron job (or systemd timer).
A single postgres query should be able to return the containers whose priority has gone out of sync due to expired requests. Something like this:
select c.uuid from containers c join container_requests cr on (cr.container_uuid=c.uuid and cr.expires_at is null or cr.expires_at>now) where c.priority > 0 and c.state in ('Queued', 'Locked', 'Running') having cr.container_uuid is null or max(cr.priority)<c.priority
Run c.update_priority! on the selected containers.
Updated by Tom Morris over 7 years ago
- Target version set to Arvados Future Sprints
Updated by Ward Vandewege almost 4 years ago
- Target version deleted (
Arvados Future Sprints)
Actions