Releases: replicate/cog-runtime
Releases · replicate/cog-runtime
v0.3.5
bugfix: Ensure schema is loaded before processing (#221) * bugfix: Ensure schema is loaded before processing Schema wasn't loaded prior to processing the input paths this resulted in a noop nil response. To ensure we always load the schema first we now block on runner ready state before processing. Additionaly a nil doc is considered an error. In the cases we call ProcessInputPaths we can accept that error; in manager we explicitly check for doc being nil and emit an error log. * Ensure that we always 202 for async Async predictions should not 500. However, since we now known that the runner failed before we send the prediction request down, we end up needing to work around the error and still send a 202 *then* let the webhook indicate failure. While this behavior is somewhat crazy, it is the behavioral contract we can revisit in the future.
v0.3.4
Release v0.3.4 with slot release fix
v0.3.3
v0.3.3
v0.3.2
v0.3.2
v0.3.1
v0.3.1 of cog-runtime.
v0.2.0-beta3
feat: cleanup timeout for process termination (#207) Implement configurable cleanup timeout to control how long the system waits for process cleanup verification before triggering forced shutdown. This replaces the hardcoded 10-second timeout with a user-configurable value. Configuration: - Add --cleanup-timeout CLI flag (default: 10s, env: COG_CLEANUP_TIMEOUT) - Flow: CLI → Config → Runner for proper field injection Implementation changes: - Replace hardcoded timeout with context.WithTimeout() pattern - Improve check interval from 100ms to 10ms for more responsive detection - Add injectable verifyFn field to Runner for comprehensive testing - Update terminology from "ungraceful shutdown" to "forced shutdown" Testing improvements: - Migrate time-dependent tests to Go 1.25 synctest for deterministic execution - Add comprehensive test coverage for timeout scenarios and multiple ForceKill calls - Use safe high PID values (9999999) and proper mocking to prevent real process operations - Configure linter to handle synctest patterns correctly This enables users to customize cleanup wait times based on their specific workload requirements while maintaining safe defaults. * Address leaking coglets from test The test harness now properly cleans up orphaned coglet processes when interrupted: Key Features: - Cross-platform compatibility: Works on both macOS (Darwin) and Linux - Robust process discovery: Uses pgrep -f coglet as primary method, falls back to ps with platform-specific flags - Safe process killing: Validates we can signal processes before attempting to kill them - Process group cleanup: Kills both process groups and individual processes - Safety measures: Never kills ourselves, our parent, or PID 1 - Signal handling: Responds to both SIGINT (ctrl+c) and SIGTERM Implementation Details: - killAllChildProcesses() finds and kills coglet processes during cleanup - findCogletProcesses() tries pgrep first, falls back to ps - Platform-specific ps flags: -ax on macOS, -e on Linux - Process ownership validation through signal testing before killing - Integrated into existing TestMain signal handler --------- Co-Authored-By: Michael Dwan <[email protected]> Co-authored-by: Morgan Fainberg <[email protected]>
v0.2.0-beta2
Implement type checker compatible Input() function (#196) Convert Input from dataclass to function with overloads following Pydantic's pattern. Maintains exact same syntax for developers while providing full type checker compatibility.
v0.2.0-beta1
Release v0.2.0-beta1 with a rework to the BaseModel
v0.1.0-beta13
Fix pyodide dataclass loading issue + tests! (#194) * import correct `is_dataclass` function * add tests to verify the pyodide fix actually fixed it
v0.1.0-beta12
Add pyodide specific BaseModel (#193) * pyodide has a curious issue where it does not recognise BaseModel as a dataclass * It is defined as a dataclass through its use of __new__ which standard python accepts * To get around this, make a new base model for pyodide which uses __init_subclass__ * Decide which implementation to use depending on whether we are in pyodide