Expand description
ZLayer V1 Service Specification
This crate provides types for parsing and validating ZLayer deployment specifications.
Structs§
- ApiSpec
- API server configuration (embedded in deploy/up flows)
- Command
Spec - Command override specification (Section 5.5)
- Depends
Spec - Dependency specification
- Deployment
Spec - Top-level deployment specification
- Device
Spec - Device passthrough specification
- Distributed
Config - Configuration for distributed GPU job coordination.
- Endpoint
Spec - Endpoint specification (proxy binding)
- Endpoint
Tunnel Config - Tunnel configuration for an endpoint
- Errors
Spec - Error handling policies
- GpuSpec
- GPU resource specification
- Health
Spec - Health check specification
- Image
Spec - Container image specification
- Init
Failure Policy - Init failure policy
- Init
Spec - Init actions specification
- Init
Step - Init action step
- Join
Policy - Join policy - controls who can join a service
- Network
Spec - Network configuration
- Node
Selector - Node selection constraints for service placement
- Overlay
Config - Overlay network configuration
- Overlay
Settings - Overlay network settings
- Panic
Policy - Panic policy
- Resources
Spec - Resource limits (upper bounds, not reservations)
- Scale
Targets - Target metrics for adaptive scaling
- Service
Spec - Per-service specification
- Stream
Endpoint Config - Stream (L4) proxy configuration for TCP/UDP endpoints
- Tunnel
Access Config - On-demand access settings for
zlayer tunnel access - Tunnel
Definition - Top-level tunnel definition (not tied to a service endpoint)
- Validation
Error - Validation errors for deployment specs
- Wasm
Capabilities - Explicit capability declarations for WASM modules. Controls which host interfaces are linked and available to the component.
- Wasm
Config - Comprehensive configuration for all WASM service types.
- Wasm
Http Config Deprecated - Configuration for WASM HTTP services with instance pooling
- Wasm
Preopen - Pre-opened directory for WASM filesystem access
Enums§
- Dependency
Condition - Dependency condition
- Expose
Type - Exposure type
- Failure
Action - Failure action for init steps
- GpuSharing
Mode - GPU sharing mode controlling how GPU resources are multiplexed.
- Health
Check - Health check type
- Init
Failure Action - Init failure action
- Join
Mode - Join mode
- Join
Scope - Join scope
- Node
Mode - How service replicas are allocated to nodes
- Panic
Action - Panic action
- Protocol
- Protocol type
- Pull
Policy - Image pull policy
- Resource
Type - Resource type - determines container lifecycle
- Scale
Spec - Scaling configuration
- Scheduling
Policy - Scheduling policy for GPU workloads
- Service
Type - Service type - determines runtime behavior and scaling model
- Spec
Error - Errors that can occur when parsing or validating a spec
- Storage
Spec - Storage mount specification
- Storage
Tier - Storage performance tier
- Stream
Health Check - Health check types for stream (L4) endpoints
- Timeout
Action - Timeout action
- Tunnel
Protocol - Protocol for tunnel connections (tcp or udp only)
- Validation
Error Kind - The specific kind of validation error
Functions§
- from_
yaml_ file - Parse a deployment spec from YAML file
- from_
yaml_ str - Parse a deployment spec from YAML string
- validate_
cpu - Validate CPU limit
- validate_
cpu_ option_ wrapper - Wrapper for
validate_cpufor use with validator crate Note: ForOption<f64>fields, validator crate unwraps and passes the innerf64 - validate_
cron_ schedules - Validate schedule/rtype consistency for all services
- validate_
dependencies - Validate that all dependency service references exist
- validate_
deployment_ name - Validate a deployment name
- validate_
deployment_ name_ wrapper - Wrapper for
validate_deployment_namefor use with validator crate - validate_
endpoint_ tunnel_ config - Validate an
EndpointTunnelConfig - validate_
env_ vars - Validate all environment variable values in a service spec
- validate_
image_ name - Validate an image name
- validate_
image_ name_ wrapper - Wrapper for
validate_image_namefor use with validator crate - validate_
memory_ format - Validate memory format
- validate_
memory_ option_ wrapper - Wrapper for
validate_memory_formatfor use with validator crate Note: ForOption<String>fields, validator crate unwraps and passes&String - validate_
port - Validate a port number
- validate_
port_ wrapper - Wrapper for
validate_portfor use with validator crate Note: validator crate passes primitive types by value for custom validators - validate_
scale_ range - Validate scale range
- validate_
scale_ spec - Validate scale range (min <= max) for
ScaleSpec - validate_
schedule_ wrapper - Wrapper for
validate_cron_schedulefor use with validator crate Note: ForOption<String>fields, validator crate unwraps and passes&String - validate_
secret_ reference - Validate a secret reference name format
- validate_
service_ schedule - Validate schedule/rtype consistency for a single service
- validate_
storage_ name - Validate storage name format (lowercase alphanumeric with hyphens)
- validate_
storage_ name_ wrapper - Wrapper for
validate_storage_namefor use with validator crate - validate_
tunnel_ access_ config - Validate a
TunnelAccessConfig - validate_
tunnel_ definition - Validate a top-level
TunnelDefinition - validate_
tunnel_ ttl - Validate tunnel TTL format (e.g., “4h”, “30m”, “1d”)
- validate_
tunnels - Validate all tunnels in a deployment spec
- validate_
unique_ endpoints - Validate that endpoint names are unique within a service
- validate_
unique_ service_ endpoints - Validate that each service has unique endpoint names
- validate_
version - Validate that the version is “v1”
- validate_
version_ wrapper - Wrapper for
validate_versionfor use with validator crate - validate_
wasm_ config - Validate WASM configuration for a single service
- validate_
wasm_ configs - Validate WASM configuration for all services in a deployment spec
Type Aliases§
- Init
Params - Init action parameters