euler-connector
How the euler-* packages talk to euler-view: one source of truth for the connection.
When euler-view launches a job, it tells the job's processes where they belong and how they may reach it. A package reports through euler_connector and never handles that connection itself.
- Transports. Records go to a file on the shared filesystem, which euler-view reads over SSH and which works on every cluster. Where compute nodes reach euler-view, they are also posted over HTTP.
- Who speaks. Only rank 0 speaks for a job. Forked workers stay silent; workers started with
torch.multiprocessing.spawnmust setRANK. - Safety. Nothing ever blocks or breaks the run: no exceptions, no unbounded queues, and a daemon thread for the network.
- Dependencies. None beyond the standard library (Python ≥ 3.9).
tqdmis optional.
The first channel is structured progress. A record says what a counter counts (the whole run, one task, one epoch) and where the run is (task i of n, epoch e of E). euler-view can therefore show one overall percentage and ETA for training, inference and evaluation alike.
Install
pip install euler-connector # or: euler-connector[tqdm]
Report progress
from euler_connector import progress
p = progress.start("inference") # train | inference | eval | preprocess | other
# A tqdm bar that also reports (same arguments as tqdm, plus `scope`):
for sample in progress.tqdm(samples, desc="Inference", scope="overall", unit="sample"):
...
p.close() # done; a failed run calls p.close(done=False)
Without a bar:
p = progress.start("train")
for epoch in range(num_epochs):
p.set_epoch(epoch + 1, num_epochs) # 1-based
for step, batch in enumerate(loader, 1):
...
p.update(step, len(loader), scope="epoch", unit="step")
p.close()
Nested work, e.g. evaluating several datasets:
p = progress.start("eval")
for d, dataset in enumerate(datasets, 1):
p.set_level("dataset", d, len(datasets), dataset.name)
for t, task in enumerate(tasks_of(dataset), 1):
p.set_task(t, None, task.name) # the count may be unknown
for sample in progress.tqdm(task.samples, desc=task.label): # scope="task"
...
Records are written at most every 10 s. A new task, epoch or level is written at once, at most once per second.
p.update(current, total) counts the whole run unless given a scope (task, epoch, step); a bar counts one task unless given one. Positions are 1-based.
No call raises. A call progress cannot use, such as a 0-based position or an unknown scope, is ignored with a warning, so it never stops a run.
Several processes
Only the global rank 0 reports. The rank comes from RANK (set by torchrun and accelerate), OMPI_COMM_WORLD_RANK, PMI_RANK or SLURM_PROCID, else it is 0. Forked workers, such as DataLoader workers, stay silent.
Workers started with torch.multiprocessing.spawn must set RANK to their global rank before their first progress call (the connector reads it once). spawn sets no rank variable, so without it each worker counts as rank 0, and they overwrite each other's progress.
def train(rank, world_size): # spawn passes each worker its index
os.environ["RANK"] = str(rank) # on several nodes: node_rank * nprocs + rank
p = progress.start("train")
...
torch.multiprocessing.spawn(train, args=(world_size,), nprocs=world_size)
The launch environment
euler-view sets these variables for every launch; outside euler-view nothing is sent.
| Variable | Meaning |
|---|---|
EULER_LAUNCH_ID |
the launch |
EULER_CONNECTOR_DIR |
where the file transport writes <channel>.json; it also holds the HTTP token |
EULER_VIEW_BASE_URL |
set only where compute nodes reach euler-view: enables HTTP |
EULER_CONNECTOR_MODE |
auto (default), file, http, off |
EULER_CONNECTOR_INTERVAL |
seconds between records of one channel (default 10) |
docs/protocol.md is the full protocol: the envelope, both transports, throttling, the progress schema, and how to add a channel.
For more uses
Progress is one domain module on a general base:
Connector: the process's connection, from the environment;- channels: named, each with a versioned payload schema;
- transports: file, HTTP, memory, callback.
A new use (a heartbeat, a status, metrics from inference) adds a channel and a small module next to progress, and the package code stays one call. See "Adding a channel" in the protocol.
from euler_connector import connect
connector = connect()
print(connector.describe()) # enabled, launch, rank, transports and their health (no secrets)
Development
uv sync --extra dev
uv run pytest
Metadata
Release files for euler-connector 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| euler_connector-0.1.1.tar.gz | 31.8 kB | Without provenance | Details for euler_connector-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| euler_connector-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for euler_connector-0.1.1-py3-none-any.whl |
Total release size: 59.3 kB
Release files / euler_connector-0.1.1.tar.gz
| Download URL | euler_connector-0.1.1.tar.gz |
|---|---|
| Size | 31.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
268d5f9f928f1a89e81c23ac906cf587c512134a79cc0a6a2e8f53613a07357b
|
|
BLAKE2b-256 checksum How to use checksums |
e3d9113f367fbce55075e123f013a20e2e69d07e0cddad8dae354591b14e0f33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / euler_connector-0.1.1-py3-none-any.whl
| Download URL | euler_connector-0.1.1-py3-none-any.whl |
|---|---|
| Size | 27.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3f4e753f67edab7ddc402da1118b80a8bdc3c5e3948e8d9a79784608ec7bf53
|
|
BLAKE2b-256 checksum How to use checksums |
35c52454aadfffeb86f627ada3618d2b78c85be07abd99774e040b542982eacb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for euler-connector 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.