fusefile

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 12 Imported by: 0

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

This section is empty.

Types

type Compiled

type Compiled struct {
	Spec            ResourceSpec
	ManifestJSON    []byte
	StartupScript   string
	RequiredSecrets []string
	Expose          []ExposeSpec
}

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.

func Compile

func Compile(f *Fusefile) (*Compiled, error)

Compile turns the human-friendly Fusefile.Resources into a ResourceSpec.

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 Expose

type Expose struct {
	Port int    `yaml:"port"`
	As   string `yaml:"as,omitempty"`
}

Expose publishes a guest port to the outside world.

type ExposeSpec

type ExposeSpec struct {
	Port int
	As   string
}

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.

func Parse

func Parse(data []byte) (*Fusefile, error)

Parse decodes a Fusefile from yaml bytes using a strict decoder (unknown fields are rejected) and then validates the result. It returns the parsed Fusefile only if it is structurally valid.

type ResourceSpec

type ResourceSpec struct {
	CPUs              int32
	RamMB             int32
	StorageGB         int32
	Region            string
	MaxRuntimeSeconds int64
	Image             string
	GPUs              int32
	GPUKind           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"`         // whole-device count
	GPUKind    string `yaml:"gpu_kind,omitempty"`    // optional match, e.g. "a100"
	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.

type Service

type Service struct {
	Image string              `yaml:"image"`
	Ports []int               `yaml:"ports,omitempty"`
	Env   map[string]EnvValue `yaml:"env,omitempty"`
}

Service is one in-vm service; compiled to manifest.services and a compose unit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL