Skip to content

Commit

Permalink
chore: print local binary logs on error
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Dec 3, 2024
1 parent d6d5bfb commit 7b3be54
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/ollama/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,18 @@ func startOllama(ctx context.Context, localCtx *localContext) (*exec.Cmd, *os.Fi
func waitForOllama(ctx context.Context, c *OllamaContainer) error {
err := wait.ForLog("Listening on "+localIP+":11434").WaitUntilReady(ctx, c)
if err != nil {
logs, err := c.Logs(ctx)
if err != nil {
return fmt.Errorf("wait for ollama to start: %w", err)
}

bs, err := io.ReadAll(logs)
if err != nil {
return fmt.Errorf("read ollama logs: %w", err)
}

testcontainers.Logger.Printf("ollama logs:\n%s", string(bs))

return fmt.Errorf("wait for ollama to start: %w", err)
}

Expand Down

0 comments on commit 7b3be54

Please sign in to comment.