Repository navigation
Installer: restore interrupted updates and clean stale rollback environments - #7342
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35d19c5e59
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Reconcile PR #7256 (Windows torch 2.11 + release preservation, installer comment reduction, torch 2.11 default line) with 77 commits of main install rewrites. Base is main's newer install semantics; this branch's still-novel contributions are layered on top. Key decisions: - install.ps1: kept main's rollback lifecycle (try/finally Restore-StudioVenvRollback, #7342) and the installed-version report (#7265); layered this branch's torch-2.11 allowance (torch<2.12.0 on the Windows CUDA fresh-install, CPU fallback and flavor repairs), the release-preservation port (Get-InstalledTorchVersionRaw / kept-release installs / UNSLOTH_KEPT_TORCH handoff / torch-overrides freeze) and the Exit-InstallFailure UNSLOTH_KEPT_TORCH clear. - install.sh: took main's newer AMD/Strix routing (per-arch index reroute #7264/#7300, runtime-less gfx inference #7305, KFD detection fix #7314, Radeon 8065S regex #7290, signal-restore trap #7342) and the #7365 unsloth pin bump; kept this branch's _TORCH_CEILING/_TORCHVISION_CEILING/_TORCHAUDIO_CEILING refactor widening the default ceiling to torch<2.12.0. - studio/install_python_stack.py: deferred all five code conflicts to main's Strix inference logic (result is AST-identical to main; only comment reductions remain). - studio/setup.ps1: took main's comment covering the whisper.cpp dictation markers (#7095); the UNSLOTH_KEPT_TORCH consumption handoff auto-merged intact. Dropped as superseded by main: this branch's stale unsloth>=2026.7.4 pins (main #7365), the older rocm7.1->rocm7.2 Strix reroute (main #7264/#7300), the narrow Radeon 80[0-9]0S regex (main #7290), and the pre-inference has_hip_torch gate (main's rocm_torch_ready gate, Codex P1 #7305). The two review-item fixes (grep -E in test_torch_constraint.sh, UNSLOTH_KEPT_TORCH clear in Exit-InstallFailure) survive.
Every Studio reinstall moves the existing Python environment to
unsloth_studio.rollback.<timestamp>.<pid>before building its replacement. Once PyTorch is installed, each rollback can take several gigabytes.On Debian and Ubuntu,
curl ... | shruns underdash, which does not execute the existingEXITtrap forINT,TERM, orHUP. Interrupting or closing an update could therefore leave the old environment under its rollback name and the live environment incomplete. Windows had the same unguarded replacement window, while locked-file cleanup failures were ignored.Fix
Handle
HUP,INT, andTERMexplicitly ininstall.sh, and protect the Windows replacement withtry/finally. When an update is interrupted or fails, the incomplete environment is removed and the previous one is restored.After a replacement succeeds, remove older rollback directories whose owner process is no longer running. Rollbacks belonging to active installers are preserved, as are symlinks, Windows reparse points, and names outside the installer's generated format. Windows cleanup retries temporarily locked files and reports the retained path if deletion still fails.
Rollback state is recorded before the old environment is renamed and cleared before a committed backup is deleted. This covers interruptions at both transition boundaries without risking replacement of a healthy new environment with a partially deleted backup.
Verification
dashand coverSIGINT,SIGTERM,SIGHUP, restoration, transition boundaries, and stale cleanup: 19 checks passed.