Add offline models, test coverage, and GitHub Container Registry support #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds three major improvements to the Vector Embedder Microservice:
1. 🚀 Offline Model Support & Performance Improvements
2. ✅ Comprehensive Test Coverage
test_embeddings.pywith 14 test cases for embedding logictest_main.pywith 17 test cases for API endpoints3. 📦 GitHub Container Registry (ghcr.io) Support
v1.0.0→ multiple tag variants)Key Files Changed
New Files
preload_models.py- Script to download models during Docker buildtest_embeddings.py- Unit tests for embedding logictest_main.py- Unit tests for Flask API.github/workflows/test.yml- CI/CD for automated testing.github/workflows/docker-publish.yml- CI/CD for Docker image publishingrequirements-dev.txt- Development and testing dependenciespytest.ini- Pytest configuration.coveragerc- Coverage reporting configurationModified Files
Dockerfile- Model pre-loading, configurable models, optimized Gunicornembeddings.py- Use environment variables for model configurationREADME.md- Extensive documentation updates with new sections.gitignore- Updated with test artifacts and common exclusionsBuild Arguments
The Docker image now supports configurable models:
docker build \ --build-arg EMBEDDING_MODEL=all-mpnet-base-v2 \ --build-arg TOKENIZER_MODEL=sentence-transformers/all-mpnet-base-v2 \ -t vector-embedder-microservice .Testing
Run tests locally:
CI/CD
Tests will run automatically on this PR via GitHub Actions.
Deployment
After merging, the Docker image will be automatically published to:
ghcr.io/jsv4/vectorembeddermicroservice:latestghcr.io/jsv4/vectorembeddermicroservice:mainNote: After the first build, you'll need to make the package public in GitHub settings.
Checklist