Repository navigation
Conversation
Signed-off-by: fernvenue <git@fernvenue.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refs #971.
In non-agent mode the install template starts the runner service (
systemctl enable --now) and only afterwards reads the agent ID and reportsidle. An ephemeral runner can pick up an already-queued job in between: the forge reports the jobin_progress, garm marks the runneractive, and the finalidlestatus callback is then rejected with 401 by the instance middleware, because the runner is no longerinstalling/pending. garm never records the agent ID.This moves the agent ID lookup, the system-info report and the
idlestatus report beforesystemctl enable --now, as suggested on #971. Agent mode is unchanged.Tested on a self-hosted Gitea (latest) with an external ECS provider, non-agent mode, by applying the same reordering to a copy of this template: the final status callback returns 200 instead of 401, the runner goes
pending->installing->activewith its agent ID recorded, and the job completes. Agent mode was not tested.Trade-off:
idleis now reported before the service is started. Ifsystemctl enable --nowfails afterwards, garm cannot be told, because the runner status transitions do not allowidle->failed.Only the Gitea Linux template is changed. The GitHub Linux template appears to share the ordering (
svc.sh startcomes before reading.runnerand the idle report), but I have not changed or tested it.Not addressed here:
job never got assigned to a runner, ignoringis still logged fromhandleCompletedJobwhen the completed event carries an empty runner name. That is separate from the 401.