Skip to main content

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

OptionDescriptionDefault
--env, -eEnvironment (development, staging, production)development
--arch, -aTarget architecture (cpu, cuda, gpu)Auto-detected
--indexPath to index/manifest filenull
--validateRun validation checks before buildfalse
--strictEnable strict error handlingfalse
--cleanClean output directory before buildfalse
--watch, -wRun build in watch modefalse
--analyzeAnalyze build output after completionfalse
--pushPush Docker image to registry after buildfalse
--tag, -tTag for the Docker imageAuto-generated
-f, --forceForce build despite warningsfalse
-i, --interactiveStep-by-step build confirmationsfalse

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 a Dockerfile exists) and pushes it when --push is set.
ArchitectureUse caseNotes
cpuAll frameworksLightweight, CPU inference
cudaPyTorchValidates CUDA availability
gpuTensorFlowValidates GPU availability

Traditional application builds

For non-ML projects with build configuration. Reads settings from cirron.yaml, sets environment variables, runs beforeBuild commands, the main build command, then afterBuild commands. Use --analyze to inspect output.

Configuration

ML project:
Traditional 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 named registry/organization/project:tag. Configure with CIRRON_REGISTRY and CIRRON_ORG:
.cirronignore patterns are automatically merged into .dockerignore during build.

Environment Variables

VariableDescriptionExample
NODE_ENVNode environmentproduction
CIRRON_ENVCirron environmentproduction
Per-environment overrides live in cirron.yaml:

Build Output

With --analyze:

Watch Mode

Troubleshooting

ErrorResolution
No cirron.yaml foundcirron init my-project
Build command failed with exit code 1cat cirron.yaml to verify command; try cirron build --clean; reinstall deps
CUDA not available for PyTorchUse --arch cpu, install CUDA, or verify with nvidia-smi
Docker build issuesdocker --version, check disk space (df -h)
Registry push failuresdocker login, verify image exists with docker images
Large/slow buildsUse .dockerignore, verify memory/disk capacity
DebuggingCIRRON_VERBOSE=1, run with --validate first

Best Practices and CI/CD

  • Run --validate for production builds.
  • Choose architecture to match the target deployment hardware.
  • Use index files for complex model configurations.
  • Use --clean and meaningful --tag values for production.
  • Use .cirronignore to keep build context lean.