msse-ai-engineering / README.md
Seth McKnight
Add CI/CD workflow and Dockerfile for application deployment (#2)
c4b28eb
|
raw
history blame
2.85 kB

MSSE AI Engineering Project

This project is a Retrieval-Augmented Generation (RAG) application that answers questions about a corpus of company policies.

Setup

  1. Clone the repository:

    git clone https://github.com/sethmcknight/msse-ai-engineering.git
    cd msse-ai-engineering
    
  2. Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
    
  3. Install the dependencies:

    pip install -r requirements.txt
    

Running the Application (local)

To run the Flask application locally:

export FLASK_APP=app.py
flask run

The app will be available at http://127.0.0.1:5000/ and exposes /health and / endpoints.

Running Tests

To run the test suite:

pytest

Current tests cover the basic application endpoints (/health and /). As we implement more features (ingestion, embeddings, RAG, chat API), we will add tests for those components following TDD.

CI/CD and Deployment

This repository includes a GitHub Actions workflow that runs tests on push and pull requests. After merging to main, the workflow triggers a Render deploy and runs a post-deploy smoke test against /health.

If you are deploying to Render manually:

  • Create a Web Service in Render (Environment: Docker).
  • Dockerfile Path: Dockerfile
  • Build Context: .
  • Health Check Path: /health
  • Auto-Deploy: Off (recommended if you want GitHub Actions to trigger deploys)

To enable automated deploys from GitHub Actions, set these repository secrets in GitHub:

  • RENDER_API_KEY — Render API key
  • RENDER_SERVICE_ID — Render service id
  • RENDER_SERVICE_URL — Render public URL (used for smoke tests)

The workflow will create a small deploy-update-<ts> branch with an updated deployed.md after a successful deploy; that commit is marked with [skip-deploy] so merging it will not trigger another deploy.

Notes

  • run.sh binds Gunicorn to the PORT environment variable so it works on Render.
  • The Dockerfile copies only runtime files and uses .dockerignore to avoid including development artifacts.

Next steps

  • Add ingestion, embedding, and RAG components (with tests). See project-plan.md for detailed milestones.

Developer tooling

To keep the codebase formatted and linted automatically, we use pre-commit hooks.

  1. Create and activate your virtualenv (see Setup above).
  2. Install developer dependencies:
pip install -r dev-requirements.txt
  1. Install the hooks (runs once per clone):
pre-commit install
  1. To run all hooks locally (for example before pushing):
pre-commit run --all-files

CI has a dedicated pre-commit-check job that runs on pull requests and will fail the PR if any hook fails. We also run formatters and tests in the main build job.