preevy icon indicating copy to clipboard operation
preevy copied to clipboard

Feature: Scheduled deletion for environments

Open royra opened this issue 2 years ago • 1 comments

Specified in the command line:

preevy up --schedule-deletion=12h30m
preevy up --schedule-deletion="30 days"
preevy up --schedule-deletion=2024-08-12T13:14:15Z
preevy up --schedule-deletion=off

Running preevy up on an existing environment should change/remove the current schedule, but only if explicitly specified.

Implementation per driver:

  • GCE: https://cloud.google.com/compute/docs/instances/limit-vm-runtime
  • Kubernetes: cron job for a specific date and time in the year?
  • Lightsail/Azure: Couldn't find a simple solution, may need a scheduled lambda, or a cron job on the machine itself.

This should be an optional feature per driver, this way we can implement it gradually.

If the driver doesn't support scheduled deletion, the environment should not be provisioned and the command will end with an error.

Deletion time should be included in the output of preevy ls.

Extra credit: set a default deletion schedule in the profile during preevy init

royra avatar Aug 14 '23 08:08 royra

Something like this could be used to automatically restart the environment as well: https://github.com/acouvreur/sablier

codebutler avatar Mar 25 '24 14:03 codebutler