catalog

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package catalog holds Levelrail's own curated set of one-click service templates (ADR 015). Every Template's name, slogan, and Compose body here is written fresh for this platform: none of it is copied or lightly-rewritten from any other project's own dataset. Image tags are real, versioned tags for each well-known open-source project; where a specific tag's exact string couldn't be verified against a live registry in this environment, that entry says so in its own comment.

Index

Constants

This section is empty.

Variables

View Source
var Templates = concat(
	starterKitsTemplates,
	automationTemplates,
	monitoringTemplates,
	storageTemplates,
	analyticsTemplates,
	infrastructureTemplates,
	securityTemplates,
	productivity1Templates,
	productivity2Templates,
	productivity3Templates,
	applicationsTemplates,
	devtools1Templates,
	devtools2Templates,
	dashboardTemplates,
	financeTemplates,
	media1Templates,
	media2Templates,
	communicationTemplates,
	databasesTemplates,
	iotTemplates,
	aiml1Templates,
	aiml2Templates,
	selfhosted1Templates,
	selfhosted2Templates,
	selfhosted3Templates,
	selfhosted4Templates,
	aiTemplates,
	devtoolsBatchTemplates,
	productivityBatchTemplates,
	automationBatchTemplates,
	catalogBatch2Templates,
	catalogBatch3Templates,
	catalogBatch4Templates,
	catalogBatch5Templates,
	catalogBatch6Templates,
	contribTemplates,
	manifestTemplates,
)

Templates is the full catalog, served by GET /api/v1/service-templates and GET /api/v1/service-templates/{id}. contribTemplates (contrib.go) are contributor-submitted YAML entries, merged in last so they're indistinguishable from the hand-written Go ones to every consumer.

Functions

func ValidateCompose added in v0.2.0

func ValidateCompose(body []byte) (map[string]bool, error)

ValidateCompose runs a compose body through the same parse, magic-var and translation steps a real deploy uses, with stand-in secrets, and returns the declared service keys. A later catalog import batch runs this over every candidate file (scripts/validate-templates).

Types

type DomainPrompt added in v0.2.0

type DomainPrompt struct {
	Service     string `yaml:"service" json:"service"`
	Port        int    `yaml:"port" json:"port"`
	Description string `yaml:"description" json:"description,omitempty"`
}

DomainPrompt is a service the installer offers to put behind a domain.

type EnvPrompt added in v0.2.0

type EnvPrompt struct {
	Key         string `yaml:"key" json:"key"`
	Label       string `yaml:"label" json:"label,omitempty"`
	Description string `yaml:"description" json:"description,omitempty"`
	Default     string `yaml:"default" json:"default,omitempty"`
	Generate    string `yaml:"generate" json:"generate,omitempty"`
	Length      int    `yaml:"length" json:"length,omitempty"`
	Required    bool   `yaml:"required" json:"required,omitempty"`
	Secret      bool   `yaml:"secret" json:"secret,omitempty"`
}

EnvPrompt is one ${KEY} placeholder the installer asks for.

type InstallInput added in v0.2.0

type InstallInput struct {
	Env     map[string]string
	Domains map[string]string
}

InstallInput is what an operator supplies when installing a manifest.

type Manifest added in v0.2.0

type Manifest struct {
	ID                     string               `yaml:"id" json:"id"`
	Name                   string               `yaml:"name" json:"name"`
	Description            string               `yaml:"description" json:"description"`
	Icon                   string               `yaml:"icon" json:"icon,omitempty"`
	Category               string               `yaml:"category" json:"category"`
	DocumentationURL       string               `yaml:"documentation_url" json:"documentation_url"`
	ComposeFile            string               `yaml:"compose_file" json:"-"`
	RecommendedMemoryBytes int64                `yaml:"recommended_memory_bytes" json:"recommended_memory_bytes,omitempty"`
	Env                    []EnvPrompt          `yaml:"env" json:"env,omitempty"`
	Domains                []DomainPrompt       `yaml:"domains" json:"domains,omitempty"`
	Healthcheck            *ManifestHealthcheck `yaml:"healthcheck" json:"healthcheck,omitempty"`
	Compose                string               `yaml:"-" json:"-"`
}

Manifest is one template directory: template.yaml plus the compose file it names.

func LoadManifest added in v0.2.0

func LoadManifest(fsys fs.FS, dir string) (Manifest, error)

LoadManifest reads and validates one template directory.

func LoadManifests added in v0.2.0

func LoadManifests(fsys fs.FS, dir string) ([]Manifest, error)

LoadManifests reads every <dir>/<id>/template.yaml in fsys, sorted by id, and validates each one. All problems are reported, not just the first.

func (Manifest) Render added in v0.2.0

func (m Manifest) Render(in InstallInput, allowMissing bool) (string, error)

Render returns the manifest's compose file with every prompt filled in. Values are substituted into parsed YAML scalars, never into raw text, so an operator value cannot change the document's structure. With allowMissing, a required prompt with no value becomes an unresolved magic var, which the deploy path reports as "needs configuration".

func (Manifest) Template added in v0.2.0

func (m Manifest) Template() (Template, error)

Template converts the manifest into a catalog entry; its Compose is the default render, so the generic one-click path keeps working.

func (Manifest) Validate added in v0.2.0

func (m Manifest) Validate() error

Validate checks the manifest's fields, that its prompts and placeholders match one to one, and that a sample render deploys through the compose path.

type ManifestHealthcheck added in v0.2.0

type ManifestHealthcheck struct {
	Service string `yaml:"service" json:"service"`
	Port    int    `yaml:"port" json:"port"`
	Path    string `yaml:"path" json:"path"`
}

ManifestHealthcheck is the HTTP check that proves an install actually serves.

type Template

type Template struct {
	ID               string
	Name             string
	Slogan           string
	Category         string
	DocumentationURL string
	Compose          string
	// RecommendedMemoryBytes is a static, pre-deploy RAM advisory (zero
	// means none). Informational only, not checked against any node's
	// real available memory.
	RecommendedMemoryBytes int64
	// RequiresGPU marks entries that reserve an NVIDIA GPU through
	// deploy.resources.reservations.devices in their Compose body.
	RequiresGPU bool
	// Manifest is set for entries loaded from manifests/ (env prompts, domains, healthcheck).
	Manifest *Manifest
}

Template is one deployable entry in the catalog. Compose is a full compose.yaml body, valid against internal/compose's supported subset (see catalog_test.go, which parses and validates every one).

func TemplateByID added in v0.2.0

func TemplateByID(id string) (Template, bool)

TemplateByID returns the Templates entry with this ID, or false if none matches.

Jump to

Keyboard shortcuts

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