Overview
SciDx Remote Execution (Rexec) is a broker-mediated remote code execution system built on ZeroMQ. It allows end users to submit Python workloads from a local Jupyter Notebook or script, route them through a central broker, and have them executed on dedicated per-user server pods running in a remote Kubernetes cluster.
Rexec integrates with the National Data Platform (NDP) Endpoint, which provides dataset discovery, authentication, and the address of the Server Deploy API. They provide a remote computation platform for scientific workflows.
How It Works- Client
ndp_ep[rexec]Python library- Transport
- ZeroMQ, through a central broker
- Execution
- Dedicated per-user server pods on Kubernetes
- Provisioning
- Server Deploy API (FastAPI)
- Integration
- NDP Endpoint API (FastAPI)
- Authentication
- Bearer token through Keycloak
The architecture diagram could not be loaded. See the Architecture page.
Documentation by Role
The documentation is organized for three audiences. Select the guide that corresponds to your role.
| Role | Who it's for | What the guide covers |
|---|---|---|
| End User User Guide |
Researchers and data scientists who execute Python workloads on remote clusters through an NDP Endpoint, without managing the underlying infrastructure. |
|
| NDP Provider / Sysadmin Sysadmin Guide |
Operators of Kubernetes clusters who provide remote execution capability to the users of an NDP Endpoint. |
|
| Developer Developer Guide |
Contributors who study the system internals, modify existing components, or extend Rexec with new capabilities. |
|
Server-Side Components
The following three services are deployed together with a single Helm chart and together implement the remote execution pipeline. See the Helm Chart reference for configuration details.
| Component | Role | Repository |
|---|---|---|
| Rexec Broker ZeroMQ |
A stateless ZeroMQ proxy that routes messages between many clients and many server pods. Exposes a client-facing NodePort (30001) and an internal ClusterIP for server pods. |
sci-ndp/SciDx-rexec-broker ↗ |
| Rexec Server Deploy API FastAPI |
A FastAPI service that provisions and tears down per-user rexec-server pods in Kubernetes. Accepts Bearer token auth and supports group-based access control. |
sci-ndp/rexec-server-k8s-deployment-api ↗ |
| NDP Endpoint API FastAPI |
The NDP Endpoint API providing dataset search, authentication, and the Rexec spawn API address to clients. Supports CKAN, MongoDB, Kafka, S3, Pelican, and JupyterLab integrations. | national-data-platform/ep-api ↗ |
Quick Start
The following example assumes access to an NDP Endpoint with remote execution enabled. Install the client library, connect to the endpoint, and submit a function for remote execution.
pip install ndp_ep[rexec]
from ndp_ep import APIClient, remote_func
client = APIClient(
base_url="https://ndp-endpoint.example.org/api",
token="<your-bearer-token>"
)
client.setup_rexec_environment(requirements="input_requirements.txt")
@remote_func
def collatz_steps(n: int) -> int:
steps = 0
while n != 1:
n = n // 2 if n % 2 == 0 else 3 * n + 1
steps += 1
return steps
result = collatz_steps(27)
print(f"collatz_steps(27) = {result}")
- Installs the NDP Endpoint library with Rexec support.
- Connects to an NDP Endpoint.
- Provisions the remote environment with your requirements.
- Runs the function on your Rexec server and returns
111.
Remote Execution
sci-ndp/rexec