cirron build
Build ML models and Docker containers for your projects with intelligent project detection, validation, and registry configuration. Supports both ML model compilation and traditional application builds.Usage
Options
| Option | Description | Default |
|---|---|---|
--env, -e | Environment (development, staging, production) | development |
--arch, -a | Target architecture (cpu, cuda, gpu) | Auto-detected |
--index | Path to index/manifest file | null |
--validate | Run validation checks before build | false |
--strict | Enable strict error handling | false |
--clean | Clean output directory before build | false |
--watch, -w | Run build in watch mode | false |
--analyze | Analyze build output after completion | false |
--push | Push Docker image to registry after build | false |
--tag, -t | Tag for the Docker image | Auto-generated |
-f, --force | Force build despite warnings | false |
-i, --interactive | Step-by-step build confirmations | false |
Build Types
ML model builds
For projects with ML frameworks (PyTorch, TensorFlow, Scikit-learn). The command detects the target architecture, validates files and dependencies, compiles the model for the target architecture, generates artifacts and metadata, then builds a Docker image (if aDockerfile exists) and pushes it when --push is set.
| Architecture | Use case | Notes |
|---|---|---|
cpu | All frameworks | Lightweight, CPU inference |
cuda | PyTorch | Validates CUDA availability |
gpu | TensorFlow | Validates GPU availability |
Traditional application builds
For non-ML projects with build configuration. Reads settings fromcirron.yaml, sets environment variables, runs beforeBuild commands, the main build command, then afterBuild commands. Use --analyze to inspect output.
Configuration
ML project:Validation
With--validate:
- ML projects: required files (
src/model.py,requirements.txt), Python version compatibility, CUDA/GPU availability for GPU architectures, model instantiation, index file format. - Traditional projects: build configuration in
cirron.yaml, command availability, dependencies, output directory writable.
Docker and Registry
Images are namedregistry/organization/project:tag. Configure with CIRRON_REGISTRY and CIRRON_ORG:
.cirronignore patterns are automatically merged into .dockerignore during build.
Environment Variables
| Variable | Description | Example |
|---|---|---|
NODE_ENV | Node environment | production |
CIRRON_ENV | Cirron environment | production |
cirron.yaml:
Build Output
--analyze:
Watch Mode
Troubleshooting
| Error | Resolution |
|---|---|
No cirron.yaml found | cirron init my-project |
Build command failed with exit code 1 | cat cirron.yaml to verify command; try cirron build --clean; reinstall deps |
CUDA not available for PyTorch | Use --arch cpu, install CUDA, or verify with nvidia-smi |
| Docker build issues | docker --version, check disk space (df -h) |
| Registry push failures | docker login, verify image exists with docker images |
| Large/slow builds | Use .dockerignore, verify memory/disk capacity |
| Debugging | CIRRON_VERBOSE=1, run with --validate first |
Best Practices and CI/CD
- Run
--validatefor production builds. - Choose architecture to match the target deployment hardware.
- Use index files for complex model configurations.
- Use
--cleanand meaningful--tagvalues for production. - Use
.cirronignoreto keep build context lean.