Skip to content

Add Repository information to Runner Status#2093

Merged
mumoshu merged 4 commits into
actions:masterfrom
Moser-ss:feat/Add-repository-to-status
Jan 18, 2023
Merged

Add Repository information to Runner Status#2093
mumoshu merged 4 commits into
actions:masterfrom
Moser-ss:feat/Add-repository-to-status

Conversation

@Moser-ss

Copy link
Copy Markdown
Contributor

This is an extension of the feature introduced in the PR #1268 to add .status.repository .status.owner .status.repo .status.workflow to enrich the data related to Runner.

The idea is to add more context information to the Runner status. In this way, we can correlate the metrics of the runners with the usage done by the workflows. For example, if a runner is evicted or gets OOM, we can know which repository and workflow caused that issue.
Another use case is to understand if some workflows suffer resource constraints in terms of CPU, like workflows that run tests or build assets. With the new status properties, we can correlate high CPU usage with specific repositories and workflow.

An additional use case is to fine-tune runners for specific workflows. By knowing which workflows are executed in the Runner with time, we can understand resource usage patterns and create new runners for specific workflows

@Moser-ss Moser-ss requested a review from mumoshu as a code owner December 13, 2022 14:57
@Link- Link- added the needs triage Requires review from the maintainers label Dec 13, 2022
Add repository information to the runner status. With this information we can clear understand which repositories are using the runner
@mumoshu mumoshu force-pushed the feat/Add-repository-to-status branch from 71d9098 to eaaf315 Compare December 31, 2022 03:01
@mumoshu mumoshu requested review from a team and toast-gear as code owners December 31, 2022 03:01
@mumoshu

mumoshu commented Dec 31, 2022

Copy link
Copy Markdown
Collaborator

@Moser-ss Thanks for your PR! Let me rebase and try testing this locally to move this forward.

In this way, we can correlate the metrics of the runners with the usage done by the workflows

This is indeed important!

We currently need to correlate runner logs with workflow job logs to see which runner failed due to which job or which job failed on which runner, and correlating two unstructured log streams with the fact that two log streams contains the same job ID isn't that easy.

With this feature, we can just watch runner statuses instead, which would greatly eases troubleshooting.. Did I get it right?

Comment thread config/crd/bases/actions.summerwind.dev_runners.yaml Outdated
Comment thread apis/actions.summerwind.net/v1alpha1/runner_types.go
Comment thread apis/actions.summerwind.net/v1alpha1/runner_types.go
- token
type: object
workflow:
description: WorkflowStatus contains various information that is propagated from GitHub Actions workflow run environment variables to ease monitoring workflow run/job/steps that are triggerred on the runner.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

FYI, make manifests (or controller-tools controller-gen used internally by the make target) automatically reflects the Go field comment to this description field.

#!/usr/bin/env bash
set -u

exec update-status Running "Run $GITHUB_RUN_ID from $GITHUB_REPOSITORY" "$GITHUB_REPOSITORY" "$GITHUB_REPOSITORY_OWNER" "$GITHUB_WORKFLOW"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I modified your work to not take those as function arguments, and instead refer to envvars presuming they are all optional, so that we won't bloat function parameters and arguments as we add more.

Comment thread runner/update-status
@mumoshu

mumoshu commented Dec 31, 2022

Copy link
Copy Markdown
Collaborator

@Moser-ss I've updated your awesome work with improvements and suggestions. I'd appreciate it if you could confirm all! Thanks in advance for your help.

@Moser-ss

Copy link
Copy Markdown
Contributor Author

@mumoshu Thanks a lot for the rework; after I saw the fine-tuning you did, this PR looks even better. I like all the changes

@Moser-ss

Copy link
Copy Markdown
Contributor Author

With this feature, we can just watch runner statuses instead, which would greatly eases troubleshooting.. Did I get it right?

It is not only about the logs, but is about also about resources, especially when I have OOM or pod evictions. Now when I got an OOM I can go to GitHub find the right workflow run and repository and understand why we have that OOM

@mumoshu

mumoshu commented Jan 11, 2023

Copy link
Copy Markdown
Collaborator

@Moser-ss Makes sense a lot! Thank you so much for your explanation ☺️

@Moser-ss

Copy link
Copy Markdown
Contributor Author

@mumoshu Any idea when this PR can be merged? do we have any blocker?

@mumoshu

mumoshu commented Jan 18, 2023

Copy link
Copy Markdown
Collaborator

@Moser-ss We had to defer this until we merge a big PR to make testing and conflict resolution easier! Thanks for your patience. Let me merge this now.

@mumoshu mumoshu enabled auto-merge (squash) January 18, 2023 00:09

@mumoshu mumoshu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks a lot for your contribution @Moser-ss ☺️

@mumoshu mumoshu merged commit 606ed1b into actions:master Jan 18, 2023
unpollito pushed a commit to DistruApp/actions-runner-controller that referenced this pull request Jan 21, 2026
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs triage Requires review from the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants