Executor configuration
The following is a list of all of the configuration options for the executor service. The process for configuring your executor instance will vary depending on the executor deployment method selected, but are generally defined as environment variables either in the executor Docker container or directly on the host machine, depending on whether the service is running in Docker or as a native Linux binary.
General configuration
Configuration Key | Description | Example value |
---|---|---|
EXECUTOR_FRONTEND_URL | The external URL of the Sourcegraph instance. required | http://sourcegraph.example.com |
EXECUTOR_FRONTEND_PASSWORD | The shared secret configured in the Sourcegraph instance site config under executors.accessToken . required | our-shared-secret |
EXECUTOR_QUEUE_NAME | The name of a single queue to pull jobs from. Possible values: batches and codeintel . required: either this or EXECUTOR_QUEUE_NAMES | batches |
EXECUTOR_QUEUE_NAMES | The names of multiple queues to pull jobs from, comma-separated. Possible values: batches and codeintel . required: either this or EXECUTOR_QUEUE_NAME | batches,codeintel |
EXECUTOR_USE_FIRECRACKER | Whether to isolate jobs in virtual machines. Requires ignite and firecracker. Linux hosts only. Kubernetes is not supported. (default value: "true" when OS is Linux and not on Kubernetes) | true |
EXECUTOR_MAXIMUM_NUM_JOBS | Number of virtual machines or containers that can be running at once. (default value: "1") | 1 |
EXECUTOR_MAXIMUM_RUNTIME_PER_JOB | The maximum wall time that can be spent on a single job. (default value: "30m") | 30m |
EXECUTOR_JOB_MEMORY | How much memory to allocate to each virtual machine or container. A value of zero sets no resource bound (in Docker, but not VMs). (default value: "12G") | 12G |
EXECUTOR_JOB_NUM_CPUS | How many CPUs to allocate to each virtual machine or container. A value of zero sets no resource bound (in Docker, but not VMs). (default value: "4") | 4 |
EXECUTOR_DOCKER_REGISTRY_MIRROR_URL | The address of a docker registry mirror to use in firecracker VMs. | http://10.0.0.2:5000 |
EXECUTOR_FIRECRACKER_DISK_SPACE | How much disk space to allocate to each virtual machine. (default value: "20G") | 20G |
EXECUTOR_FIRECRACKER_BANDWIDTH_EGRESS | How much bandwidth to allow for egress packets to the VM in bytes/s. (default value: "524288000") | 524288000 |
EXECUTOR_FIRECRACKER_BANDWIDTH_INGRESS | How much bandwidth to allow for ingress packets to the VM in bytes/s. (default value: "524288000") | 524288000 |
EXECUTOR_KEEP_WORKSPACES | Whether to skip deletion of workspaces after a job completes (or fails). Note that when Firecracker is enabled that the workspace is initially copied into the VM, so modifications will not be observed. (default value: "false") | true |
EXECUTOR_MAX_ACTIVE_TIME | The maximum time that can be spent by the worker dequeueing records to be handled. (default value: "0") | 100m |
EXECUTOR_NUM_TOTAL_JOBS | The maximum number of jobs that will be dequeued by the worker. (default value: "0") | 100 |
EXECUTOR_DOCKER_HOST_MOUNT_PATH | The target workspace as it resides on the Docker host (used to enable Docker-in-Docker). | /workspaces |
EXECUTOR_QUEUE_POLL_INTERVAL | Interval between dequeue requests. (default value: "1s") | 1s |
EXECUTOR_CLEANUP_TASK_INTERVAL | The frequency with which to run periodic cleanup tasks. (default value: "1m") | 1m |
EXECUTOR_VM_PREFIX | A name prefix for virtual machines controlled by this instance. (default value: "executor") | executor |
EXECUTOR_VM_STARTUP_SCRIPT_PATH | A path to a file on the host that is loaded into a fresh virtual machine and executed on startup. | /vm-startup.sh |
NODE_EXPORTER_URL | The URL of the node_exporter instance, without the /metrics path. | http://127.0.0.1:9000 |
EXECUTOR_FIRECRACKER_IMAGE | The base image to use for virtual machines. | sourcegraph/executor-vm:insiders |
EXECUTOR_FIRECRACKER_KERNEL_IMAGE | The base image containing the kernel binary to use for virtual machines. | sourcegraph/ignite-kernel:5.10.135-amd64 |
EXECUTOR_FIRECRACKER_SANDBOX_IMAGE | The OCI image for the ignite VM sandbox. | sourcegraph/ignite:v0.10.5 |
DOCKER_REGISTRY_NODE_EXPORTER_URL | The URL of the Docker Registry instance's node_exporter, without the /metrics path. | http://localhost:9000 |
SRC_LOG_LEVEL | upper log level to restrict log output to (dbug, info, warn, error, crit) (default value: "warn") | warn |
Kubernetes Specific Configuration
The following environment variables are specific to the native Kubernetes Executor deployment method. These environment variables can be set on the Executor Deployment
and will configure the Job
s that it spawns. Executor environment variables can also be defined on a Kubernetes ConfigMap
or Secret
that is mounted to the executor deployment.
Name | Default Value | Description |
---|---|---|
EXECUTOR_KUBERNETES_CONFIG_PATH | N/A | The path to the Kubernetes configuration file. If not specified, the in cluster config is used. |
EXECUTOR_KUBERNETES_NODE_NAME | N/A | The name of the Kubernetes Node to create Jobs in. If not specified, the Pods are created in the first available node. |
EXECUTOR_KUBERNETES_NODE_SELECTOR | N/A | A comma separated list of values to use as a node selector for Kubernetes Jobs. e.g. foo=bar,app=my-app |
EXECUTOR_KUBERNETES_NODE_REQUIRED_AFFINITY_MATCH_EXPRESSION | N/A | The JSON encoded required affinity match expressions for Kubernetes Jobs. e.g. [{"key": "foo", "operator": "In", "values": ["bar"]}] |
EXECUTOR_KUBERNETES_NODE_REQUIRED_AFFINITY_MATCH_FIELDS | N/A | The JSON encoded required affinity match fields for Kubernetes Jobs. e.g. [{"key": "foo", "operator": "In", "values": ["bar"]}] |
EXECUTOR_KUBERNETES_POD_AFFINITY | N/A | The JSON encoded pod affinity for Kubernetes Jobs. e.g. [{"labelSelector": {"matchExpressions": [{"key": "foo", "operator": "In", "values": ["bar"]}]}, "topologyKey": "kubernetes.io/hostname"}] |
EXECUTOR_KUBERNETES_POD_ANTI_AFFINITY | N/A | The JSON encoded pod anti-affinity for Kubernetes Jobs. e.g. [{"labelSelector": {"matchExpressions": [{"key": "foo", "operator": "In", "values": ["bar"]}]}, "topologyKey": "kubernetes.io/hostname"}] |
EXECUTOR_KUBERNETES_NODE_TOLERATIONS | N/A | The JSON encoded tolerations for Kubernetes Jobs. e.g. [{"key": "foo", "operator": "Equal", "value": "bar", "effect": "NoSchedule"}] |
EXECUTOR_KUBERNETES_NAMESPACE | default | The Kubernetes namespace in which the executor service will spawn executor jobs (K8s Jobs) in. |
EXECUTOR_KUBERNETES_PERSISTENCE_VOLUME_NAME | sg-executor-pvc | The name of the Executor Persistence Volume. Must match the PersistentVolumeClaim configured for the instance. |
EXECUTOR_KUBERNETES_RESOURCE_LIMIT_CPU | N/A | The maximum CPU resource for Kubernetes Jobs. |
EXECUTOR_KUBERNETES_RESOURCE_LIMIT_MEMORY | 12Gi | The maximum memory resource for Kubernetes Jobs. |
EXECUTOR_KUBERNETES_RESOURCE_REQUEST_CPU | N/A | The minimum CPU resource for Kubernetes Jobs. |
EXECUTOR_KUBERNETES_RESOURCE_REQUEST_MEMORY | 12Gi | The minimum memory resource for Kubernetes Jobs. |
KUBERNETES_JOB_DEADLINE | 1200 | The number of seconds after which a Kubernetes job will be terminated. |
KUBERNETES_RUN_AS_USER | N/A | The user ID to run Kubernetes jobs as. |
KUBERNETES_RUN_AS_GROUP | N/A | The group ID to run Kubernetes jobs as. |
KUBERNETES_FS_GROUP | 1000 | The group ID to run all containers in the Kubernetes jobs as. |
KUBERNETES_KEEP_JOBS | false | If true, Kubernetes jobs will not be deleted after they complete. Useful for debugging. |
KUBERNETES_JOB_ANNOTATIONS | N/A | The JSON encoded annotations to add to the Kubernetes Jobs. e.g. {"foo": "bar", "faz": "baz"} |
KUBERNETES_JOB_POD_ANNOTATIONS | N/A | The JSON encoded annotations to add to the Kubernetes Job Pods. e.g. {"foo": "bar", "faz": "baz"} |
KUBERNETES_IMAGE_PULL_SECRETS | N/A | The names of Kubernetes image pull secrets to use for pulling images. e.g. my-secret,my-other-secret |
Note:
EXECUTOR_KUBERNETES_NAMESPACE
should be set to either "default" or the specific namespace where your Executor is deployed.