Skip to content

Patch dockerfile and resolve StopAsyncIteration issue#11

Merged
piiq merged 5 commits intomainfrom
dockerfile-patch
Mar 12, 2026
Merged

Patch dockerfile and resolve StopAsyncIteration issue#11
piiq merged 5 commits intomainfrom
dockerfile-patch

Conversation

@piiq
Copy link
Owner

@piiq piiq commented Mar 12, 2026

Summary of Changes

This PR addresses critical deployment and runtime issues encountered when running the Allocator Bot in production environments, particularly after the recent toolchain modernization.

Key Fixes

🐳 Docker & Kubernetes Reliability

  • Python 3.13 Migration: Updated the Dockerfile to use Python 3.13 in both builder and runtime stages.
  • Explicit packaging Dependency: Added packaging>=26.0 as a direct project dependency. This resolves a ModuleNotFoundError: No module named 'packaging' that occurred in production builds (uv sync --no-dev). This issue stemmed from pypfopt (via scikit-base) requiring the module at runtime, while it was previously only available as a transitive dev dependency.

⚡️ Runtime Fixes

  • Async Generator Compatibility: Replaced a generator expression in allocator_bot/api.py with an explicit async generator function. This resolves a RuntimeError: async generator raised StopAsyncIteration encountered in Python 3.13 during SSE streaming (PEP 479).

📦 Versioning

  • Bump Version: Incremented project version to 0.3.1.

Verification Results

  • Local Docker Build: Successfully built and verified image allocator-bot:test.
  • Production Startup: Confirmed the container starts correctly, loads all modules (including pypfopt), and passes environment validation.
  • Streaming Logic: Verified that real-time SSE streaming works correctly without StopAsyncIteration errors.
  • Tests: All 72 unit tests are passing.

@piiq piiq merged commit 95c4b69 into main Mar 12, 2026
1 check passed
@piiq piiq deleted the dockerfile-patch branch March 12, 2026 17:46
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