-
Notifications
You must be signed in to change notification settings - Fork 14
fix: reap unused fly apps from past deployments #774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Squawk Report✅ 0 violations across 1 file(s)
|
253835f to
df70695
Compare
4cd06a5 to
674ca3b
Compare
674ca3b to
7312571
Compare
This change implements a background worker that periodically checks for and reaps unused Fly.io applications associated with function deployments that are no longer active. For now, we will retain all apps created in the past 3 deployments of every Gram project.
7ea6a99 to
b4c819f
Compare
| - schema: schema.sql | ||
| queries: ../internal/functions/queries.sql | ||
| engine: postgresql | ||
| database: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for?
| TaskQueue: string(TaskQueueMain), | ||
| WorkflowIDConflictPolicy: enums.WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING, | ||
| WorkflowIDReusePolicy: enums.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE, | ||
| WorkflowRunTimeout: time.Minute * 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If activity timeout StartToClose is 5 min. This needs to be 5 min * the number of retries.
Maybe lower the activity StartToClose timeout and set this accordingly. Or set a ScheduleToClose
This change implements a new temporal workflow that will reap unused fly.io machines. It is triggered as a child workflow every time a deployment is processed (the parent workflow). The child workflow is invoked with a given project id and it will reap all fly machines provisioned in old deployments leaving only machines in the 3 most recent deployments.
The goal is to keep fly.io machines, a capped resource, in check as more users play with Gram Functions.