Quickstart

This walkthrough assumes a trusted LAN. For a real deployment read Security & scope first.

1. Start the coordinator

n4cluster server --host 0.0.0.0 --port 8765 --state ./cluster-state
# optionally set N4CLUSTER_TOKEN via your shell or secret manager; add
# --allow-python-jobs and --log-file server.log as needed

The server prints its URL and the dashboard address (http://HOST:8765/ui).

2. Start one or more workers

Run on machines that can see nirs4all and the datasets. The worker auto-detects GPUs (nvidia-smi) and advertises a cuda label.

n4cluster worker --server http://HOST:8765 --labels site=lab --slots 1
# force GPU count with --gpus N (0 hides GPUs); add --log-file as needed

3. Submit a job and wait

n4cluster submit examples/job.shared-path.yaml --wait --out ./results
n4cluster status   <job_id>
n4cluster jobs      --status running
n4cluster logs     <job_id>
n4cluster cancel   <job_id>
n4cluster artifacts <job_id> --out ./results

Python SDK

from nirs4all_cluster import ClusterClient

with ClusterClient("http://host:8765", token=None) as client:
    job = client.submit_run(
        pipeline="/shared/pipelines/pls.yaml",   # kind=path
        dataset="/shared/datasets/corn",         # kind=shared_path
        params={"random_state": 42},
    )
    job = client.wait(job.id)
    print(job.aggregate.best_metric, job.aggregate.ranking)
    client.download_best_model(job.id, "best_model.n4a")

A job that provides lists (pipelines / datasets) decomposes into one task per combination — see Jobs, tasks and decomposition.