Skip to main content

Code executor environment variables

code-executor environment variables available for use with self-hosted Retool deployments. You should only set these environment variables on containers running tryretool/code-executor-service images.

Only configure environment variables when needed. You can configure many environment variables from your organization's Settings rather than directly editing your deployment's configuration file.

Environment variables take effect only once the change is applied to your deployment, and where you set them depends on how Retool was deployed.

  • Terraform blueprints. Set the variable in retool_helm_extra_values in main.tf, then run terraform apply. Editing Helm values directly on a blueprint-managed instance is overwritten by the next apply.
  • Helm. Set the variable in your values.yaml, then run helm upgrade. That command restarts the affected pods as part of applying the new values, so restarting pods without re-running it doesn't pick up the change.
  • Docker Compose. Set the variable in docker.env, then run sudo docker compose up -d.

ALLOW_UNSAFE_CODE_EXECUTION​

Whether to run the code-executor service without NsJail sandboxing. Code runs directly in the container, without the default network rules. Only use this if the container can't use a seccomp profile or run privileged.

Type boolean
ConfigurabilityUpdate the deployment's configuration file.
Required Optional
Defaultfalse
Examples
ALLOW_UNSAFE_CODE_EXECUTION=false

CONTAINER_UNPRIVILEGED_MODE​

An alias for ALLOW_UNSAFE_CODE_EXECUTION, which runs the code-executor service without NsJail sandboxing.

Type boolean
ConfigurabilityUpdate the deployment's configuration file.
Required Optional
Defaultfalse
Examples
CONTAINER_UNPRIVILEGED_MODE=false

DISABLE_IPTABLES_SECURITY_CONFIGURATION​

Whether to skip the iptables rules that block sandboxed code from reaching link-local addresses and the 192.168.0.0/16 range. Set to true if the container running the code-executor service can't be given the NET_ADMIN capability, and block these addresses another way.

Type boolean
ConfigurabilityUpdate the deployment's configuration file.
Required Optional
Defaultfalse
Examples
DISABLE_IPTABLES_SECURITY_CONFIGURATION=false

NODE_ENV​

The Node.js environment. Should always be set to production.

Type string
Format Plain Text
ConfigurabilityUpdate the deployment's configuration file.
Required Optional
Defaultnull
Examples
NODE_ENV=production

NODE_OPTIONS​

Used to specify the maximum heap size for the JavaScript v8 engine.

Type string
Format Plain Text
ConfigurabilityUpdate the deployment's configuration file.
Required Optional
Default--max-old-space-size=1024
Examples
NODE_OPTIONS=--max-old-space-size=1024

SANDBOX_MAX_FILE_DESCRIPTORS​

The maximum number of file descriptors within a single sandbox.

Type number
ConfigurabilityUpdate the deployment's configuration file.
Required Optional
Default256
Examples
SANDBOX_MAX_FILE_DESCRIPTORS=256

SANDBOX_MOUNT_DIR​

Used to configure where files will be mounted into the sandbox.

Type string
Format Plain Text
ConfigurabilityUpdate the deployment's configuration file.
Required Optional
Default/tmp
Examples
SANDBOX_MOUNT_DIR=/tmp

WORKFLOW_MEMORY_LIMIT_MBS​

The maximum amount of memory, in megabytes, a workflow can use when running. Requires WORKFLOW_MONITOR_PROCESS_ENABLED to be true.

Type number
Format Integer
ConfigurabilityUpdate the deployment's configuration file.
Required Optional
Default2500
UnitsMB
Examples
WORKFLOW_MEMORY_LIMIT_MBS=2500

WORKFLOW_MONITOR_PROCESS_ENABLED​

Whether to limit the memory available to a workflow while running. If enabled, WORKFLOW_MEMORY_LIMIT_MBS can be set.

Type boolean
ConfigurabilityUpdate the deployment's configuration file.
Required Optional
Defaultfalse
Examples
WORKFLOW_MONITOR_PROCESS_ENABLED=true