Enhanced Runner Information: Transparent System Details for Your Workflows¶
Cirrus Runners now provides detailed system information directly in your workflow logs. This feature helps with debugging, ensures reproducibility, and improves transparency by showing exactly what software versions are available in your runner environment and when the image was last built.
The Challenge of Environment Transparency¶
When running CI/CD workflows, knowing the exact environment details can be crucial for debugging issues and ensuring reproducibility. Previously, developers had to add explicit steps to their workflows to print system information, which cluttered workflow definitions and added unnecessary execution time.
As GitHub Actions has grown in popularity, the need for a standardized way to expose runner information became apparent. This was especially important for custom runners like Cirrus Runners, where users benefit from knowing exactly what's available in their execution environment and when it was updated last.
Implementing the Runner Machine Info Feature¶
We've implemented support for the .setup_info
specification originally proposed in ADR 354.
This specification provides a standardized way for runners to expose system information directly in the "Set up job" step's log.
The implementation consists of two main components:
- A JSON template that defines what information to collect
- Our
setup-info-generator
tool that processes this template and generates the.setup_info
file
Here's an example of our template structure:
[
{
"group": "Runner Detail",
"detail": [
{
"name": "OS Information",
"script": "echo \"macOS $(sw_vers -productVersion) ($(sw_vers -buildVersion))\""
},
{
"name": "Build Date",
"script": "date +\"%Y-%m-%d\""
}
]
},
{
"group": "Software Detail",
"detail": [
{
"name": "Python Version",
"script": "python3 --version"
}
]
}
]
This template is processed during image creation, executing each command and collecting the output. The result is a .setup_info
file
that's placed in the runner's root directory.
Integration with Our VM Templates¶
We've integrated this feature into our VM template building process. The setup info generation happens as part of the Packer build process:
// Install setup-info-generator
provisioner "shell" {
inline = [
"source ~/.zprofile",
"brew install cirruslabs/cli/setup-info-generator"
]
}
// Copy setup info template
provisioner "file" {
source = "data/setup-info-template.json"
destination = "~/setup-info-template.json"
}
// Generate setup info
provisioner "shell" {
inline = [
"source ~/.zprofile",
"cat ~/setup-info-template.json | setup-info-generator > ~/actions-runner/.setup_info",
"rm ~/setup-info-template.json"
]
}
What You'll See in Your Workflows¶
With this implementation, when you run a workflow on Cirrus Runners, you'll now see an expandable section in the "Set up job" step that contains detailed information about the runner environment:
The Build Date is particularly useful as it allows you to quickly see when the runner image was updated last. This helps you identify if you're using a recently updated image.
Closing Remarks¶
If you have suggestions for additional information that would be helpful in your workflows, please don't hesitate to reach out to our support team at support@cirruslabs.org.