Skip to content
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

ADR: Runner Job Started/Completed Hooks #1751

Merged
merged 5 commits into from
May 12, 2022
Merged

ADR: Runner Job Started/Completed Hooks #1751

merged 5 commits into from
May 12, 2022

Conversation

thboop
Copy link
Collaborator

@thboop thboop commented Mar 14, 2022

Rendered

This ADR details how we plan to support Job Started / Job Completed hooks for self hosted runner admins.

@thboop thboop requested a review from a team as a code owner March 14, 2022 15:53
thboop and others added 3 commits March 15, 2022 10:24
Co-authored-by: Edward Thomson <ethomson@github.com>
Co-authored-by: Edward Thomson <ethomson@github.com>
@tyrken
Copy link

tyrken commented Apr 8, 2022

Thanks @thboop, I had a chance to play with the Beta and it's mostly good for my use case - the only issue I can see so far is the precise environment variables present when the hook script runs. In my earlier PR I have a section that grabs the standard global env-vars then adds the main ones from the job's definition. This allows the workflow writer to configure the hook script slightly, e.g. via the env: block in their job definition or at the top level.

Would it be possible to add a similar tweak here? There doesn't seem any other way of getting at them (i.e. they aren't in the event.json nor anywhere else I can think of yet)...

@tyrken
Copy link

tyrken commented Apr 26, 2022

I've added a very small PR needed to expose workflow env-vars to the hooks as #1849 - please have a look as it enables flexible hooks.

@j3parker
Copy link

This is working well for us 👍 Thanks!

Copy link
Contributor

@fhammerl fhammerl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thboop thboop merged commit 02b52e8 into main May 12, 2022
@thboop thboop deleted the thboop/hookADR branch May 12, 2022 19:18
@tyrken
Copy link

tyrken commented May 12, 2022

Hello? Any comments on my feedback or the PR to implement a fix @thboop ?

@dimitar-hristov
Copy link

Hi @thboop 👋 Reading the ADR, I noticed that you included:

A runner administrator is able to grab custom telemetry of jobs running on their self hosted runner
...
Runner admins have the ability to tie into the runner job execution to publish their own telemetry or perform their own cleanup or setup

I was wondering how the started/completed hooks tie with the telemetry? I am sorry if it is a silly question, but I struggle to understand it and I couldn't find any documentation about it. 😞

@nickolashkraus
Copy link

Runner admins can execute a background process for async hooks if they want

How does one do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants