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

add option to enable job log file #1564

Merged
merged 3 commits into from
Apr 20, 2022
Merged

Conversation

albertywu
Copy link
Contributor

@albertywu albertywu commented Feb 24, 2022

Adds a new agent config option --enable-job-log-file.

When set, all logs for a job are written to a temporary file and exposed to the job via an environment variable BUILDKITE_JOB_LOG.

This log file can be used by post-command, pre-exit, and exit hooks to analyze the logs without having to fetch them via API (which is slower, and subject to race conditions). One use-case we have for this is log failure analysis of the command-step to enable dynamic retries.

This temporary file is deleted when the job finishes.

@pzeballos pzeballos requested a review from a team February 28, 2022 14:34
Copy link
Contributor

@moskyb moskyb left a comment

Choose a reason for hiding this comment

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

thanks for your contribution @albertywu! i'm happy with the implementation here but i'm keen to iterate a little bit on the flag/envar names

@albertywu albertywu force-pushed the add-logging-to-file branch from 2325061 to 05cd627 Compare April 11, 2022 18:31
@albertywu
Copy link
Contributor Author

@moskyb @pda

I've updated the PR to rename to use EnableJobLogTmpfile. Could you take another look?

(btw, not sure why I'm unable to resolve the request changes)

thanks!

@albertywu albertywu requested a review from moskyb April 11, 2022 18:53
@moskyb
Copy link
Contributor

moskyb commented Apr 11, 2022

@albertywu works on my machine ¯\_(ツ)_/¯
Screen Shot 2022-04-12 at 9 46 32 AM

Copy link
Contributor

@moskyb moskyb left a comment

Choose a reason for hiding this comment

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

@albertywu LGTM 🎉

i'll roll this into the next minor version update we do

@moskyb moskyb added the awaiting-release For PRs that are ready to go, but need to be rolled into a release label Apr 11, 2022
@moskyb moskyb merged commit db24afa into buildkite:main Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-release For PRs that are ready to go, but need to be rolled into a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants