Skip to content

v0.3.4 — spectator install self-heals a stub-dir VSS checkout

Choose a tag to compare

@myurasov myurasov released this 10 May 01:08
· 23 commits to main since this release

What was broken

The install bash payload's idempotency check only handled two states of `$workdir/video-search-and-summarization/`:

  1. exists with `.git/` → fetch + pull
  2. doesn't exist → `git clone`

Anything else fell through to a plain `git clone`, which crashes with:

```
fatal: destination path 'video-search-and-summarization' already
exists and is not an empty directory.
```

A user upgrading across today's three default-`$workdir` renames hit exactly that — a leftover empty stub dir from an interrupted earlier install, with the error message offering no actionable next step.

What changed

The script now distinguishes three states:

  1. exists with .git/ → fetch + pull (unchanged).
  2. exists, empty → `rmdir` and clone fresh. Safe because POSIX `rmdir` refuses non-empty directories — the `[ -z "$(ls -A ...)" ]` guard is belt-and-suspenders for clarity.
  3. exists, non-empty, no .git/ → hard error with the contents enumerated and the canonical rm-rf hint baked into the message:

```
==== ERROR: ~/.spectator/video-search-and-summarization/ exists
but is not a git checkout. ====
contents (first few entries):
<ls -A output>

If it's leftover from a failed install or an interrupted
migration, remove it and re-run deploy:
  ssh <gpu-machine> 'rm -rf ~/.spectator/video-search-and-summarization'
  ./spectator deploy --target <gpu-machine>

If you put real data there, move it elsewhere first.

```

Tests

1 new test renders the install bash payload and pins all three branches (`if` / `elif` / `else`, the rmdir, the error message, the exact $workdir/$vss_checkout path in the rm-rf hint). `bash -n` parse-check on the rendered heredoc also passes. Suite is now 45/45 (was 44).

Migration

None required. v0.3.4 just makes `./spectator deploy --target ...` more forgiving when the target's filesystem has stub state from prior failed installs.