Page MenuHomePhabricator

Give Drydock resources a proper expiry mechanism
ClosedPublic

Authored by epriestley on Sep 28 2015, 1:06 PM.
Tags
None
Referenced Files
F14009468: D14176.id34255.diff
Wed, Oct 30, 6:18 PM
F14002509: D14176.diff
Fri, Oct 25, 7:34 PM
F13992755: D14176.id34249.diff
Tue, Oct 22, 6:35 PM
F13968442: D14176.id.diff
Oct 16 2024, 9:04 PM
F13968422: D14176.id34255.diff
Oct 16 2024, 8:51 PM
Unknown Object (File)
Oct 7 2024, 6:29 AM
Unknown Object (File)
Oct 1 2024, 6:35 PM
Unknown Object (File)
Oct 1 2024, 8:09 AM
Subscribers
None

Details

Summary

Fixes T6569. This implements an expiry mechanism for Drydock resources which parallels the mechanism for leases.

A few things are missing that we'll probably need in the future:

  • An "EXPIRES" command to update the expiration time. This would let resources be permanent while leased, then expire after, say, 24 hours without any leases.
  • A callback like shouldActuallyExpireRightNow() for resources and leases that lets them decide not to expire at the last second.
  • A callback like didAcquireLease() for resource blueprints, to parallel didReleaseLease(), letting them clear or extend their timer.

However, this stuff would mostly just let us tune behaviors, not really open up new capabilities.

Test Plan

Changed host resources to expire after 60 seconds, leased one, saw it vanish 60 seconds later.

Diff Detail

Repository
rP Phabricator
Branch
drydock20
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 8071
Build 9174: [Placeholder Plan] Wait for 30 Seconds
Build 9173: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to Give Drydock resources a proper expiry mechanism.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: chad, hach-que.

Couple of cleanup / miscellaneous things in this diff too, notes inline...

src/applications/drydock/capability/DrydockDefaultViewCapability.php
11–13

This allows the default view policy to be "Public".

src/applications/drydock/controller/DrydockConsoleController.php
17

I removed "Logs" from the console because it needs work and it's hard to do policies + performance correctly from the web UI. I plan to realign logs as children of resources/leases in the web UI (they already are, to some degree, but I'll reinforce this).

I also added icons since they look nice and are consistent with Almanac.

src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php
41–47

Without this, yields from bin/worker execute ... would be computed incorrectly and scheduled some time in 1970. This only affects debugging with bin/worker.

chad edited edge metadata.
This revision is now accepted and ready to land.Sep 28 2015, 3:26 PM
This revision was automatically updated to reflect the committed changes.