Skip to content

Conversation

michaeldwan
Copy link
Member

This PR does 3 things.

First, #2522 pins any model with cog_runtime: true to a coglet version that predates incompatible procedure-related changes to cog-runtime. However... the default template for procedures sets cog_runtime to true. Boo. This ensures that procedures use the latest coglet, normal models with cog_runtime:true use the pinned version, and everything else uses the default.

Second, the init template for procedures no longer sets the offending cog_runtime: true.

Third, when we do end up with the correct cog-runtime & coglet version in the model, cog's stdout is spammed with logs from the container:

{"severity":"info","timestamp":"2025-09-12T16:32:29.498Z","logger":"cog","caller":"cog/main.go:59","message":"configuration","use-procedure-mode":false,"await-explicit-shutdown":false,"one-shot":false,"upload-url":""}
{"severity":"info","timestamp":"2025-09-12T16:32:29.500Z","logger":"cog","caller":"cog/main.go:67","message":"starting Cog HTTP server","addr":"0.0.0.0:5000","version":"0.2.0b3","pid":6}
{"severity":"info","timestamp":"2025-09-12T16:32:29.505Z","logger":"cog-http-server","caller":"server/runner.go:213","message":"python runner started","pid":12}
{"severity":"info","timestamp":"2025-09-12T16:32:29.510Z","logger":"cog-http-server","caller":"server/runner.go:547","message":"configuring runner","module":"predict","predictor":"run","max_concurrency":1}

To fix that, stderr from the container is now redirected to cog's console logger. If the log line is structured json (like above) it'll be parsed and tagged with the correct log level. If it is an unstructured log line it'll land in the console's info level. By default only warning+ is shown, if the --debug flag is set all logs are shown.

@michaeldwan michaeldwan marked this pull request as ready for review September 12, 2025 22:10
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.

1 participant