Add beta cluster remediation CLI commands#369
Conversation
… update storage types
…tional in storage update
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
cb3ea43 to
9444e98
Compare
9444e98 to
362807a
Compare
|
|
||
| [dim]-[/dim] Manage node remediations: | ||
| [primary]tg beta clusters remediations ls <cluster-id>[/primary] | ||
| [primary]tg beta clusters remediations create <cluster-id> <instance-id> --mode REMEDIATION_MODE_VM_ONLY[/primary] |
There was a problem hiding this comment.
should this be --mode VM_ONLY? this currently it errors:
▎ $ tg beta clusters remediations create some-cluster some-instance --mode REMEDIATION_MODE_VM_ONLY
▎ Error: Invalid value "REMEDIATION_MODE_VM_ONLY" for --mode. Choose from:
▎ "VM_ONLY", "HOST_AWARE", "EVICT_WITHOUT_REPLACEMENT", "REBOOT_VM".
The BETA_CLUSTERS_REMEDIATIONS_HELP_EXAMPLES block right below uses the short form --mode VM_ONLY, which is what the command actually accepts. Can we update this one to match
| model_dump = model.model_dump() | ||
|
|
||
| # Filter out keys that are not in the model | ||
| model_dump = {k: v for k, v in model_dump.items() if k in model.model_fields_set} |
There was a problem hiding this comment.
The model_fields_set filter in model_dump.py changes behavior for evals retrieve and fine_tuning retrieve too, it overrides show_nulls=True. Worth scoping that behind an opt-in flag.
_dump_sorted_model is shared by every retrieve command in the CLI, so filtering on model.model_fields_set silently overrides show_nulls=True for all of them.
I reproduced it locally with a model parsed the same way the SDK parses an API response:
▎ class M(BaseModel):
▎ id: str
▎ name: Optional[str] = None
▎ status: Optional[str] = "idle"
▎ extra: Optional[str] = None
▎
▎ m = M.model_validate({"id": "abc", "status": "running"}) # name/extra not in JSON
▎ print_model_dump(m, show_nulls=True)
▎
▎ Output:
▎ Id: abc
▎ Status: running
▎
name and extra are gone even though the caller asked for nulls. That's a behavior change for:
- evals/retrieve.py:25 — calls print_model_dump(response) with the default show_nulls=True, so any optional field the API doesn't return will quietly stop showing up.
- fine_tuning/retrieve.py:37 — uses show_nulls=False, less visible but still a contract change.
Summary
tg beta clusters remediationscommand group with create, list, approve, cancel, and reject commands.instance_idfor list by using the SDK wildcard instance path when omitted.Tests
python3 -m ruff check src/together/lib/cli/__init__.py src/together/lib/cli/api/beta/clusters/remediations tests/cli/test_beta_clusters.pypython3 -m pyright src/together/lib/cli/api/beta/clusters/remediations src/together/lib/cli/__init__.pypython3 -m pytest tests/cli/test_beta_clusters.py -qImages
tg beta clusters remediation --helptg beta clusters remediation listtg beta clusters remediation createtg beta clusters remediation retrieveclusters remediation create --help