-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Feature: Ephemeral action runners #33570
base: main
Are you sure you want to change the base?
Conversation
Possible needs investigation, once gitea has returned a job to act_runner and it starts executing this door is closed |
const deleteEphemeralRunnerBatchSize = 100 | ||
|
||
// CleanupEphemeralRunners removes used ephemeral runners which are no longer able to process jobs | ||
func CleanupEphemeralRunners(ctx context.Context) error { |
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.
I also think about to remove offline EphemeralRunners here that didn't connect within 24h as auto cleanup.
We currently cannot remove runners via api.
Ephemeral bool `xorm:"ephemeral"` | ||
} | ||
|
||
return x.Sync(new(ActionRunner)) |
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.
It's better to update the legacy data as false
rather than null
.
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.
I wonder if you mean something like that
return x.Sync(new(ActionRunner)) | |
if err := x.Sync(new(ActionRunner)); err != nil { | |
return err | |
} | |
// update all records to set ephemeral to false | |
_, err := x.Exec("UPDATE `action_runner` SET `ephemeral` = false WHERE `ephemeral` IS NULL") | |
return err |
Or adding a xorm tag like this for both migration and model (I'm not 100% sure, no examples in Gitea has both name and the not null sequence)
Ephemeral bool `xorm:"ephemeral NOT NULL DEFAULT false"`
Closes #32461