Documentation
¶
Overview ¶
package fusefile is the canonical authoring format for a fuse environment. a Fusefile is parsed and compiled client-side into the orchestrator wire (CreateEnvironmentRequest); the orchestrator never sees a Fusefile.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KindSupportsMIG ¶ added in v0.7.0
KindSupportsMIG reports whether a GPU kind can plausibly run a MIG profile. An empty kind (unknown at request time) and any unrecognized kind return true so the scheduler's per-device MIGCapable flag remains the source of truth; only a kind on the known non-MIG denylist returns false. Matching is case-insensitive and substring-based so "NVIDIA V100" and "v100-sxm2" both resolve.
func ValidGPUProfile ¶ added in v0.7.0
ValidGPUProfile reports whether s is a well-formed MIG profile name ("1g.10gb", "2g.20gb", ...). Shared with the API layer's request validation so raw SDK callers are held to the same vocabulary as Fusefile authors.
Types ¶
type Compiled ¶
type Compiled struct {
Spec ResourceSpec
ManifestJSON []byte
StartupScript string
RequiredSecrets []string
Expose []ExposeSpec
// BuildScript is the setup phase alone, for `fuse build` to run through
// the exec path (600s) rather than the startup-script path (30s).
// StartupScript still carries setup+run, so `fuse up` is unchanged.
BuildScript string
// RunScript is the run command alone, for a boot whose setup phase is
// already baked into a seed rootfs (`fuse up --from-build`). Replaying
// setup there would redo the work the artifact exists to skip.
RunScript string
}
Compiled is the result of compiling a Fusefile: the resource spec, the manifest json to upload to the guest, the startup script to run, the secrets the environment needs at create time, and any ports to expose.
type EnvValue ¶
type EnvValue struct {
Value string `yaml:"value,omitempty"`
Secret string `yaml:"secret,omitempty"`
}
EnvValue is either a literal value or a secret reference. exactly one is set.
type ExposeSpec ¶
ExposeSpec requests that a guest port be published as a reachable endpoint. Mirrors Fusefile's Expose entries one-for-one.
type Fusefile ¶
type Fusefile struct {
Version int `yaml:"version"`
Image string `yaml:"image,omitempty"`
Resources Resources `yaml:"resources,omitempty"`
Setup []string `yaml:"setup,omitempty"`
Services map[string]Service `yaml:"services,omitempty"`
Run string `yaml:"run,omitempty"`
Workspace string `yaml:"workspace,omitempty"`
Expose []Expose `yaml:"expose,omitempty"`
Secrets []string `yaml:"secrets,omitempty"`
}
Fusefile is the v1 authoring contract.
type ResourceSpec ¶
type ResourceSpec struct {
CPUs int32
RamMB int32
StorageGB int32
Region string
MaxRuntimeSeconds int64
Image string
GPUs int32
GPUKind string
GPUProfile string
}
ResourceSpec mirrors internal/api.ResourceSpec field-for-field so the CLI can copy Compiled.Spec into the sdk/api spec without importing the api package.
Image selects the VM's base rootfs at create time (a name resolved by the firecracker host agent to a pre-baked rootfs file; see FUSEFILE_PLAN.md Phase 7). It lives here, not in the manifest json, because rootfs selection happens at Provider.Create — before the guest boots and long before the manifest is ever uploaded to it.
type Resources ¶
type Resources struct {
CPUs int32 `yaml:"cpus,omitempty"`
GPU int `yaml:"gpu,omitempty"` // device count: whole GPUs, or MIG instances when gpu_profile is set
GPUKind string `yaml:"gpu_kind,omitempty"` // optional match, e.g. "a100"
// GPUProfile requests fractional GPU allocation: a MIG profile in
// nvidia mig-parted vocabulary (e.g. "1g.10gb", "2g.20gb"). When set,
// `gpu` counts MIG instances of this profile rather than whole
// devices (decision D5). Empty means whole-device allocation.
GPUProfile string `yaml:"gpu_profile,omitempty"`
Memory string `yaml:"memory,omitempty"` // e.g. "2GB"
Storage string `yaml:"storage,omitempty"` // e.g. "10GB"
MaxRuntime string `yaml:"max_runtime,omitempty"` // go duration
}
Resources is the human-friendly hardware spec; compiled to ResourceSpec.