composeremote

package
v0.209.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package composeremote places a composition on a fleet node and brings the video back, so a machine with no composition lane of its own (a thin client) calls offload_compose_video exactly as a render node does (ADR 0071). It mirrors visionremote: probe delegate_remotes through /fleet/health, pick a node that advertises the task, dispatch with the fleet bearer, poll the job, and map every failure to a typed defer.

Two kinds of request travel:

  • a vetted template (template + variables) goes through the fleet's template door, compose-video over /fleet/dispatch, which every node with the lane serves;
  • a project (project_dir, or an inline html composition) is packed into a bundle, checked here with the same confinement rules the node applies (composebundle), and sent to the token-gated compose-project door, which only nodes that opened it advertise.

The node writes the video (and any snapshots) into its own media dir; they are fetched back by name from /fleet/media into the caller's `out` or this box's media dir, and the result's paths are rewritten to the local copies. The node's typed failure reason (LINT_ERRORS, CHECK_FAILED, ...) is passed through unchanged.

Index

Constants

View Source
const (
	RouteLocal  = "local"
	RouteAuto   = "auto"
	RouteRemote = "remote"
)
View Source
const (

	// Budget bounds one remote composition end to end when the caller set no deadline: a 30-minute
	// render (compose_timeout_sec's default) plus the transfers.
	Budget = 45 * time.Minute
)

Variables

View Source
var HTTPClient = &http.Client{Transport: netguard.SafeTransport(nil), CheckRedirect: rosterprobe.NoRedirect}

HTTPClient is the transport every request uses; tests swap it. netguard.SafeTransport limits the lane to loopback and the operator's tailnet at dial time (never cloud, ADR 0001).

Functions

func Call

func Call(ctx context.Context, cfg config.Config, req core.Request) (core.Result, error)

Call runs req on the best eligible fleet node and fetches its outputs. A placement, transfer or bundle problem is an error the caller maps to a defer class; the node's own verdict (a render that deferred) comes back as a deferred core.Result.

func NormalizeRoute

func NormalizeRoute(route string) (string, bool)

NormalizeRoute maps the caller's route to one of the three values; "" is auto.

func Run

func Run(ctx context.Context, cfg config.Config, runner Runner, req core.Request, route string) core.Result

Run is the entry point the MCP tool and the CLI verb share. local runs here; remote runs on a fleet node; auto runs here when this box has the composition lane (byte-identical to before the route existed) and on a fleet node when it has none.

Types

type Runner

type Runner interface {
	Run(ctx context.Context, req core.Request) core.Result
}

Runner runs one request in-process; *pipeline.Pipeline satisfies it.

Jump to

Keyboard shortcuts

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