Files
plane/apps/runners/node-runner/Dockerfile.runner
T
6aeeb5a1e7 [SILO-823] feat: introducing plane runner (#5545)
* feat: introducing plane runner

- Add a new runnerctl app in API to orchestrate and manage runs.
- Models to store and process RunnerTask and RunnerTaskExecutions
- APIs for both web and inter service communication

- Add a new app `node-runner` to run the node code in vm
- Setup sandboxing using node vm to build and run the code
- Talks to runnerctl through APIs to fetch and report the task run status

* feat: settings page with editor

* fix: typo

* feat: add list, create and update script screens

- update APIs to use Session Auth
- fix issues in node runner

* add test run modal

* add delete button for task

* fix: refactor

* feat: use Script as main entity in Plane runner

- all features would have to use Script's as their action use cases
instead of Runner manager all of them

* chore: implemented scripts in automations

* add migrations

* feat: add test endpoints to build and run the code

- add /test endpoint in runnerctl service
- add /execute-sync endpoint in node-runner to run code in sync

* fix: refactor

* fix: refactor + UI improvements

* fix: refactor

* feat: add RunScript node in automation actions

* fix: cancel fn

* refactor: use execute-sync endpoint for all executions

- remove async code for executing code
- remove runnerctl service related code from node-runner

* fix: UI for automation script main layout + refactoring

* chore: add execution stats in scripts listing endpoint

* fix: route changed from /runners to /scripts

* fix: added relative last run

* fix: editor bg

* fix: test payload

* Merge branch 'preview' of github.com:makeplane/plane-ee into feat-plane-runner-ui

* feat: setup runner app migration

* feat: use oauth tokens to run scripts

* fix: refactor

* fix: types

* chore: use workspaceSlug from execution context in runner

- use cached oauth tokens instead of generating new tokens all the time

* feat: only show scripts in sidebar and automations when installed

- now we'll enable Scripts as feature only when the oauth app is installed

* fix: refactor

* fix: refactor

* fix: refactor

* fix: refactor

* fix: formatting

* fix: added direct import for types to handle self hosted and airgapped instances

* add variables support

* add support for variables in node-runner

* Add fresh migrations for runnerctl

* add copyright on all runner files

* add variables UI for runner scripts and automations

- Add TVariableDefinition type and variables field to RunnerScript type
- Add TVariableFormData and variables to RunnerScriptFormData
- Add execution_variables to TRunScriptActionConfig for automations
- Create VariablesField component for script form (collapsible, save/remove)
- Update scriptToFormData and formDataToScriptPayload to handle variables
- Update TestScript component to show variable input fields and send execution_variables
- Update AutomationActionRunScriptConfiguration to show variable inputs when script selected
- Update runnerctl.service.ts to pass execution_variables in testScript
- Update Python API serializers to include variables in script list/lite responses
- Update script_test view to pass execution_variables to execute_sync

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* add reusable functions feature for runner scripts

- Add ScriptFunction model with system/workspace function support
- Add API endpoints for functions CRUD operations
- Add system function seeds (http, notifications, data, utils)
- Add Functions namespace injection into node-runner VM context
- Add functions dashboard with search, filter, and view modal
- Add function browser modal for inserting functions into scripts
- Add create/update function form with auto-generated code templates
- Add function name mismatch warning in code editor

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* build code and use build to run instead of building with every run

* refactor: update build api to extract functions from code

- only send used functions to runner for execution
- test api will also now validate the code and functions used

* add execution variables in automation and ui changes

* add fixtures for scripts and functions for system defined ones

* use threadpool to fetch token with new connection

* ui style changes for functions

* fix linter issues

* add PLANE_RUNNER feature flag and rename settings tab

* move ee components to core

* add runner urls in settings and reset migrations

* fix: refactoring + css fixes

* add node-runner build in github workflow

* replace node-runner Dockerfile with turbo-based Dockerfile.runner

- Remove old Dockerfile and docker-compose.yml
- Add Dockerfile.runner using turbo prune pattern (like silo)
- Update build-branch-cloud.yml to use Dockerfile.runner

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* fix: refactor + route fixed

* fix: changed folder name from scripts to runner-scripts

* fix: monaco editor theme based color

* fix: empty state and upgrade screen without img

* chore: add code validators while executing code

- reset fixtures for scripts and functions to empty

* fix: empty state + upgrade

* fix: empty state + upgrade

* fix: empty state assets

* fix: empty state assets

* feat: add AutomationEventInput for better DX writing scripts

* fix: types + formatting

* fix: types + formatting

* fix: formatting

* fix: bumped @vitest/eslint-plugin

* fix: api formatting changes

---------

Co-authored-by: Surya Prashanth <[email protected]>
Co-authored-by: Claude Opus 4.5 <[email protected]>
2026-02-12 17:14:47 +05:30

75 lines
2.7 KiB
Docker

# syntax=docker/dockerfile:1.7
FROM node:22-alpine AS base
# Setup pnpm package manager with corepack and configure global bin directory for caching
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
# *****************************************************************************
# STAGE 1: Prune the project
# *****************************************************************************
FROM base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk update
RUN apk add --no-cache libc6-compat
# Set working directory
WORKDIR /app
ARG TURBO_VERSION=2.5.6
RUN corepack enable pnpm && pnpm add -g turbo@${TURBO_VERSION}
COPY . .
RUN turbo prune --scope=plane-runner-host --docker
# *****************************************************************************
# STAGE 2: Install dependencies & build the project
# *****************************************************************************
# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
RUN apk update
RUN apk add --no-cache libc6-compat
WORKDIR /app
# First install dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN corepack enable pnpm
RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm fetch --store-dir=/pnpm/store
# Build the project and its dependencies
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json
ENV CI=true
RUN --mount=type=cache,id=pnpm-store,target=/pnpm/store pnpm install --store-dir=/pnpm/store
ENV TURBO_TELEMETRY_DISABLED=1
RUN pnpm turbo run build --filter=plane-runner-host
# *****************************************************************************
# STAGE 3: Run the project
# *****************************************************************************
FROM base AS runner
WORKDIR /app
COPY --from=installer /app/apps/runners/node-runner/dist ./apps/runners/node-runner/dist
COPY --from=installer /app/apps/runners/node-runner/node_modules ./apps/runners/node-runner/node_modules
COPY --from=installer /app/apps/runners/node-runner/package.json ./apps/runners/node-runner/package.json
COPY --from=installer /app/node_modules ./node_modules
# Directory where script packages will be installed at runtime
RUN mkdir -p /app/scripts
COPY LICENSE.txt .
RUN mkdir -p /usr/share/licenses/plane/
COPY LICENSE.txt /usr/share/licenses/plane/LICENSE.txt
ENV NODE_ENV=production
ENV TURBO_TELEMETRY_DISABLED=1
ENV NPM_CONFIG_CACHE=/tmp/.npm-cache
EXPOSE 3000
CMD ["node", "apps/runners/node-runner/dist/index.js"]