From 35d772c59c1a1009384c162ced7ecae120efc5dd Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Tue, 10 Dec 2024 09:22:02 +1100 Subject: [PATCH] Runner can talk to timeline --- backend/runner/runner.go | 4 ++++ charts/ftl/templates/runner.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/backend/runner/runner.go b/backend/runner/runner.go index 99d1c0705d..ae119939e8 100644 --- a/backend/runner/runner.go +++ b/backend/runner/runner.go @@ -38,6 +38,7 @@ import ( "github.com/TBD54566975/ftl/backend/runner/observability" "github.com/TBD54566975/ftl/backend/runner/proxy" "github.com/TBD54566975/ftl/backend/runner/pubsub" + "github.com/TBD54566975/ftl/backend/timeline" "github.com/TBD54566975/ftl/common/plugin" "github.com/TBD54566975/ftl/internal/download" "github.com/TBD54566975/ftl/internal/dsn" @@ -58,6 +59,7 @@ type Config struct { Key model.RunnerKey `help:"Runner key (auto)."` ControllerEndpoint *url.URL `name:"ftl-endpoint" help:"Controller endpoint." env:"FTL_ENDPOINT" default:"http://127.0.0.1:8892"` LeaseEndpoint *url.URL `name:"ftl-lease-endpoint" help:"Lease endpoint endpoint." env:"FTL_LEASE_ENDPOINT" default:"http://127.0.0.1:8895"` + TimelineEndpoint *url.URL `help:"Timeline endpoint." env:"FTL_TIMELINE_ENDPOINT" default:"http://127.0.0.1:8894"` TemplateDir string `help:"Template directory to copy into each deployment, if any." type:"existingdir"` DeploymentDir string `help:"Directory to store deployments in." default:"${deploymentdir}"` DeploymentKeepHistory int `help:"Number of deployments to keep history for." default:"3"` @@ -84,6 +86,8 @@ func Start(ctx context.Context, config Config, storage *artefacts.OCIArtefactSer logger := log.FromContext(ctx).Attrs(map[string]string{"runner": config.Key.String()}) logger.Debugf("Starting FTL Runner") + ctx = timeline.ContextWithClient(ctx, timeline.NewClient(ctx, config.TimelineEndpoint)) + err = manageDeploymentDirectory(logger, config) if err != nil { observability.Runner.StartupFailed(ctx) diff --git a/charts/ftl/templates/runner.yaml b/charts/ftl/templates/runner.yaml index d6370fa0d9..8ee0a4b85f 100644 --- a/charts/ftl/templates/runner.yaml +++ b/charts/ftl/templates/runner.yaml @@ -66,6 +66,8 @@ data: value: "http://0.0.0.0:{{ (index .Values.runner.ports 0).containerPort }}" - name: FTL_LEASE_ENDPOINT value: http://ftl-lease:8892 + - name: FTL_TIMELINE_ENDPOINT + value: "http://{{ .Values.timeline.service.name }}:{{ .Values.timeline.service.port }}" - name: FTL_ARTEFACT_REGISTRY_ALLOW_INSECURE value: "{{ .Values.registry.allowInsecure }}" - name: FTL_ARTEFACT_REGISTRY_USERNAME