This repository has been archived by the owner on Jun 28, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it
I will talk about all that I can on this PR... everything that can be made public will be and anything that talks about backend infrastructure, secrets, and etc I won't. Having said that... This (re-)implements dynamic self-hosted runners in AWS, but using webhooks instead of having all the logic in the GitHub action itself. I won't get into specifics on why, but this is a vast improvement.
Some details on implementation... it required that I implement functionality in another open-source project that currently doesn't have the capability (github.com/go-playground/webhooks) to which I will be opening a PR in that project in order to support and recontribute the functionality back upstream.
In a nutshell, we create a webhook for the newly implemented event WorkflowJobEvent in said project (also implemented WorkflowRunEvent and WorkflowDispatchEvent yay!) and using a webhook service, we call Github and AWS APIs in order to basically do the exact same functionality for creating an EC2 instance for the self-hosted GitHub runner in order to run jobs faster than the GitHub hosted runners.
This PR also updates all the existing relevant workflows to use this implementation! which is cool and if you notice... it is super beyond minimal now! Some things I can talk about on the backend... this webhook has been deployed to multiple regions in EC2 all fronted by an AWS LoadBalancer which is cool for both availability and also for... well... load balancing.
Details for the Release Notes (PLEASE PROVIDE)
Which issue(s) this PR fixes
Fixes: #2361
Describe testing done for PR
PR runs on itself. Successful run here:
https://github.com/vmware-tanzu/community-edition/actions/runs/1382105241
Also, tested cancel and restart to make sure the common workflow scenarios work!
also, verified that failed jobs clean up after themselves and you can restart/retry without any issues.
Special notes for your reviewer
NA