This is a POC service for creating on-the-fly self-hosted action runners on flintlock microvms.
Clone and build the binary:
git clone https://github.io/weaveworks-liquidmetal/microvm-action-runner
cd microvm-action-runner
make build
Start the service:
./microvm-action-runner start \
--host <flintlock address and port> \
--token <pat token>
# run --help for more flag options
# more flintlock hosts can be added with additional `host` flags
# eg, --host foo:9090 --host bar:9090
# or --hosts foo:9090,bar:9090
-
Start a
flintlockd
service. Note the address and port. -
Create a Github PAT token with
repo
scope. -
Start the service.
-
Expose the service.
-
Navigate to the repo/org/ent where you want to use these runners.
-
Go to
Settings
thenWebhooks
. -
Select
Add webhook
. -
Fill in the
Payload URL
with yourhttps
url plus/webhook
. eg:https://my-service.org/webhook
. -
Change the
Content type
to beapplication/json
. -
If you wish to set a plaintext secret, set that in the
Secret
field. Remember to restart the service with the--secret
flag. -
For the question
Which events would you like to trigger this webhook?
, selectLet me select individual events.
, then from the expanded options deselectPushes
, and selectWorkflow jobs
. -
Click
Add webhook
.
Your service should now be ready to receive webhook requests from workflow jobs in that repo/org/ent.
-
Fork the repo.
-
Clone your fork.
-
Run
make test
. -
Make your changes, ensuring there are new tests and everything passes.
-
Manually test using
ngrok
(below). (Integration/acceptance tests are coming, for now we must manually verify). -
Open a PR.
To check out the service without going to the effort of exposing the service
properly, you can use ngrok
. You can get a free plan as an individual.
After you have started your microvm-action-runner
service, use ngrok
to expose it:
ngrok http localhost:3000
Use the https
endpoint generated by ngrok
for your Payload URL
when setting
up the webhook.