Skip to content

Add a deployment option as a docker container exposing an API interface, essentially allowing it to run as a microservice#280

Closed
devlux76 wants to merge 4 commits intofreelawproject:mainfrom
devlux76:main
Closed

Add a deployment option as a docker container exposing an API interface, essentially allowing it to run as a microservice#280
devlux76 wants to merge 4 commits intofreelawproject:mainfrom
devlux76:main

Conversation

@devlux76
Copy link

This pull request introduces a Dockerized RESTful API for the eyecite library, enabling programmatic access to citation-related functions such as extraction, resolution, annotation, and cleaning. The most important changes include the addition of a Dockerfile, API implementation using FastAPI, automated build and test workflows, and supporting documentation.

Dockerization and API Implementation:

  • Dockerfile: Added a Dockerfile to containerize the eyecite API, 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 optionally dump) 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 Dockerized eyecite API on pushes and pull requests to the main branch.

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 /extract and /clean endpoints to verify API functionality.

@mlissner
Copy link
Member

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?

@devlux76
Copy link
Author

devlux76 commented Jun 25, 2025

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.

@mlissner
Copy link
Member

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!

@mlissner mlissner closed this Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments