Skip to main content

Setup

Registers Run and Task service handlers on the SetupContext mux. Requires sc.DB and sc.DataStore to be set. When sc.K8sConfig is provided, RunLogsService is also mounted to enable pod log streaming.

def Setup(
ctx: context.Context,
sc: *app.SetupContext
) - > error

Registers Run and Task service handlers on the SetupContext mux. Requires sc.DB and sc.DataStore to be set. When sc.K8sConfig is provided, RunLogsService is also mounted to enable pod log streaming.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the setup operations, used for cancellation and carrying request-scoped values.
sc*app.SetupContextThe setup context containing necessary dependencies like the database connection (sc.DB), data store (sc.DataStore), Kubernetes configuration (sc.K8sConfig), and the HTTP multiplexer (sc.Mux) for handler registration.

Returns

TypeDescription
errorAn error if any setup step fails, such as migrations, OTel provider registration, repository creation, or Kubernetes log streamer creation.