Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3094,8 +3094,8 @@ def cmd_info(args):
│ ██╔══██╗██╔═══██╗██╔══██╗ │
│ ██████╔╝██║ ██║██║ ██║ │
│ ██╔═══╝ ██║ ██║██║ ██║ │
│ ██║ ╚██████╔╝██████╔╝\033[0m\033[1m CLI\033[0m\033[38;2;212;135;74m │
│ ╚═╝ ╚═════╝ ╚═════╝ │
│ ██║ ╚██████╔╝██████╔╝\033[0m\033[1m CLI\033[0m\033[38;2;212;135;74m
│ ╚═╝ ╚═════╝ ╚═════╝
│ │
└─────────────────────────────────────┘\033[0m"""

Expand Down
15 changes: 8 additions & 7 deletions backend/utils/proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,16 @@ def run(

duration = time.monotonic() - t0
if result.returncode != 0:
log.warning(
"proc.fail tool=%s rc=%d duration=%.2fs stderr=%s",
tool,
result.returncode,
duration,
(result.stderr or "")[-400:].strip(),
)
if check:
log.warning(
"proc.fail tool=%s rc=%d duration=%.2fs stderr=%s",
tool,
result.returncode,
duration,
(result.stderr or "")[-400:].strip(),
)
raise ProcError(cmd, result.returncode, result.stderr or "", duration)
log.debug("proc.nonzero tool=%s rc=%d duration=%.2fs", tool, result.returncode, duration)
else:
log.debug("proc.ok tool=%s duration=%.2fs", tool, duration)
return result
22 changes: 11 additions & 11 deletions cli/internal/provision/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func fetch(url, dest, label string) error {
break
}
lastErr = err
fmt.Fprintf(os.Stderr, "\n %s interrupted (attempt %d/%d): %v resuming\n", label, attempt, maxAttempts, err)
fmt.Fprintf(os.Stderr, "\n %s interrupted (attempt %d/%d): %v - resuming\n", label, attempt, maxAttempts, err)
time.Sleep(time.Duration(attempt) * time.Second)
}
if lastErr != nil {
Expand All @@ -115,7 +115,7 @@ func download(url, dest, wantSHA, label string) error {
return err
}
if wantSHA == "" {
fmt.Fprintf(os.Stderr, " (no pinned checksum for %s skipped verification)\n", label)
fmt.Fprintf(os.Stderr, " (no pinned checksum for %s - skipped verification)\n", label)
return nil
}
got, err := sha256file(dest)
Expand All @@ -136,12 +136,12 @@ func download(url, dest, wantSHA, label string) error {
func verifyDownload(archive, sumsURL, name string) error {
resp, err := downloadHTTPClient().Get(sumsURL)
if err != nil {
fmt.Fprintf(os.Stderr, " (could not fetch checksums for %s skipped verification)\n", name)
fmt.Fprintf(os.Stderr, " (could not fetch checksums for %s - skipped verification)\n", name)
return nil
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
fmt.Fprintf(os.Stderr, " (no checksums for %s skipped verification)\n", name)
fmt.Fprintf(os.Stderr, " (no checksums for %s - skipped verification)\n", name)
return nil
}
data, err := io.ReadAll(io.LimitReader(resp.Body, 4<<20))
Expand All @@ -150,7 +150,7 @@ func verifyDownload(archive, sumsURL, name string) error {
}
want := ParseChecksums(data)[name]
if want == "" {
fmt.Fprintf(os.Stderr, " (no checksum entry for %s skipped verification)\n", name)
fmt.Fprintf(os.Stderr, " (no checksum entry for %s - skipped verification)\n", name)
return nil
}
got, err := sha256file(archive)
Expand Down Expand Up @@ -408,17 +408,17 @@ func httpGetBytes(url string) ([]byte, error) {
func verifyReleaseAsset(assets map[string]string, assetName, path string) error {
sumsURL, ok := assets["checksums.txt"]
if !ok {
fmt.Fprintf(os.Stderr, " (no checksums.txt in release skipped verification of %s)\n", assetName)
fmt.Fprintf(os.Stderr, " (no checksums.txt in release - skipped verification of %s)\n", assetName)
return nil
}
data, err := httpGetBytes(sumsURL)
if err != nil {
fmt.Fprintf(os.Stderr, " (could not fetch checksums.txt: %v skipped verification of %s)\n", err, assetName)
fmt.Fprintf(os.Stderr, " (could not fetch checksums.txt: %v - skipped verification of %s)\n", err, assetName)
return nil
}
want, ok := ParseChecksums(data)[assetName]
if !ok {
fmt.Fprintf(os.Stderr, " (no checksum entry for %s skipped verification)\n", assetName)
fmt.Fprintf(os.Stderr, " (no checksum entry for %s - skipped verification)\n", assetName)
return nil
}
got, err := sha256file(path)
Expand Down Expand Up @@ -719,7 +719,7 @@ func EnsurePython(requirements string) (string, error) {
}

func pipInstall(pybin, requirements string) error {
fmt.Fprintf(os.Stderr, " installing python deps (%s) pulls ~80MB, first run takes a minute\n", filepath.Base(requirements))
fmt.Fprintf(os.Stderr, " installing python deps (%s) - pulls ~80MB, first run takes a minute\n", filepath.Base(requirements))
cmd := exec.Command(pybin, "-m", "pip", "install", "--disable-pip-version-check", "--progress-bar=on", "-r", requirements)
cmd.Stdout, cmd.Stderr = os.Stderr, os.Stderr
cmd.Env = append(os.Environ(), "PYTHONUNBUFFERED=1")
Expand All @@ -732,9 +732,9 @@ func pipInstall(pybin, requirements string) error {
func EnsureSpeakerDeps() error {
bin := PythonBin()
if !have(bin) {
return fmt.Errorf("python not provisioned run `podcli setup` first")
return fmt.Errorf("python not provisioned - run `podcli setup` first")
}
fmt.Fprintln(os.Stderr, " installing speaker deps (pyannote.audio + torch) large download (~2GB), several minutes")
fmt.Fprintln(os.Stderr, " installing speaker deps (pyannote.audio + torch) - large download (~2GB), several minutes")
cmd := exec.Command(bin, "-m", "pip", "install", "--disable-pip-version-check", "--progress-bar=on", "pyannote.audio>=3.1.0", "speechbrain")
cmd.Stdout, cmd.Stderr = os.Stderr, os.Stderr
cmd.Env = append(os.Environ(), "PYTHONUNBUFFERED=1")
Expand Down
8 changes: 4 additions & 4 deletions cli/internal/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func NotifyIfOutdated(current string) {
return
}
if newer(tag, current) {
fmt.Fprintf(os.Stderr, " podcli %s available (you have %s) run `podcli update`\n", tag, current)
fmt.Fprintf(os.Stderr, " podcli %s available (you have %s) - run `podcli update`\n", tag, current)
}
}

Expand All @@ -157,7 +157,7 @@ func Run(current string) int {
fmt.Printf("podcli %s is up to date.\n", current)
return 0
}
fmt.Printf("Updating podcli %s %s ...\n", current, tag)
fmt.Printf("Updating podcli %s -> %s ...\n", current, tag)
if err := apply(tag); err != nil {
printSelfUpdateFailure(os.Stderr, err)
return 1
Expand Down Expand Up @@ -222,7 +222,7 @@ func verifyStaged(tag, staged string) error {
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusNotFound {
fmt.Fprintln(os.Stderr, " (no checksums.txt in release skipped verification)")
fmt.Fprintln(os.Stderr, " (no checksums.txt in release - skipped verification)")
return nil
}
if resp.StatusCode != http.StatusOK {
Expand All @@ -234,7 +234,7 @@ func verifyStaged(tag, staged string) error {
}
want, ok := provision.ParseChecksums(data)[assetName()]
if !ok {
fmt.Fprintf(os.Stderr, " (no checksum entry for %s skipped verification)\n", assetName())
fmt.Fprintf(os.Stderr, " (no checksum entry for %s - skipped verification)\n", assetName())
return nil
}
got, err := provision.Sha256File(staged)
Expand Down
Loading
Loading