Skip to main content
Code execution uses the Code Interpreter service. For each run, the service creates a short-lived executor pod that runs the user code. The Onyx Helm chart installs Code Interpreter as a subchart when codeInterpreter.enabled is true. Put subchart settings under the hyphenated code-interpreter: key. Helm ignores other keys under codeInterpreter:.
values.yaml

Chart versions

The Onyx chart pins the Code Interpreter chart version. Onyx chart 0.8.35 and later pins Code Interpreter chart 0.4.8. Earlier Onyx charts pin 0.4.7. You cannot change a subchart version with values.
Sections and keys marked 0.4.8 need Code Interpreter chart 0.4.8 or later (Onyx chart 0.8.35 or later). With an older Onyx chart, install the Code Interpreter chart directly to use them. Code Interpreter 0.4.7 ignores these settings.

Install the Code Interpreter chart directly

1

Install Code Interpreter as its own release

In a direct install, settings go at the top level of the values file, without the code-interpreter: key:
code-interpreter-values.yaml
2

Point Onyx at the new release

values.yaml
The Service name is the release name. If Code Interpreter runs in a different namespace, use http://code-interpreter.<namespace>.svc.cluster.local:8000.

Network isolation

Executor pods always get a NetworkPolicy that denies all egress. By default, an init container also blocks egress with iptables before user code starts. This init container runs as root with the NET_ADMIN capability.
values.yaml
With netAdminLockdown: false, the NetworkPolicy is the only egress control for user code. Your CNI must enforce NetworkPolicies.

Restricted Pod Security and OpenShift (0.4.8)

Executor pods meet the Kubernetes restricted Pod Security Standard when netAdminLockdown is false. OpenShift restricted-v2 assigns user and group IDs from the namespace range, and rejects fixed IDs. Use platform mode, and let OpenShift assign the IDs of the service pod too:
values.yaml
  • The chart fails to render mode: platform with netAdminLockdown: true.
  • platform mode needs an admission controller that assigns a user ID. The executor image runs as root by default.
  • On other clusters, keep mode: fixed. It uses runAsUser, runAsGroup, and fsGroup 65532. Change the IDs if your policy needs other values.
  • With readOnlyRootFilesystem: true (the default), user code can write only to /workspace and /tmp.

Images

Both Code Interpreter images use latest by default. The service image uses pull policy Always. The executor image has no tag, so it also resolves to latest with pull policy Always, and each run checks the registry. Pin both images:
values.yaml
  • Pin tags that exist on Docker Hub. Onyx does not publish the images for every chart version.
  • Use IfNotPresent or Never on nodes that cannot reach the registry.
  • With 0.4.8, a run fails at once on an image pull error. It fails after readyTimeoutSec if the pod stays Pending.

Dedicated node pool and resources (0.4.8)

The top-level nodeSelector, tolerations, and affinity apply only to the service pod. Use kubernetesExecutor.pod to run user code on its own nodes:
values.yaml
  • pod also accepts affinity, topologySpreadConstraints, priorityClassName, labels, and annotations.
  • Set the memory limit with memoryLimitMb. The chart ignores podResources.limits.memory.
  • The service does not start if these values are not valid.

Capacity and overload (0.4.8)

Each replica runs at most capacity.maxConcurrentExecutions runs at a time. A request waits up to capacity.queueTimeoutSec for a free slot.
values.yaml
At the default executor size, 16 runs need about 4 GiB of memory limits and 1.6 CPU of requests. Increase maxConcurrentExecutions only when the cluster can schedule that many executor pods for each replica.

Executor ResourceQuota

To limit what executor pods can use, turn on the optional ResourceQuota. It counts every pod in its namespace, so use a dedicated executor namespace. The namespace must exist.
values.yaml
  • Each open session holds one pod for its full lifetime. Include sessions in pods.
  • The chart fails to render a quota in the release namespace unless you set executorResourceQuota.allowReleaseNamespace: true.
  • If you add ephemeral-storage keys to hard, also set executorResourceQuota.limitRange.enabled: true.

Metrics

The service serves Prometheus metrics at /metrics on its HTTP port. To create a ServiceMonitor, set metrics.serviceMonitor.enabled to true. This needs the Prometheus Operator CRDs. Useful metrics include code_interpreter_executions_active, code_interpreter_executions_rejected_total (by status and reason), and code_interpreter_admission_wait_seconds.

Health endpoints (0.4.8)

A busy replica stays ready and returns 429. If you override readinessProbe, use /ready.

More than one replica (0.4.8)

Each replica stores uploaded files and outputs on its own disk. Onyx uploads a file and runs code in separate requests. With more than one replica, the run can go to a replica that does not have the file, and the run fails. The chart fails to render replicaCount greater than 1 unless you set fileStorage.shared: true. Set it only after you do one of these:
  • Mount a ReadWriteMany volume at FILE_STORAGE_DIR (default /tmp/code-interpreter-files) on every replica.
  • Send each client to one replica (sticky sessions).
values.yaml