Skip to content

fix(cold-storage): create cold directory before archiving idle models - #5861

Closed
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/cold-storage-initial-directory
Closed

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/cold-storage-initial-directory

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/scripts/llm-cold-storage.sh, when cold storage archiving is executed on a host where $COLD_DIR does not yet exist, mv "$model_dir" "$COLD_DIR/$name" fails because the target directory has not been created. Because the move failure was unhandled, the script proceeded to execute ln -s "$COLD_DIR/$name" "${model_dir%/}" against the unmoved source directory (creating a broken nested link inside the intact cache directory) and unconditionally incremented the archived counter, falsely reporting successful archive operations while leaving models in place.

This patch ensures $COLD_DIR is created before attempting to move idle models, guards the subsequent symlink creation and success counters on mv exiting 0, and ensures $HF_CACHE exists prior to restoring archived models. Existing model retention thresholds, protected model sets, and symlink resolution contracts remain unchanged.

Validation

  • Repro baseline: Invoked llm-cold-storage.sh --execute against an idle model directory with a non-existent $COLD_DIR; confirmed mv failed, the model was left unarchived, and an erroneous symlink was created inside the cache directory while reporting 1 archived.
  • Post-fix: Verified test_cold_storage_initial_directory.py passes with exit code 0; $COLD_DIR is created, the model is cleanly moved, symlink resolution verifies against the archived payload, and restore roundtrips the directory back to $HF_CACHE.
  • Cold storage suites: 1 passed. New-test Ruff, ShellCheck, and diff checks pass; new regressions wired into Linux CI.

Overlap check

Risk / AI disclosure

AI-assisted investigation, implementation and CLI regressions. This strengthens filesystem directory creation and return-code guards during model storage tiering, not runtime model execution. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.

Follow-up integration evidence

Composed with #5699 at 65a2a7a51 without conflicts. Production and test diffs passed together; cold storage relative-path round trips and preservation checks remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

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.

2 participants