synth_ai.sdk.harbor.build_spec
HarborBuildSpec - User-facing abstraction for Harbor deployment uploads.
This module defines the primary user-facing abstraction for uploading deployments
to Harbor. Users define a HarborBuildSpec with their Dockerfile, context, and
configuration, then use the SDK to package and upload it.
Example:
Classes
HarborLimits
Resource limits for Harbor deployment execution.
Attributes:
timeout_s: Maximum execution time in seconds (30-3600, default: 300)cpu_cores: Number of CPU cores (1-8, default: 2)memory_mb: Memory limit in MB (512-32768, default: 4096)disk_mb: Disk space limit in MB (1024-102400, default: 10240)
to_dict
HarborBuildSpec
User-facing spec for Harbor deployment upload.
This is the primary abstraction users interact with. Define your deployment
configuration here, then use upload_harbor_deployment() to package and upload.
Attributes:
name: Deployment name (org-unique, 1-128 chars)dockerfile_path: Path to Dockerfile (relative or absolute)context_dir: Directory to package as build contextentrypoint: Command to run (default: standard rollout runner)entrypoint_mode: “file” for JSON I/O or “stdio” for long-running commandsdescription: Optional human-readable descriptionenv_vars: Environment variables (no LLM API keys allowed)limits: Resource limits (timeout, CPU, memory, disk)metadata: Additional metadata (agent_type, benchmark, version, etc.)include_globs: File patterns to include (default: all files)exclude_globs: File patterns to exclude (default: .git, pycache)
validate_paths
FileNotFoundError: If Dockerfile or context_dir doesn’t exist
get_dockerfile_content
- Dockerfile content as string
FileNotFoundError: If Dockerfile doesn’t exist
to_api_request
context_tar_base64: Base64-encoded tar.gz of the build context
- Dictionary suitable for POST /api/harbor/deployments
HarborDeploymentRef
Reference to an existing Harbor deployment.
Used when configuring LocalAPIConfig to use Harbor as the execution backend.
The deployment must already exist and be in READY state.
Attributes:
deployment_id: UUID of the existing deploymentbackend_url: Synth backend URL (default: from SYNTH_BACKEND_URL env)api_key: Synth API key (default: from SYNTH_API_KEY env)
rollout_url
status_url
HarborDeploymentResult
Result of a Harbor deployment upload operation.
Returned by upload_harbor_deployment() after successful upload.
Attributes:
deployment_id: UUID of the created deploymentbuild_id: UUID of the triggered build (if auto_build=True)name: Deployment namestatus: Current deployment statussnapshot_id: Daytona snapshot ID (set after build completes)
to_ref
backend_url: Override backend URL (default: from environment)api_key: Override API key (default: from environment)
- HarborDeploymentRef for this deployment