feat(cli): expose new cluster SDK parameters#378
Open
cursor[bot] wants to merge 12 commits into
Open
Conversation
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
| response = await show_loading_status( | ||
| "Loading storage volumes...", | ||
| config.client.beta.clusters.storage.list(project_id=project_id or omit), | ||
| ) |
| cluster_id=cluster_id, | ||
| mode=safe_modes or omit, | ||
| order_by=order_by or omit, | ||
| page_size=page_size if page_size is not None else omit, |
|
|
||
| async def list( | ||
| after: AfterParameter = None, | ||
| project_id: Annotated[Optional[str], Parameter(help="Project ID to filter clusters by")] = None, |
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Contributor
blainekasten
left a comment
There was a problem hiding this comment.
@cursoragent let's not add add_ons and cluster_config to the cli yet. This needs more thought.
Contributor
Author
|
Done.
Verified: .venv/bin/python -m ruff check ...
.venv/bin/python -m pytest tests/cli/test_beta_clusters.pyResult: |
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Comment on lines
+94
to
+97
| shared_volume_name: SharedVolumeNameParameter = None, | ||
| shared_volume_region: SharedVolumeRegionParameter = None, | ||
| shared_volume_size_tib: SharedVolumeSizeTibParameter = None, | ||
| shared_volume_lifecycle_independent: SharedVolumeLifecycleIndependentParameter = None, |
Contributor
There was a problem hiding this comment.
@cursoragent Drop these parameters since the cli has a helper flow or users can attach the volume id for a previously created one
| num_capacity_pool_gpus: NumCapacityPoolGpusParameter = None, | ||
| num_preemptible_gpus: NumPreemptibleGpusParameter = None, | ||
| num_reserved_gpus: NumReservedGpusParameter = None, | ||
| oidc_config: OidcConfigParameter = None, |
| gpu_type: GpuTypeParameter = None, | ||
| cluster_type: ClusterTypeParameter = None, | ||
| volume: VolumeParameter = None, | ||
| acceptance_tests_params: AcceptanceTestsParamsParameter = None, |
Contributor
Author
There was a problem hiding this comment.
Done.
- Removed
--shared-volume-name - Removed
--shared-volume-region - Removed
--shared-volume-size-tib - Removed
--shared-volume-lifecycle-independent - Removed non-interactive inline
shared_volumerequest mapping - Kept the interactive helper flow / existing
--volumepath - Pushed commit:
7b02fa7d fix(cli): drop inline shared volume create flags
Verified:
.venv/bin/python -m ruff check ...
.venv/bin/python -m ruff format --check src/together/lib/cli/api/beta/clusters/create.py tests/cli/test_beta_clusters.py
.venv/bin/pyright --pythonpath .venv/bin/python src/together/lib/cli/api/beta/clusters/_json_params.py src/together/lib/cli/api/beta/clusters/create.py src/together/lib/cli/api/beta/clusters/update.py
.venv/bin/python -m pytest tests/cli/test_beta_clusters.pyResult: 26 passed
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
| is_lifecycle_independent = input( | ||
| "Clusters: Keep storage volume after cluster deletion? [y/N] " | ||
| ).strip().lower() in ("y", "yes") | ||
| params["shared_volume"] = _shared_volume( |
Contributor
There was a problem hiding this comment.
@cursoragent I don't think we need this helper function. Seems like we can revert back to just instantiating a SharedVolume, right?
Contributor
Author
There was a problem hiding this comment.
Done.
- Removed
_shared_volume - Reverted interactive storage helper flow to direct
SharedVolume(...) - Removed the extra lifecycle-independent prompt tied to that helper
- Pushed commit:
2aa68755 fix(cli): inline cluster shared volume creation
Verified:
.venv/bin/python -m ruff check ...
.venv/bin/python -m ruff format --check src/together/lib/cli/api/beta/clusters/create.py tests/cli/test_beta_clusters.py
.venv/bin/pyright --pythonpath .venv/bin/python src/together/lib/cli/api/beta/clusters/_json_params.py src/together/lib/cli/api/beta/clusters/create.py src/together/lib/cli/api/beta/clusters/update.py
.venv/bin/python -m pytest tests/cli/test_beta_clusters.pyResult: 26 passed
Co-authored-by: Blaine Kasten <blainekasten@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Testing
python3 -m ruff check src/together/lib/cli/api/beta/clusters/_json_params.py src/together/lib/cli/api/beta/clusters/create.py src/together/lib/cli/api/beta/clusters/update.py src/together/lib/cli/api/beta/clusters/list.py src/together/lib/cli/api/beta/clusters/storage/create.py src/together/lib/cli/api/beta/clusters/storage/update.py src/together/lib/cli/api/beta/clusters/storage/list.py src/together/lib/cli/api/beta/clusters/remediations/list.py tests/cli/test_beta_clusters.pypython3 -m pytest tests/cli/test_beta_clusters.pyTarget base branch:
next(do not retarget tomain).Requested reviewers: @blainekasten,
stainless-app[bot](incoming commit author).