Skip to content

Detect when Cirrus job runs out of CI minutes #10

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pipo
Copy link

@pipo pipo commented Oct 21, 2024

In the 'libvirt' project we started to run out of the free Cirrus CI credits at the end of the month. It's annoying as it looks exactly like the job has failed.

These patches add detection of the state and introduce a new return code so that it can be handled from scripts.

pipo and others added 3 commits April 22, 2025 17:11
Add a section about return values from the script and document existing
cases.

Signed-off-by: Peter Krempa <[email protected]>
When a Cirrus CI job started by 'cirrus-run' fails due lack of CI
credits, it would look exactly like a failure in the job itself, thus
the user would not be able to distinguish the problems.

If a 'taks' failed due to CI minute lack, the 'notifications' field of
given 'task' contains the following message:

 Failed to start an instance: FAILED_PRECONDITION: Monthly compute limit exceeded!

To detect this, receive also task data and their notifications when
waiting for a job and look for the message about CI credits.

In order to see this status from scripts this will also return a new
error code '3' if the out of CI credits situation is detected.

Additionally in order to allow quick adaptation when the above string
will be changed add '--cirrus-out-of-ci-credits-message' parameter which
can configure the string.

Signed-off-by: Peter Krempa <[email protected]>
When watching a build in a gitlab job, seeing that the job is still
executing in Cirrus is useful, but even more useful is having access
to a clickable URL to jump from the gitlab job into the Cirrus job.
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.

2 participants