-
Notifications
You must be signed in to change notification settings - Fork 95
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
Add initial GitHub Actions runner support #5970
Conversation
2ec401f
to
5d00626
Compare
5d00626
to
6323bf2
Compare
@@ -204,7 +244,122 @@ func (a *GitHubApp) handleInstallationEvent(ctx context.Context, eventType strin | |||
return nil | |||
} | |||
|
|||
func (a *GitHubApp) handleWorkflowEvent(ctx context.Context, eventType string, event any) error { | |||
func (a *GitHubApp) handleWorkflowJobEvent(ctx context.Context, eventType string, event *github.WorkflowJobEvent) 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 would be more explicit about calling these githubWorkflow events.
For better or worse workflow jobs already means something to us all, so it's kind of confusing to change the meaning of that name now.
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.
Renamed startWorkflowJob
to startGitHubActionsRunnerTask
.
I would like to keep this func handleWorkflowJob
the same though - in handleWebhookEvent
above, the function that handles *github.FooEvent
is called handleFooEvent
which I think is a nice convention. To make this more obvious, the latest commit also gets rid of handleBuildBuddyWorkflowEvent
which was being used as a catch-all for the remaining event types, which seemed sort of unclear. Replaced that with explicit handlers for Push, PullRequest, and PullRequestReview events, and those handlers call maybeTriggerBuildBuddyWorkflow
now
03e77c2
to
f82c20a
Compare
f82c20a
to
f49e1db
Compare
When enabled (behind flag), allows using BuildBuddy to run GitHub actions in a warm microvm. Users can install the BuildBuddy GitHub app, then change their GitHub workflow YAML to specify
runs-on: buildbuddy
. BuildBuddy will then spawn an ephemeral runner (as an RBE action) for each workflow_job.queued event, executing the runner within a warm microVM.The ephemeral runner uses a "just-in-time config" which acts as a one-time-use token that allows the runner to execute a single job. Once the runner is done executing the job, it unregisters itself from the repo (i.e. it will no longer be usable for executing more jobs and won't show up in Settings > Actions > Runners). The config is scoped to a single repo but is not scoped to a particular job ID. So the scheduling model is less like "1 job ID => 1 runner ID" and more like "N jobs => N runners".
Limitations:
rbe-ubuntu20-04-workflows
image, not GitHub's Ubuntu 20.04 machine image, so some system tools may be missing. This means thatruns-on: buildbuddy
does not yet "just work".Related issues: N/A