Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@
# AGENT_HTTP_URL=
# AGENT_GRPC_URL=

## Runner task broker
## Runner fleets
##
## Required together when Runner components should use an external broker.
# TASK_BROKER_BASE_URL=
# TASK_BROKER_FLEET_ID=
# TASK_BROKER_AUTH_TOKEN=
## Register a fleet via POST /admin/api/runner/fleets, then set fleet_id on Runner nodes.
## Configure fleet-manager with SUPERPLANE_URL and the fleet auth_token from registration.

## Usage service
# USAGE_GRPC_URL=
Expand Down
Empty file.
33 changes: 33 additions & 0 deletions db/migrations/20260518120000_add-runner-fleets.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
BEGIN;

CREATE TABLE IF NOT EXISTS runner_fleets (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
name VARCHAR(255) NOT NULL,
auth_token TEXT NOT NULL DEFAULT '',
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

CREATE UNIQUE INDEX runner_fleets_name_idx ON runner_fleets (name);

CREATE TABLE IF NOT EXISTS runner_tasks (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
fleet_id UUID NOT NULL REFERENCES runner_fleets(id) ON DELETE CASCADE,
fleet_task_id TEXT NOT NULL,
execution_id UUID NOT NULL REFERENCES workflow_node_executions(id) ON DELETE CASCADE,
status VARCHAR(32) NOT NULL DEFAULT 'queued',
spec JSONB NOT NULL DEFAULT '{}'::jsonb,
exit_code INTEGER,
output TEXT NOT NULL DEFAULT '',
error TEXT NOT NULL DEFAULT '',
result JSONB,
task_log JSONB,
dispatched_at TIMESTAMPTZ,
completed_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

CREATE UNIQUE INDEX runner_tasks_fleet_task_idx ON runner_tasks (fleet_id, fleet_task_id);
CREATE INDEX runner_tasks_execution_id_idx ON runner_tasks (execution_id);
CREATE INDEX runner_tasks_fleet_status_created_idx ON runner_tasks (fleet_id, status, created_at);

COMMIT;
104 changes: 100 additions & 4 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
\restrict abcdef123

-- Dumped from database version 17.5 (Debian 17.5-1.pgdg130+1)
-- Dumped by pg_dump version 17.10 (Ubuntu 17.10-1.pgdg22.04+1)
-- Dumped by pg_dump version 17.9 (Ubuntu 17.9-1.pgdg22.04+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
Expand Down Expand Up @@ -432,6 +432,42 @@ CREATE TABLE public.role_metadata (
);


--
-- Name: runner_fleets; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.runner_fleets (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
name character varying(255) NOT NULL,
fleet_url text,
auth_token text DEFAULT ''::text NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
mode character varying(32) DEFAULT 'bridge'::character varying NOT NULL
);


--
-- Name: runner_tasks; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.runner_tasks (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
fleet_id uuid NOT NULL,
fleet_task_id text NOT NULL,
execution_id uuid NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
status character varying(32) DEFAULT 'queued'::character varying NOT NULL,
spec jsonb DEFAULT '{}'::jsonb NOT NULL,
exit_code integer,
output text DEFAULT ''::text NOT NULL,
error text DEFAULT ''::text NOT NULL,
result jsonb,
task_log jsonb,
dispatched_at timestamp with time zone,
completed_at timestamp with time zone
);


--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -988,6 +1024,22 @@ ALTER TABLE ONLY public.role_metadata
ADD CONSTRAINT role_metadata_pkey PRIMARY KEY (id);


--
-- Name: runner_fleets runner_fleets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.runner_fleets
ADD CONSTRAINT runner_fleets_pkey PRIMARY KEY (id);


--
-- Name: runner_tasks runner_tasks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.runner_tasks
ADD CONSTRAINT runner_tasks_pkey PRIMARY KEY (id);


--
-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -1638,6 +1690,34 @@ CREATE INDEX idx_workflows_live_version_id ON public.workflows USING btree (live
CREATE INDEX idx_workflows_organization_id ON public.workflows USING btree (organization_id);


--
-- Name: runner_fleets_name_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX runner_fleets_name_idx ON public.runner_fleets USING btree (name);


--
-- Name: runner_tasks_execution_id_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX runner_tasks_execution_id_idx ON public.runner_tasks USING btree (execution_id);


--
-- Name: runner_tasks_fleet_status_created_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX runner_tasks_fleet_status_created_idx ON public.runner_tasks USING btree (fleet_id, status, created_at);


--
-- Name: runner_tasks_fleet_task_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX runner_tasks_fleet_task_idx ON public.runner_tasks USING btree (fleet_id, fleet_task_id);


--
-- Name: unique_human_user_in_organization; Type: INDEX; Schema: public; Owner: -
--
Expand Down Expand Up @@ -1828,6 +1908,22 @@ ALTER TABLE ONLY public.organization_invite_links
ADD CONSTRAINT organization_invite_links_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES public.organizations(id) ON DELETE CASCADE;


--
-- Name: runner_tasks runner_tasks_execution_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.runner_tasks
ADD CONSTRAINT runner_tasks_execution_id_fkey FOREIGN KEY (execution_id) REFERENCES public.workflow_node_executions(id) ON DELETE CASCADE;


--
-- Name: runner_tasks runner_tasks_fleet_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.runner_tasks
ADD CONSTRAINT runner_tasks_fleet_id_fkey FOREIGN KEY (fleet_id) REFERENCES public.runner_fleets(id) ON DELETE CASCADE;


--
-- Name: users users_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -2129,7 +2225,7 @@ ALTER TABLE ONLY public.workflows
\restrict abcdef123

-- Dumped from database version 17.5 (Debian 17.5-1.pgdg130+1)
-- Dumped by pg_dump version 17.10 (Ubuntu 17.10-1.pgdg22.04+1)
-- Dumped by pg_dump version 17.9 (Ubuntu 17.9-1.pgdg22.04+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
Expand All @@ -2148,7 +2244,7 @@ SET row_security = off;
--

COPY public.schema_migrations (version, dirty) FROM stdin;
20260515120000 f
20260518120000 f
\.


Expand All @@ -2165,7 +2261,7 @@ COPY public.schema_migrations (version, dirty) FROM stdin;
\restrict abcdef123

-- Dumped from database version 17.5 (Debian 17.5-1.pgdg130+1)
-- Dumped by pg_dump version 17.10 (Ubuntu 17.10-1.pgdg22.04+1)
-- Dumped by pg_dump version 17.9 (Ubuntu 17.9-1.pgdg22.04+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
Expand Down
5 changes: 0 additions & 5 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ services:
# Runner + node webhooks: URLs sent to externals use this origin (must reach this process on PUBLIC_API_PORT).
# Tunnel example: ngrok http 8000 then set WEBHOOKS_BASE_URL=https://<subdomain>.ngrok-free.app (no trailing slash).
WEBHOOKS_BASE_URL: ${WEBHOOKS_BASE_URL:-http://localhost:8000}
# Task broker /v1 (Runner component). Base URL has no trailing slash.
TASK_BROKER_BASE_URL: ${TASK_BROKER_BASE_URL:-}
TASK_BROKER_FLEET_ID: ${TASK_BROKER_FLEET_ID:-}
# Bearer; must match broker AUTH_TOKEN when auth is enabled
TASK_BROKER_AUTH_TOKEN: ${TASK_BROKER_AUTH_TOKEN:-}
ALLOWED_WS_ORIGINS: ${ALLOWED_WS_ORIGINS:-http://localhost:8000}
AGENT_ENABLED: ${AGENT_ENABLED:-no}
AGENT_HTTP_URL: ${AGENT_HTTP_URL:-}
Expand Down
4 changes: 2 additions & 2 deletions docs/components/Core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ Runs shell commands on a fleet runner.
- **Execution mode**: Host (default) or Docker.
- **Container base image**: Choose a common public image, or **Other (custom image)** to enter any OCI reference.
- **Custom container image**: Shown only for **Other**; use a normal reference (`my.registry.example.com/org/repo:1.2.3` or `debian:bookworm-slim@sha256:…`). Private registries require the runner to be configured with registry credentials.
- **Execution timeout**: Optional wall-clock limit in seconds (1–86400). Leave at **0** to use the broker default.
- **Execution timeout**: Optional wall-clock limit in seconds (1–86400). Leave at **0** to use the fleet default.
- **Commands**: One or more shell commands, one per line.
- **Environment variables**: Optional key/value pairs available during command execution. Values can be literal strings (with expression support) or organization secret keys.

Expand All @@ -739,7 +739,7 @@ Runs shell commands on a fleet runner.
- **Failed**: The commands finished with non-zero exit code.

### Structured result
If the completed broker task includes valid JSON in **result**, SuperPlane includes it on the `runner.finished` event payload next to **status** and **exit_code** (the exact shape depends on your runner / task implementation).
If the completed fleet task includes valid JSON in **result**, SuperPlane includes it on the `runner.finished` event payload next to **status** and **exit_code** (the exact shape depends on your runner / task implementation).

### Example Output

Expand Down
13 changes: 13 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ require (
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.31.5 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.18.9 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.58.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.29.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.38.1 // indirect
github.com/aws/smithy-go v1.24.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
Expand Down
26 changes: 26 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,32 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aws/aws-sdk-go-v2 v1.41.1 h1:ABlyEARCDLN034NhxlRUSZr4l71mh+T5KAeGh6cerhU=
github.com/aws/aws-sdk-go-v2 v1.41.1/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.1 h1:i8p8P4diljCr60PpJp6qZXNlgX4m2yQFpYk+9ZT+J4E=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.1/go.mod h1:ddqbooRZYNoJ2dsTwOty16rM+/Aqmk/GOXrK8cg7V00=
github.com/aws/aws-sdk-go-v2/config v1.31.5 h1:wsZr2kq1XeKU/D2QDcW5xEB1zHPdHAuQqnR0yaygAQQ=
github.com/aws/aws-sdk-go-v2/config v1.31.5/go.mod h1:IpXejRuSIyOSCyT4BomfIJ5gWRcDoX/NJaAHh9Cp8jE=
github.com/aws/aws-sdk-go-v2/credentials v1.18.9 h1:zKrnPtmO7j2FpMqudayjCzNxyO8KtPQGCIzqEosKQbg=
github.com/aws/aws-sdk-go-v2/credentials v1.18.9/go.mod h1:gAotjkj0roLrwvBxECN1Q8ILfkVsw3Ntph6FP1LnZ8Q=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.5 h1:ul7hICbZ5Z/Pp9VnLVGUVe7rqYLXCyIiPU7hQ0sRkow=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.5/go.mod h1:5cIWJ0N6Gjj+72Q6l46DeaNtcxXHV42w/Uq3fIfeUl4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.7 h1:UCxq0X9O3xrlENdKf1r9eRJoKz/b0AfGkpp3a7FPlhg=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.7/go.mod h1:rHRoJUNUASj5Z/0eqI4w32vKvC7atoWR0jC+IkmVH8k=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.7 h1:Y6DTZUn7ZUC4th9FMBbo8LVE+1fyq3ofw+tRwkUd3PY=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.7/go.mod h1:x3XE6vMnU9QvHN/Wrx2s44kwzV2o2g5x/siw4ZUJ9g8=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.58.0 h1:XH0kj0KcoKd+BAadpiS83/Wf+25q4FmH3gDei4u+PzA=
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.58.0/go.mod h1:ptJgRWK9opQK1foOTBKUg3PokkKA0/xcTXWIxwliaIY=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 h1:oegbebPEMA/1Jny7kvwejowCaHz1FWZAQ94WXFNCyTM=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1/go.mod h1:kemo5Myr9ac0U9JfSjMo9yHLtw+pECEHsFtJ9tqCEI8=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.5 h1:Cx1M/UUgYu9UCQnIMKaOhkVaFvLy1HneD6T4sS/DlKg=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.5/go.mod h1:fTRNLgrTvPpEzGqc9QkeO4hu/3ng+mdtUbL8shUwXz4=
github.com/aws/aws-sdk-go-v2/service/sso v1.29.0 h1:H4QPAHLE1bHSQrZV6Hz+CPpJG+Mtf+rkl6NFb/Y7sv8=
github.com/aws/aws-sdk-go-v2/service/sso v1.29.0/go.mod h1:BnyjuIX0l+KXJVl2o9Ki3Zf0M4pA2hQYopFCRUj9ADU=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.1 h1:8yI3jK5JZ310S8RpgdZdzwvlvBu3QbG8DP7Be/xJ6yo=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.1/go.mod h1:HPzXfFgrLd02lYpcFYdDz5xZs94LOb+lWlvbAGaeMsk=
github.com/aws/aws-sdk-go-v2/service/sts v1.38.1 h1:3kWmIg5iiWPMBJyq/I55Fki5fyfoMtrn/SkUIpxPwHQ=
github.com/aws/aws-sdk-go-v2/service/sts v1.38.1/go.mod h1:yi0b3Qez6YamRVJ+Rbi19IgvjfjPODgVRhkWA6RTMUM=
github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk=
github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down
Loading
Loading