Run the hybrid runner
Once the runner has been set up, it can be used via the following APIs:
/healthcheck
Health check for runner
Method 1 and Method 2
/execute
Execute payload via v3/v4
Method 1 and Method 2
/upload
Upload Wasm to Runner
Method 2
Run using curl
Test the service using the
healthcheckendpoint. You should receive the message{"msg":"ok"}.curl 'http://localhost:3000/healthcheck'Execute a request similar to that in the API Tester.
Note the change in the URI to
localhost:3000and make sure to updatemytenantin the URI to your tenant name.See Execute API (v3) for more information on the request_data and request_meta options.
Also see the Hybrid runner API reference for alternative endpoints available from the runner.
curl --location --request POST 'http://localhost:3000/mytenant/api/v3/execute' \ --header 'Content-Type: application/json' \ --data '{ "request_data": { "inputs": { "value": 13 } }, "request_meta": { "version_id": "c16d9b89-92c4-430f-a30e-9b04805fcb78", "call_purpose": "Online", "source_system": "Hybrid Runner" } }'
Run using the Python SDK
The Coherent Spark Python SDK supports interaction with the Hybrid Runner API, enabling you to deploy and manage a runner through Python.
If you have a hybrid deployment set up, you can leverage the Python SDK to interact with and manage the hybrid runner. The runner provides limited functionality compared to the full SaaS API, focusing on executing services in local or controlled environments. This capability is especially useful for scenarios where data privacy or on-premises processing is necessary.
Initialize the hybrid runner client
To interact with the hybrid runner API, you need to initialize a client instance pointing to the runner’s base URL. The default base URL is http://localhost:3000, but you can configure it according to your environment. Authentication is optional and depends on your specific setup.
Here is an example of how to set up and connect to the hybrid runner using Python:
base_url
Defines the address where your hybrid runner is accessible.
tenant
Represents the specific tenant under which the operations are conducted.
token
Optional, used for authentication if your deployment requires it.
Ensure your deployment environment is configured to allow connections at the specified base_url, and that any necessary authentication is properly set up to match your security requirements.
For more details, please visit the Python SDK documentation.
Run using the Node.js SDK
The Coherent Spark Node.js SDK provides a streamlined way to interact with the hybrid runner API for hybrid deployments, making it easy to execute services locally or in restricted environments.
Install the @cspark/wasm package
Note:
@cspark/wasmis an extension of@cspark/sdkenabling support for the Hybrid Runner API.
Initialize and configure the runner
To connect with the hybrid runner, you need to initialize a HybridClient that points to the base URL of the runner. By default, the base URL is http://localhost:3000 and can be read as an environment variable CSPARK_RUNNER_URL.
You may choose to use authentication or not, depending on how your runner is configured.
With this setup, you can quickly deploy and run services via Node.js on your hybrid runner. For more information, explore the documentation.
Last updated
