Page MenuHomePhabricator

[Rescoping Needed] Add TTL (time to live) option to patchdemo which defaults to 30days
Closed, InvalidPublic5 Estimated Story Points

Description

  • Add a text field that accepts an integer for the number of days to keep an environment around before it is automatically deleted.
  • The maximum allowed number of days is 90. If the user puts a number zero or less or 91 or more, patchdemo should give an error and not allow the environment to be created until fixed.
  • The textbox should say "30" by default when creating a new environment.
  • in the environment table, there should be an "Expires on" columns in the patchdemo UI populated with the date on which the environment will be deleted
  • patchdemo (or something else?) should regularly prune (i.e. delete) environments that are expired, e.g.
    • use some type of cron / schedule container tool

Note:

  • the behavour only needs to exist for patchdemo environments, not other environments created through catalyst
  • our preference is that the "expiration date" is stored as a date, right than the number of days it's meant to live

We are accumulated disk cost for legacy environments, and it would be nice to automatically clear them.

  • also check if environments are deleted after either phab tasks are closed or gerrit patches are merged (I believe this was the behaviour in legacy-patchdemo)
    • this is just for our information and to create follow-on stories

Event Timeline

SDunlap triaged this task as High priority.Oct 17 2024, 2:15 PM
SDunlap updated the task description. (Show Details)
SDunlap set the point value for this task to 5.

I thought of one more thing after we created the task. What TTL should be given to existing envs? Does 30 days sound reasonable?

If we give them a large initial TTL we won't be saving much space and we're still inching towards a full disk:
dev/sdc 158G 118G 33G 79% /mnt/k3s-data

SDunlap edited projects, added Catalyst (Camp Muir); removed Catalyst.
SDunlap renamed this task from Add TTL (time to live) option to patchdemo which defaults to 30days to [Rescoping Needed] Add TTL (time to live) option to patchdemo which defaults to 30days.Oct 25 2024, 8:22 PM
SDunlap updated the task description. (Show Details)

Added [Rescoping Needed] as a flag for our next planning meeting to see if there are some ways to break this story down, and get clarity on which parts are the most important.

Wouldn’t T372981: Reclaim wiki resources on patch merge be a better solution than this date-based one? (And I still think that an opt-out mechanism should exist, we should trust users not to overuse it.)

thcipriani raised the priority of this task from High to Needs Triage.Nov 4 2024, 5:31 PM
thcipriani subscribed.

Wouldn’t T372981: Reclaim wiki resources on patch merge be a better solution than this date-based one? (And I still think that an opt-out mechanism should exist, we should trust users not to overuse it.)

Agree, let's take a look at that one instead and leave this on the back-burner. Leaving @EBomani assigned since there's a draft MR for this in case we re-prioritize.

@SDunlap and I think we should add this functionality to catalyst-api instead of patchdemo. When patchdemo requests to the catalyst api it can request for the wiki to stay indefinitely (patchdemo will manage deletion). But we also have other users of catalyst-api who interact with the api directly and may not be deleting their wikis, so it would be helpful if those resources could be reclaimed by catalyst.

EBomani subscribed.

More work to do on T423696: Patchdemo: Default 1 month expiration

But this specific task is outdated.