Code executor crashes on startup with the logs
Starting code executor on port NaN
Unhandled Rejection {"promise":{},"reason":{"code":"ERR_SOCKET_BAD_PORT"}}
My manifest is as follows:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
retoolService: code-executor
name: code-executor
spec:
replicas: 1
selector:
matchLabels:
retoolService: code-executor
revisionHistoryLimit: 3
template:
metadata:
labels:
retoolService: code-executor
spec:
securityContext:
runAsUser: 1001
runAsGroup: 1001
fsGroup: 1001
containers:
- args:
- bash
- start.sh
env:
- name: DEPLOYMENT_TEMPLATE_TYPE
value: k8s-manifests
- name: NODE_ENV
value: production
- name: NODE_OPTIONS
value: --max_old_space_size=1024
- name: CONTAINER_UNPRIVILEGED_MODE
value: "true"
- name: DISABLE_IPTABLES_SECURITY_CONFIGURATION
value: "true"
- name: PORT
value: "3004"
image: tryretool/code-executor-service:3.77.0-edge
name: code-executor
ports:
- containerPort: 3004
name: retool
protocol: TCP
resources:
limits:
cpu: 2
memory: 4Gi
requests:
cpu: 1
memory: 1Gi
# code executor uses nsjail to sandbox code execution. nsjail requires privileged container access.
# If your deployment does not support privileged access, you can set this to false to not use nsjail.
# Without nsjail, all code is run without sandboxing within your deployment.
securityContext:
privileged: false
---
apiVersion: v1
kind: Service
metadata:
name: code-executor
spec:
selector:
retoolService: code-executor
ports:
- protocol: TCP
port: 3004
targetPort: 3004
name: http-server
I tried omitting PORT
as well with the same result.
The docs around code executor environment variables are mismatched with the manifests provided @ https://github.com/tryretool/retool-onpremise/tree/master/kubernetes .
is PORT
the right environment variable for code executor? Its not listed in the docs and the logs suggest it doesn't work.
is CODE_EXECUTOR_INGRESS_DOMAIN
a code executor environment variable, (as the docs suggest) or is it for the other deployments to point at the code-executor service (as the retool-onpremise manifests suggest)?
The service definition for code executor is also mismatched between kubernetes and kubernetes-with-temporal (one exposes port 80 and the other 3004)