Repository navigation
Fix the cloud execution path: KeyError, provider interface mismatch, placeholder hostnames #119
Description
Part of #108 · Phase 3
Problem
The cloud execution path has never run successfully. Four independent defects, any one of which is fatal.
1. Producer/consumer key mismatch — guaranteed KeyError
clustrix/utils.py:151-160 (serialize_function) emits:
{"function": <bytes>, "args": <pickled bytes>, ...}clustrix/executor_cloud.py:390-392 reads:
func_data['func'] # KeyError
func_data.get('args', ())This is unconditional — not a regression, not an edge case. It fails on the first line of the first real invocation. Its survival in the tree is proof the path was never executed, and is the clearest single piece of evidence for why this plan prioritizes real execution over more tests.
2. Provider interface mismatch — 4 of 5 providers dead on arrival
executor_cloud.py:222 requires hasattr(cloud_provider, "create_instance"). The providers define something else:
| Provider | Method it actually defines |
|---|---|
cloud_providers/aws.py:363 |
create_ec2_instance |
cloud_providers/azure.py:192 |
create_vm |
cloud_providers/gcp.py:141 |
create_compute_instance |
cloud_providers/huggingface_spaces.py:101 |
create_space |
All four therefore fall through to raise NotImplementedError at executor_cloud.py:234.
3. Fabricated hostnames escape into the SSH path
get_cluster_config() error branches return invented hosts, which executor_cloud.py:260 then tries to SSH into:
cloud_providers/gcp.py:544->placeholder.gcp.comcloud_providers/azure.py:669->placeholder.azure.comcloud_providers/lambda_cloud.py:327,338->placeholder.lambdalabs.com
An error path that returns a plausible-looking value instead of raising is worse than a crash: the failure surfaces later, somewhere else, as a confusing connection error.
4. Unsafe result handling in the cloud/K8s paths
executor_kubernetes.py:339 returns results by parsing stdout with ast.literal_eval on print(f'CLUSTRIX_RESULT:{result}'). Any non-literal return value silently degrades to a string. And executor_kubernetes.py:304-308 returns "completed" on any API exception for tracked jobs.
Acceptance criteria
- A single serialization contract, defined in one place, with a test asserting producer and consumer agree on every key
- One provider interface (ABC), implemented by all providers;
hasattrduck-typing dispatch removed - Every provider either satisfies the interface or is removed — no shipped
NotImplementedErroron an advertised feature - Error paths raise; no function returns a fabricated hostname.
grep -rn "placeholder\." clustrix/returns nothing - K8s results travel as a structured, typed payload — not
literal_evalof stdout - K8s status never reports
"completed"on an exception - At least one cloud backend runs a real function end to end in CI (see the HF Jobs issue)
-
README.mdclaims are reduced to what actually works (see the docs issue)
Verification
grep -rn "NotImplementedError" clustrix/executor_cloud.py # empty
grep -rn "placeholder\." clustrix/ # empty
Activity
Issue #119: Fix the KeyError on the first line of every cloud job
Fix three fabricated-result bugs, close the RCE, and overhaul the doc…
jeremymanning commentedon Aug 19, 2026
Obsolete — the whole cloud execution path is deleted
Every defect this issue names lived in code that no longer exists.
KeyErrorand the provider interface mismatch were inexecutor_cloud.py.placeholder.example.com, empty strings returned as if real) were incloud_providers/.executor_kubernetes.py— which decoded results withast.literal_evalon the pod log and returned"completed"from its exception paths — is deleted too.All removed in PR #149, for the reason that made this issue hard to close on its own terms: no cloud job had ever been shown to run end to end, so there was no way to verify a fix.
Tracked for restoration in #143 (AWS), #144 (GCP), #145 (Azure), #146 (Lambda Cloud) and #142 (Kubernetes). Each carries the file/line inventory and the introducing commit, and each requires a real job on real hardware before the backend can be re-advertised — which is exactly what would have caught these defects.