Automated model reloading after training #38

Merged
vascodias23 merged 2 commits from production-deployment into main 2025-12-13 00:51:38 +00:00
vascodias23 commented 2025-12-12 18:47:19 +00:00 (Migrated from github.com)
No description provided.
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-12-12 18:50:03 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull request overview

This PR implements automated model reloading after training by removing the hardcoded "staging" alias and introducing a new continuous deployment workflow. The changes enable the inference API to dynamically load models based on the configured alias, and add a workflow to trigger model reloads in production after successful model promotion.

Key changes:

  • Removed hardcoded "staging" model alias in favor of environment-based configuration
  • Added a new continuous deployment workflow (workflow 4) to automate production model reloading

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/inference_api/main.py Removed hardcoded "staging" alias and TODO comment, now uses MODEL_ALIAS from configuration
.github/workflows/4-continuous-deployment.yml New workflow to trigger model reload after staging promotion completes successfully

Critical Issues Found:

The new deployment workflow has fundamental issues that will prevent it from functioning:

  1. Invalid localhost target: The workflow attempts to call http://localhost:9001/reload on the GitHub Actions runner, but no production service is running there.

  2. Missing deployment infrastructure: Unlike the staging workflow which properly deploys a Docker container with all required environment variables (MLflow credentials, tracking URI, model alias), this workflow has no deployment steps and will fail to connect to any service.

The workflow needs to either:

  • Deploy a production container locally for testing (similar to staging workflow), OR
  • Configure a production server URL (via GitHub variables/secrets) to reload an externally hosted production service
## Pull request overview This PR implements automated model reloading after training by removing the hardcoded "staging" alias and introducing a new continuous deployment workflow. The changes enable the inference API to dynamically load models based on the configured alias, and add a workflow to trigger model reloads in production after successful model promotion. Key changes: - Removed hardcoded "staging" model alias in favor of environment-based configuration - Added a new continuous deployment workflow (workflow 4) to automate production model reloading ### Reviewed changes Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments. | File | Description | | ---- | ----------- | | src/inference_api/main.py | Removed hardcoded "staging" alias and TODO comment, now uses MODEL_ALIAS from configuration | | .github/workflows/4-continuous-deployment.yml | New workflow to trigger model reload after staging promotion completes successfully | **Critical Issues Found:** The new deployment workflow has fundamental issues that will prevent it from functioning: 1. **Invalid localhost target**: The workflow attempts to call `http://localhost:9001/reload` on the GitHub Actions runner, but no production service is running there. 2. **Missing deployment infrastructure**: Unlike the staging workflow which properly deploys a Docker container with all required environment variables (MLflow credentials, tracking URI, model alias), this workflow has no deployment steps and will fail to connect to any service. The workflow needs to either: - Deploy a production container locally for testing (similar to staging workflow), OR - Configure a production server URL (via GitHub variables/secrets) to reload an externally hosted production service
@ -0,0 +18,4 @@
run: |
echo "Deploying to Production..."
# Reload model
curl -f -v -X GET "http://localhost:9001/reload"
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-12-12 18:50:02 +00:00

The curl command is targeting localhost:9001, which will fail because the production inference API is not running on the GitHub Actions runner. The workflow needs to either deploy or connect to an actual production environment. Consider deploying a production container first (similar to how the staging workflow deploys to test), or configure this to call a production server URL stored in GitHub variables or secrets.

          curl -f -v -X GET "${{ secrets.PRODUCTION_API_URL }}/reload"
The curl command is targeting localhost:9001, which will fail because the production inference API is not running on the GitHub Actions runner. The workflow needs to either deploy or connect to an actual production environment. Consider deploying a production container first (similar to how the staging workflow deploys to test), or configure this to call a production server URL stored in GitHub variables or secrets. ```suggestion curl -f -v -X GET "${{ secrets.PRODUCTION_API_URL }}/reload" ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-12-12 18:50:03 +00:00

The workflow is missing critical deployment steps before attempting to reload the model. Unlike the staging workflow which pulls and runs a Docker container with proper environment configuration (MLFLOW_TRACKING_URI, credentials, MODEL_ALIAS, etc.), this workflow attempts to reload without any container deployment or environment setup. The workflow should either deploy the production container with the production alias before reloading, or connect to an existing production deployment.

The workflow is missing critical deployment steps before attempting to reload the model. Unlike the staging workflow which pulls and runs a Docker container with proper environment configuration (MLFLOW_TRACKING_URI, credentials, MODEL_ALIAS, etc.), this workflow attempts to reload without any container deployment or environment setup. The workflow should either deploy the production container with the production alias before reloading, or connect to an existing production deployment.
AndreFerreira5 (Migrated from github.com) approved these changes 2025-12-13 00:37:19 +00:00
AndreFerreira5 (Migrated from github.com) left a comment

simple as it gets, ready to merge

simple as it gets, ready to merge
Sign in to join this conversation.
No description provided.