bootstrap

package
v0.2.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Overview

Package bootstrap wires process startup dependencies.

Index

Constants

View Source
const AdminCommandUsage = `` /* 931-byte string literal not displayed */

AdminCommandUsage is the help text for `buildmax-server admin`.

View Source
const ModelCommandUsage = `` /* 2004-byte string literal not displayed */

ModelCommandUsage is the help text for `buildmax-server model`.

View Source
const PluginPackagesDirName = ".marketplace"

PluginPackagesDirName is where a deployment with no object store keeps published packages. It is dot-prefixed so it cannot be mistaken for a space's workspace directory, which is what every other entry under workspaces_dir is.

View Source
const RunTokenCommandUsage = `` /* 477-byte string literal not displayed */

RunTokenCommandUsage is the help text for `buildmax-server run-token`.

View Source
const UserCommandUsage = `` /* 800-byte string literal not displayed */

UserCommandUsage is the help text for `buildmax-server user`.

Variables

View Source
var ErrAlreadyClaimed = errors.New("task run already claimed by another worker")

ErrAlreadyClaimed is returned by RunWorker when the run was already claimed by another worker.

Functions

func BuildArtifactStorage

func BuildArtifactStorage(cfg config.WorkspaceStorageConfig, artifactDir func(spaceID, artifactID string) string, s3Client blob.S3Client) (artifactsvc.ContentStore, error)

BuildArtifactStorage returns the configured storage for artifact content. artifactDir is (spaceID, artifactID) -> directory for the local-filesystem backend; the S3 backend derives its own key and ignores it.

func BuildPersistStorage

func BuildPersistStorage(cfg config.WorkspaceStorageConfig, persistRoot func(spaceID string) string, s3Client blob.S3Client) (blob.PersistStorage, error)

BuildPersistStorage returns the configured persist storage implementation.

func BuildPluginPackageStorage

func BuildPluginPackageStorage(cfg config.WorkspaceStorageConfig, workspacesDir string, s3Client blob.S3Client) (plugin.PackageStore, string)

BuildPluginPackageStorage returns storage for published plugin packages and the key prefix to build keys with.

There is no provider setting of its own. A deployment that has an object store keeps packages in it, and one that does not keeps them on the server's disk — the same decision it already made for everything else it stores, and one fewer knob to set inconsistently.

Packages are kept apart from space artifacts on purpose: a catalog record that vanished with a space's retention window could no longer explain an installation still sitting on somebody's machine.

func BuildRunOutputStorage

func BuildRunOutputStorage(cfg config.WorkspaceStorageConfig, runOutputDir func(spaceID, taskID, taskRunID string) string, s3Client blob.S3Client) (blob.RunOutputStorage, error)

BuildRunOutputStorage returns the configured run-output storage implementation. runOutputDir is (spaceID, taskID, taskRunID) -> path for run output files.

func BuildS3Client

func BuildS3Client(ctx context.Context, cfg config.WorkspaceStorageConfig) (blob.S3Client, error)

BuildS3Client creates an S3-compatible client. Use when either provider is minio.

Two shapes are supported, and the endpoint is what distinguishes them: a deployment naming an endpoint is talking to a store it runs or a vendor's S3-compatible service, while one that names none is talking to AWS S3 and wants the SDK's own regional endpoint resolution.

Credentials follow the same principle. Static keys are used when configured; leaving them empty falls through to the SDK's default chain, which is how a cluster reaches a bucket through IRSA, workload identity, or an instance profile instead of a long-lived key the deployment has to store and rotate.

func RunAdminCommand

func RunAdminCommand(ctx context.Context, args []string, out io.Writer) error

RunAdminCommand executes `buildmax-server admin ...`. args excludes the "admin" word itself.

func RunModelCommand

func RunModelCommand(ctx context.Context, args []string, out io.Writer) error

RunModelCommand executes `buildmax-server model ...`. args excludes the "model" word itself.

func RunRunTokenCommand

func RunRunTokenCommand(ctx context.Context, args []string, out io.Writer) error

RunRunTokenCommand executes `buildmax-server run-token ...`. args excludes the "run-token" word itself.

func RunServer

func RunServer(ctx context.Context, portOverride int) error

RunServer loads server.yaml, resolves the listen port (flag overrides config), opens the DB, builds blob storage, starts the scheduler, and runs the HTTP server. portOverride > 0 takes priority over the port in server.yaml.

func RunUserCommand

func RunUserCommand(ctx context.Context, args []string, out io.Writer) error

RunUserCommand executes `buildmax-server user ...`. args excludes the "user" word itself.

func RunWorker

func RunWorker(ctx context.Context, taskRunID string) error

RunWorker reads server.yaml for connection and storage config, fetches the task run from the server, marks it RUNNING, executes the agent, and uploads artifacts.

Types

This section is empty.

Jump to

Keyboard shortcuts

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