A robust Rust agent for provisioning and managing CI/CD runners through the Cirun platform, offering automated VM lifecycle management with Lume virtualization.
- Automatic VM Provisioning: Clone and configure runner VMs from templates
- Lifecycle Management: Provision and delete CI/CD runners on demand
- Template-based Deployment: Use a base template for consistent runner configurations
- Continuous Communication: Regular status reporting to the Cirun API
- Persistent Agent Identity: Maintains a consistent identifier across restarts
- Environment Detection: Auto-detects system information and capabilities
curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/cirunlabs/cirun-agent/refs/heads/main/install.sh | shcargo install cirun-agentgit clone https://github.com/cirun-io/cirun-agent
cd cirun-agent
cargo build --releaseCheckout docs for quick start guide: https://docs.cirun.io/on-prem
| Argument | Short | Description | Default |
|---|---|---|---|
--api-token |
-a |
API token for authentication | (Required) |
--interval |
-i |
Polling interval in seconds | 10 |
--id-file |
-f |
Agent ID file path | .agent_id |
| Variable | Description | Default |
|---|---|---|
CIRUN_API_URL |
Base URL for Cirun API | https://api.cirun.io/api/v1 |
Cirun-agent relies on Lume for VM provisioning and management. Lume is a lightweight virtualization platform that enables efficient cloning and management of virtual machines.
Note: The cirun-agent automatically manages the Lume process, so there's no need to install or configure Lume separately. The agent handles all interactions with Lume internally.
Set up the agent on any machine with virtualization capabilities to automatically provision CI/CD runners when needed, and clean them up after use.
# Run with custom polling interval (30 seconds)
cirun-agent --api-token YOUR_API_TOKEN --interval 30- Create a VM named
cirun-runner-templateusing Lume - Configure it with your required tools and settings
- Start the agent - it will clone this template when provisioning new runners
The agent works by:
- Registering itself with the Cirun API using a persistent UUID
- Polling the API at regular intervals for runner provisioning/deletion requests
- Using Lume to clone VMs from a template and run provisioning scripts
- Reporting VM status back to the Cirun platform
- Rust 1.54 or later
- Access to Lume virtualization
- Cirun API credentials
cargo buildcargo testThe project uses Clippy for linting and rustfmt for code formatting.
rustup component add clippy rustfmtcargo clippyTo automatically fix some linting issues:
cargo clippy --fixcargo fmtRun both linting and formatting checks before committing:
cargo fmt -- --check && cargo clippyEnable detailed logs by setting the RUST_LOG environment variable:
RUST_LOG=debug cirun-agent --api-token YOUR_API_TOKENFor comprehensive documentation about Cirun and the on-premises deployment options, visit:
- Slack: slack.cirun.io
- Email: [email protected]
This project is licensed under the MIT License - see the LICENSE file for details.
- Update the version in Cargo.toml
- Make sure all changes are staged for commit
- Run the release script:
./release.sh
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request