Run the Hybrid Runner

Once the Runner has been set up, it can be called and executed directly from via its provided API. This applies to both Hybrid method 1: Automatic Wasm pull and Hybrid method 2: Manual Wasm mount.

These are the following action breakdown.

Action
Supported Method(s)

/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

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

    curl 'http://localhost:3000/healthcheck'
  2. Execute a request similar to that in the API Tester.

    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 SDKarrow-up-right supports interaction with the Hybrid Runner API, enabling you to deploy and manage a runner through Python.

If you have a hybrid deployment setup, 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-premise 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:

Key
Value

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.

With this setup, you can begin leveraging Python to interact with the hybrid runner, streamlining local execution and enabling efficient service management.

For more details, please visit the Python SDK documentationarrow-up-right.

Run using the Node.js SDK

The Coherent Spark Node.js SDKarrow-up-right 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/wasm is an extension of @cspark/sdk enabling 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 documentationarrow-up-right.

Last updated