Hybrid Runner environment variables reference

There are additional settings that can be configured through the use of these additional docker runarrow-up-right environment variables.

Environment variable
Value

BODY_LIMIT

Define the maximum request body size. The default value is 30mb.

CUSTOM_API_ROUTE

Define additional path location to the resources in hybrid runner. Example: If this value is set to mypath/torun then the call to v3/execute would change from http://localhost:3000/mytenant/api/v3/execute to http://localhost:3000/mypath/torun/mytenant/api/v3/execute.

PORT

Set the service listening port. The default value is 3000.

UPLOAD_ENABLE

Allow Wasms to be uploaded to the Hybrid Runner directly using the /upload endpoint. This is not recommended to be used for production. The default value is false.

Manage access to filesystem

By default, the runner requires read-write permissions to the following paths.

Directory and path
Description

Tenant resolver /project/src/app/src/tenant_resolver

Purpose: Stores dynamically generated tenant-specific resolver JavaScript files.

Write pattern: Created once per tenant on the first request, rarely modified thereafter.

Example: externalResolver_<tenant_name>.js

Service map cache /project/src/app/src/services/servicemap

From nodegen-server 1.50.1 and onwards

/project/src/app/src/servicemap

Purpose: Caches service metadata (servicemap.json) to resolve models. This avoids repeated directory scanning.

Write pattern: Generated on application startup in offline mode. Recreated when model location changes.

Files created: servicemap.json

Temporary file storage /tmp

Purpose: Store and caches Wasm. This is used by Node.js as the tmp library working directory.

Write pattern: Frequent writes during model downloads, cleaned up by graceful cleanup handlers.

Cleanup: Periodic cleanup of files older than 7 days.

In nodegen-serverarrow-up-right versions >=1.50.2, the locations of these paths can be customized using environment variables. If the account does not have read-write permissions to the locations above, this can be used to adjust the default paths.

Environment variable
Value

CACHE_DIR

Cache write directory for Tenant resolver and Service map cache.

Default value are the paths noted above.

  • To set an absolute path, start the path using /, e.g. /var/runner_cache.

  • To set a relative path within the working directory, start the path using an eligible folder character, e.g. runner_cache would be set to ./runner_cache.

TEMP_DIR

Temporary file storage directory.

Default value is the path noted above.

  • To set an absolute path, start the path using /, e.g. /tmp.

  • To set a relative path within the working directory, start the path using an eligible folder character, e.g. tmp would be set to ./tmp.

Control log output

In nodegen-serverarrow-up-right versions >=1.50.2, more variables are available to manage log output.

Environment variable
Value

LOG_PATH

Default: Logs are recorded to stdout only.

When defined, logs are saved to the defined location.

  • To set an absolute path, start the path using /, e.g. /var/runner_logs.

  • To set a relative path within the working directory, start the path using an eligible folder character, e.g. runner_logs would be set to ./runner_logs.

LOG_ROTATION_ENABLED

Default: true

This removes files that exceed the maximum log storage criteria.

LOG_MAX_SIZE

Default: 10M

Maximum file size before rotation:

  • K for kilobytes.

  • M for megabytes.

  • G for gigabytes.

LOG_ROTATION_INTERVAL

Default: 1d

Time-based rotation interval:

  • h for hours.

  • d for days.

  • M for months.

LOG_MAX_FILES

Default: 14

Maximum number of rotated log files to keep.

LOG_COMPRESSION

Default: false

Whether gzip compression is used on the log files.

Configure OpenTelemetry

Starting from nodegen-serverarrow-up-right versions >=1.46.0, the image implements support for OpenTelemetryarrow-up-right. OpenTelemetryarrow-up-right is an observability framework and toolkit to facilitate the generation, export, collection of telemetry data. The package conducts auto-instrumentation using @opentelemetry/auto-instrumentations-nodearrow-up-right. The data collected includes:

Traces
Metrics
Attributes
  • HTTP request/response details

  • Route information

  • Request duration

  • Error details

  • Correlation IDs

  • Tenant information

  • Request counts

  • Error rates

  • Request duration

  • Memory usage (heap, RSS)

  • Service name and version

  • Environment

  • HTTP method and route

  • Status codes

  • Request IDs

Below are links to documentation on integrating OpenTelemetryarrow-up-right with popular Application Performance Monitoring (APM) applications:

The configuration of OpenTelemetryarrow-up-right in the hybrid runner is managed through environment variables defined in the Docker container. Information on the relevant environment variables can be found in:

Key configuration variables include:

Environment variable
Value

OTEL_SDK_DISABLED

Disable the SDK for all signals.

OTEL_SERVICE_NAME

Sets the value of the service.name resource attribute.

OTEL_RESOURCE_ATTRIBUTES

Key-value pairs to be used as resource attributes.

OTEL_EXPORTER_OTLP_ENDPOINT

If using the OpenTelemetry Protocol Exporterarrow-up-right:

Target to which the exporter is going to send spans, metrics, or logs.

OTEL_EXPORTER_OTLP_HEADERS

If using the OpenTelemetry Protocol Exporterarrow-up-right:

Key-value pairs to be used as headers associated with gRPC or HTTP requests.

Manage compatible Neuron versions

circle-info

The compatibility feature in the runner is included in nodegen-serverarrow-up-right >=1.3.0.

Neuron compiler versions >=1.22.1 embed the compiler version into the ZIP package. If this feature is enabled and compiler version cannot be found, then the runner assume the Neuron version will be compatible.

The list of Neuron compatibility versions that can be found in the repository nodegen-server-compatibilityarrow-up-right.

nodegen-serverarrow-up-right also has the ability to check whether Neuron Wasms are supported by the version of the runner you are using. This is done by downloading the JSON file from nodegen-server-compatibilityarrow-up-right and assessing it against the versions of the runner and the requested Wasm. This can only be done with an online connection to fetch the necessary compatibility files.

This can be configured through the use of these additional docker runarrow-up-right environment variables.

Environment variable
Value

NODEGEN_COMPATIBILITY_BASE_URL

Base URL for Github user content. https://raw.githubusercontent.com

NODEGEN_COMPATIBILITY_PATH

Path to the JSON document in nodegen-server-compatibilityarrow-up-right. /Coherent-Partners/nodegen-server-compatibility/main/nodegen-server-compatibility.json

CHECK_RUNNER_COMPATIBILITY

true or false

Whether to check if the version of the runner supports this version of Neuron. The default value is false.

EXECUTE_WITH_WARNING

true or false

If CHECK_RUNNER_COMPATIBILITY is true, this defines whether or not to continue with executing the Spark service but with a warning. The default value is false.

NODEGEN_COMPATIBILITY_LIST_REFRESH_INTERVAL

If CHECK_RUNNER_COMPATIBILITY is true, this defines how often in minutes to fetch the nodegen-server-compatibilityarrow-up-right JSON document. The default value is 1440.

Last updated