-
Notifications
You must be signed in to change notification settings - Fork 0
Version 0.2.0 with S3, docker, bells and whistles #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates storage to optional S3-backed workflows, converts key utilities and portfolio functions to async, refactors configuration and API security, and updates packaging and deployment artifacts.
- Introduce
CloudObjectStoragewith S3 support alongsideLocalFileStorageand comprehensive tests. - Convert
utils, portfolio fetch/optimize/prepare functions to async and switch toopenbb_fmpfor data fetching. - Refactor FastAPI app to use OAuth2 security with Pydantic
AppConfig, update endpoint definitions, widget metadata, packaging (pyproject.toml), Dockerfile, and add Kubernetes manifests.
Reviewed Changes
Copilot reviewed 36 out of 40 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| allocator_bot/storage.py | Add CloudObjectStorage, S3 logic, update tests |
| tests/test_storage.py | New tests for S3 and local storage flows |
| allocator_bot/utils.py | Async-ify helpers (validate_api_key, sanitize_message, generate_id) |
| tests/test_utils.py | Update coverage for async utils |
| allocator_bot/portfolio.py | Async portfolio functions, switch to FMPEquityHistoricalFetcher |
| tests/test_portfolio.py | New async tests for portfolio logic |
| allocator_bot/api.py | OAuth2 security, Pydantic config, endpoint/widget metadata refactor |
| pyproject.toml | Migrate to [project] format, update dependencies |
| Dockerfile | Multi-stage Docker build |
| k8s/*.yaml | Add Kubernetes deployment, service, configmap, secret, namespace |
Comments suppressed due to low confidence (2)
allocator_bot/utils.py:30
- [nitpick] The docstring still says "total length of 4 characters" but the suffix length is now configurable. Please update the docstring to reflect that the total ID length = timestamp part length (2) + the
lengthparameter.
async def generate_id(length: int = 2) -> str:
allocator_bot/storage.py:108
- [nitpick] The parameter
allocation_idinsave_taskrefers to a task identifier, not an allocation. Consider renaming it totask_idfor clarity.
async def save_task(allocation_id: str, task_data: dict) -> str:
This pull request introduces several updates to enhance the Allocator Bot's functionality, improve its deployment process, and streamline its codebase. Key changes include the addition of Docker support, updates to environment configuration, new GitHub Actions workflows, and significant refactoring of the bot's agent logic.
Deployment and Configuration Enhancements:
Dockerfilefor multi-stage builds, enabling easy deployment of the Allocator Bot as a Docker container. The runtime stage uses a non-root user for security, and the default port is exposed as4299..env.exampleto include new configuration options such as S3 storage settings and renamedAPI_KEYS_FILE_PATHtoAPP_API_KEYfor clarity..dockerignoreto exclude unnecessary files from Docker builds, improving build performance.GitHub Actions Workflows:
docker-publish.ymlworkflow to build and publish Docker images to GitHub Container Registry on pushes to themainbranch.lint_and_test.ymlworkflow to automate linting and testing on pushes and pull requests to themainbranch.Codebase Refactoring:
allocator_bot/agent.pyto replace OpenAI models with OpenRouter models, add retry logic, and improve the structure of LLM interactions. Introduced new helper methods such asmake_llmand updated theexecution_loopto yield reasoning steps and tables for better SSE responses. [1] [2]allocator_bot/__main__.pyand implemented aget_appfunction that loads environment variables and initializes the FastAPI app.Documentation Updates:
README.mdwith Docker setup instructions, environment variable descriptions, and updated usage details for integration with OpenBB Workspace. [1] [2] [3]Miscellaneous:
.markdownlint.jsonto configure markdown linting rules, disablingMD033andMD013..cursorrules,CLAUDE.md, andGEMINI.mdto include references tollms.md.