ops

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvictWorker

func EvictWorker(ctx context.Context, srv *server.Server, workerID, reason string)

EvictWorker is the single codepath for decommissioning a worker. Idempotent — safe to call concurrently from multiple goroutines. reason is recorded in the blockyard_workers_stopped_total metric and must be one of the telemetry.Reason* constants.

func GracefulShutdown

func GracefulShutdown(ctx context.Context, srv *server.Server)

GracefulShutdown stops all workers, removes managed resources, and fails in-progress builds. Called after HTTP server drain and background goroutine cancellation.

func PurgeApp added in v0.0.3

func PurgeApp(srv *server.Server, app *db.AppRow)

PurgeApp permanently removes an app's bundles, files, and database rows. The app must already have no running workers. Used by both the DeleteApp handler (immediate delete) and the sweeper.

func SpawnHealthPoller

func SpawnHealthPoller(ctx context.Context, srv *server.Server)

SpawnHealthPoller runs health checks at config.Proxy.HealthInterval. Blocks until ctx is cancelled.

func SpawnLogCapture

func SpawnLogCapture(
	ctx context.Context,
	srv *server.Server,
	workerID, appID string,
)

SpawnLogCapture starts a goroutine that streams logs from the backend into the LogStore for the given worker.

func SpawnLogRetentionCleaner

func SpawnLogRetentionCleaner(ctx context.Context, srv *server.Server)

SpawnLogRetentionCleaner periodically prunes expired log entries. Blocks until ctx is cancelled.

func SpawnSoftDeleteSweeper added in v0.0.3

func SpawnSoftDeleteSweeper(ctx context.Context, srv *server.Server)

SpawnSoftDeleteSweeper periodically purges soft-deleted apps whose retention period has expired. Blocks until ctx is cancelled. Does not start if soft_delete_retention is zero (soft-delete disabled — nothing to sweep).

func StartupCleanup

func StartupCleanup(ctx context.Context, srv *server.Server, passive bool) error

StartupCleanup removes orphaned resources and fails stale builds. Called in main() before binding the listener. When passive is true (rolling update), destructive operations that would kill workers the old server is handing off are skipped.

func StopAppSync added in v0.0.3

func StopAppSync(srv *server.Server, appID string)

StopAppSync stops all workers for an app synchronously. Marks workers as draining, waits for sessions to end (up to shutdown_timeout), then force-evicts. If no workers are running, this is a no-op.

Types

This section is empty.

Jump to

Keyboard shortcuts

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