Hybrid method 1: Automatic Wasm pull

Diagram: Example of Client communicating via hybrid runner with automatic wasm retrieval

To configure nodegen-server for automatic Wasm module retrieval, you need to set the following environment variables.

Environment variable
Description

USE_SAAS

false

This must always be set as false. The setting of true is for Coherent deployments on our SaaS environments. The default value is true.

SERVICE_ENDPOINTS__EXCELENGINE_SERVICEURL

The base URL of your Spark SaaS account https://excel.{environment}.coherent.global.

SAAS_SERVICE_AUTH_TYPE

syntheticKey or OAuth2

SAAS_SERVICE_SYNTHETIC_KEY

If SAAS_SERVICE_AUTH_TYPE is syntheticKey then this value has to be configured. API key created from Authorization - API keys. The API key groups must contain User groups that are also assigned to Permissions - Features permissions Spark.GetNodegenZip.json and Spark.Resolver.json or assigned to Spark.AllEncompassingProxy.json.

SAAS_SERVICE_OAUTH_ISSUER_BASE_URL

If SAAS_SERVICE_AUTH_TYPE is OAuth2 then this value has to be configured. https://keycloak.{environment}.coherent.global

SAAS_SERVICE_OAUTH_CLIENT_ID

If SAAS_SERVICE_AUTH_TYPE is OAuth2 then this value has to be configured. This can be setup with Client Credentials.

SAAS_SERVICE_OAUTH_CLIENT_SECRET

If SAAS_SERVICE_AUTH_TYPE is OAuth2 then this value has to be configured. This can be setup with Client Credentials.

CLEANUP_INTERVAL

The interval in milliseconds before cleaning up any downloaded Wasm modules. The default value is 43200000 milliseconds (12 hours).

  1. Ensure that the Docker engine/daemon is up and running.

  2. pullarrow-up-right the nodegen-serverarrow-up-right Docker image using the following command:

  3. runarrow-up-right the service and create a container called wasm-server.

    1. Define the parameters that will be used for authorization to the Spark servers. In this example we are using a syntheticKey for authorization.

  4. Test the service using the healthcheck endpoint. You should receive the message {"msg":"ok"}.

  5. Execute a request similar to that in the API Tester.

  6. nodegen-serverarrow-up-right will first perform a lookup and verify whether the Spark service was already downloaded and cached locally.

    • If the service is not found locally, nodegen-serverarrow-up-right will use the provided Spark credentials to download the Wasm module from the SaaS platform and cache it until the CLEANUP_INTERVAL is reached.

    • If the service is found locally, nodegen-serverarrow-up-right will execute the Wasm module by loading it into memory, running the encapsulated logic, and returning the results back to the end-user.

  7. It is good practice to stoparrow-up-right and removearrow-up-right containers when you are finished.

Last updated