Add a deployment option as a docker container exposing an API interface, essentially allowing it to run as a microservice#280
Conversation
|
Hi @devlux76. I'm not sure this is a feature that we want to support for eyecite, since it's such a small python program. Adding HTTP to it will make it a good deal slower, I'd expect, though I understand how microservices can help scale horizontally. I think this might be better as a third party tool that somebody maintains. Maybe we could do that and reference it in the readme instead? |
|
Ok, that's certainly possible. To my mind it made sense to give the option for a docker deployable version here since all it's doing is wrapping eyecite in FastAPI. So pretty much someone would need to opt into the functionality, it shouldn't be slowing anything down but instead opening up a new way to use it. Nevertheless, go ahead and close this as rejected and I'll do it as a separate project. |
|
Yeah, I imagine it's simple code, but it'd need updates and support over time, so it's better to spin it out, I think. Thanks though! |
This pull request introduces a Dockerized RESTful API for the
eyecitelibrary, enabling programmatic access to citation-related functions such as extraction, resolution, annotation, and cleaning. The most important changes include the addition of aDockerfile, API implementation using FastAPI, automated build and test workflows, and supporting documentation.Dockerization and API Implementation:
Dockerfile: Added a Dockerfile to containerize theeyeciteAPI, using Python 3.11-slim as the base image and exposing the API on port 8000.api/main.py: Implemented FastAPI endpoints for citation-related functions (extract,resolve,annotate,clean,extract-resolve, and optionallydump) with input/output validation using Pydantic models.CI/CD Workflow:
.github/workflows/docker-api.yml: Added a GitHub Actions workflow to build, test, and validate the DockerizedeyeciteAPI on pushes and pull requests to themainbranch.Documentation:
README.md: Documented the API endpoints, example usage, and development instructions, including how to run the API locally using Docker.PLAN.md: Outlined the design and implementation plan for the API, including endpoint specifications, framework selection, and deployment considerations.Testing:
api/test_api.py: Added basic integration tests for the/extractand/cleanendpoints to verify API functionality.