Architecture
Execution flow
tfmesos2.cluster(...)normalizes job dictionaries intoJobobjects.TensorflowMesoscreates task IDs and registers a Mesos client.- For each offer, CPU, memory, GPUs, and
MESOS_ATTRIBUTESare checked. - A Mesos task starts
python3 -m tfmesos2.server <task-id> <client-ip>. - The task reports a random local port and waits for cluster metadata.
- The API returns
cluster_def; the task startstf.distribute.Server. - Once all tasks are ready, the framework is suppressed and accepts no further offers.
Component boundaries
- Scheduler process: owns the Mesos framework, task queue, resource matching, and readiness state.
- Mesos master and agents: place and run the TensorFlow containers.
- Task callback API: exchanges task ports, readiness, and cluster metadata.
- TensorFlow task: starts the gRPC server and executes the user workload.
Failure boundaries
Terminal Mesos states are never treated as successful readiness. wait_until_ready() aborts on TASK_FAILED, TASK_LOST, or TASK_KILLED and has a configurable timeout. Status updates for unknown task IDs are ignored and logged.