Skip to content

feat(cli): add beta clusters recreate command - #516

Open
anaqvi-tg wants to merge 4 commits into
mainfrom
anaqvi/beta-clusters-recreate
Open

feat(cli): add beta clusters recreate command#516
anaqvi-tg wants to merge 4 commits into
mainfrom
anaqvi/beta-clusters-recreate

Conversation

@anaqvi-tg

@anaqvi-tg anaqvi-tg commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Adds `together beta clusters recreate CLUSTER_ID`: tears down and rebuilds a cluster while preserving its reservation, via `POST /compute/clusters/{cluster_id}:recreate`.

What/Why: The recreate API (tcloud#2514, new-spec support in tcloud#2755) is entering the public pipeline via openapi#548; this is the CLI surface for it. Access is LaunchDarkly-gated per org server-side.

How:

  • `recreate.py` — mirrors `delete`: fetch + print the cluster, confirm interactively, POST, print the returned intent; `--json` skips confirmation and emits the raw response
  • `--reason` plus spec flags (`--cluster-type`, `--num-gpus`, `--num-reserved-gpus`, `--num-capacity-pool-gpus`, `--num-preemptible-gpus`) building the optional `new_spec`; no flags → recreate with current spec
  • Hidden `--env qa|prod` global flag — maps to the environment's base URL in code; explicit `--base-url` wins, `TOGETHER_BASE_URL` applies when neither flag is given
  • Calls the endpoint via raw `client.post` until the Stainless regen from openapi#548 lands, then swaps to `client.beta.clusters.recreate`

Testing: CLI tests for JSON mode, `--reason` passthrough, `new_spec` construction, declined confirmation, and `--env qa` routing to the QA host.

Ticket: TCL-8228

@broly-code-security-scanner

Copy link
Copy Markdown

Broly Security Scan

Note

Clean scan
No vulnerabilities detected in this PR.

Note

Re-scan this PR anytime with /broly scan — useful after /broly undismiss, or to refresh findings without a new push.

Broly — SAST (zai-org/GLM-5.2) · Secrets · SCA · IaC · GH Actions · Base Images · Supply Chain Threats · Exploit Chains · Adversarial Verification

We're continuously improving Broly's accuracy and finding quality — your feedback is valuable. False positives, missed findings, bugs, and feature requests all welcome.

Ask in #security-engineering   Powered by Together AI

@varun1729TogetherAI
varun1729TogetherAI requested review from muhsinking and zainhas and removed request for zainhas August 7, 2026 21:08

@blainekasten blainekasten left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets not merge this yet. Not until it's non feature-flagged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants