Documentation
¶
Overview ¶
Package bootstrap wires process startup dependencies.
Index ¶
- Constants
- Variables
- func BuildArtifactStorage(cfg config.WorkspaceStorageConfig, ...) (artifactsvc.ContentStore, error)
- func BuildPersistStorage(cfg config.WorkspaceStorageConfig, persistRoot func(spaceID string) string, ...) (blob.PersistStorage, error)
- func BuildPluginPackageStorage(cfg config.WorkspaceStorageConfig, workspacesDir string, ...) (plugin.PackageStore, string)
- func BuildRunOutputStorage(cfg config.WorkspaceStorageConfig, ...) (blob.RunOutputStorage, error)
- func BuildS3Client(ctx context.Context, cfg config.WorkspaceStorageConfig) (blob.S3Client, error)
- func RunAdminCommand(ctx context.Context, args []string, out io.Writer) error
- func RunModelCommand(ctx context.Context, args []string, out io.Writer) error
- func RunRunTokenCommand(ctx context.Context, args []string, out io.Writer) error
- func RunServer(ctx context.Context, portOverride int) error
- func RunUserCommand(ctx context.Context, args []string, out io.Writer) error
- func RunWorker(ctx context.Context, taskRunID string) error
Constants ¶
const AdminCommandUsage = `` /* 931-byte string literal not displayed */
AdminCommandUsage is the help text for `buildmax-server admin`.
const ModelCommandUsage = `` /* 2004-byte string literal not displayed */
ModelCommandUsage is the help text for `buildmax-server model`.
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.
const RunTokenCommandUsage = `` /* 477-byte string literal not displayed */
RunTokenCommandUsage is the help text for `buildmax-server run-token`.
const UserCommandUsage = `` /* 800-byte string literal not displayed */
UserCommandUsage is the help text for `buildmax-server user`.
Variables ¶
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 ¶
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 ¶
RunAdminCommand executes `buildmax-server admin ...`. args excludes the "admin" word itself.
func RunModelCommand ¶
RunModelCommand executes `buildmax-server model ...`. args excludes the "model" word itself.
func RunRunTokenCommand ¶
RunRunTokenCommand executes `buildmax-server run-token ...`. args excludes the "run-token" word itself.
func RunServer ¶
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 ¶
RunUserCommand executes `buildmax-server user ...`. args excludes the "user" word itself.
Types ¶
This section is empty.