Skip to content

Commit

Permalink
api v1alpha1 (#17)
Browse files Browse the repository at this point in the history
* api v1alpha1

Signed-off-by: Guillaume Moutier <[email protected]>
Signed-off-by: Michele Dolfi <[email protected]>

* use actual types in request models and refactor

Signed-off-by: Michele Dolfi <[email protected]>

* make gradio optional and update README

Signed-off-by: Michele Dolfi <[email protected]>

* Run workflow jobs sequentially to avoid disk space outage (#19)

Github Action runners are running out of the space while
building both the images in parallel.

This change will build the image sequentially and also
clean up the cpu images before start building gpu image.

Signed-off-by: Anil Vishnoi <[email protected]>
Signed-off-by: Michele Dolfi <[email protected]>

* Add github job to build image (and not publish) on PR creation (#20)

Signed-off-by: Anil Vishnoi <[email protected]>
Signed-off-by: Michele Dolfi <[email protected]>

* add start_server script for local dev

Signed-off-by: Michele Dolfi <[email protected]>

* fix 3.12-only syntax

Signed-off-by: Michele Dolfi <[email protected]>

* fix more py3.10-11 compatibility

Signed-off-by: Michele Dolfi <[email protected]>

* rework output format and background tasks

Signed-off-by: Michele Dolfi <[email protected]>

* speficy return schemas for openapi

Signed-off-by: Michele Dolfi <[email protected]>

* add processing time and update REDAME

Signed-off-by: Michele Dolfi <[email protected]>

* lint markdown

Signed-off-by: Michele Dolfi <[email protected]>

* add MD033 to config

Signed-off-by: Michele Dolfi <[email protected]>

* use port 5000

Signed-off-by: Michele Dolfi <[email protected]>

* use port 5001 as default

Signed-off-by: Michele Dolfi <[email protected]>

* update deps

Signed-off-by: Michele Dolfi <[email protected]>

* refactor input request

Signed-off-by: Michele Dolfi <[email protected]>

* return docling document

Signed-off-by: Michele Dolfi <[email protected]>

* update new payload in README

Signed-off-by: Michele Dolfi <[email protected]>

* add base64 example

Signed-off-by: Michele Dolfi <[email protected]>

* wrap example in <details>

Signed-off-by: Michele Dolfi <[email protected]>

* rename /url in /source

Signed-off-by: Michele Dolfi <[email protected]>

* move main execution to __main__

Signed-off-by: Michele Dolfi <[email protected]>

---------

Signed-off-by: Guillaume Moutier <[email protected]>
Signed-off-by: Michele Dolfi <[email protected]>
Signed-off-by: Anil Vishnoi <[email protected]>
Co-authored-by: Michele Dolfi <[email protected]>
Co-authored-by: Anil Vishnoi <[email protected]>
  • Loading branch information
3 people authored Feb 3, 2025
1 parent ddf3144 commit c6539c4
Show file tree
Hide file tree
Showing 25 changed files with 3,621 additions and 1,238 deletions.
40 changes: 40 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Ignore Python cache files
__pycache__/
**/__pycache__/
*.pyc
*.pyo
*.pyd

# Ignore virtual environments
env/
venv/

# Ignore development artifacts
*.log
*.db
*.sqlite3

# Ignore configuration and sensitive files
**/.env
*.env
*.ini
*.cfg

# Ignore IDE and editor settings
.vscode/
.idea/
*.swp
*.swo

# Ignore Git files
.git/
.gitignore

# Ignore Docker files themselves (optional if not needed in the image)
.dockerignore
Dockerfile*

# Ignore build artifacts (if applicable)
build/
dist/
*.egg-info
2 changes: 2 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ config:
line-length: false
no-emphasis-as-header: false
first-line-heading: false
MD033:
allowed_elements: ["details", "summary"]
globs:
- "**/*.md"
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ repos:
pass_filenames: false
language: system
files: '\.py$'
- repo: local
hooks:
- id: autoflake
name: autoflake
entry: poetry run autoflake docling_serve tests
pass_filenames: false
language: system
files: '\.py$'
- repo: local
hooks:
- id: system
Expand Down
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ COPY --chown=1001:0 --chmod=664 ./docling_serve ./docling_serve

EXPOSE 5001

CMD ["uvicorn", "--port", "5001", "--host", "0.0.0.0", "docling_serve.app:app"]
CMD ["python", "-m", "docling_serve"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ md-lint-file:
$(CMD_PREFIX) touch .markdown-lint

.PHONY: docling-serve-cpu-image
docling-serve-cpu-image: Containerfile ## Build docling-serve "cpu only" continaer image
docling-serve-cpu-image: Containerfile ## Build docling-serve "cpu only" container image
$(ECHO_PREFIX) printf " %-12s Containerfile\n" "[docling-serve CPU ONLY]"
$(CMD_PREFIX) docker build --build-arg CPU_ONLY=true -f Containerfile --platform linux/amd64 -t ghcr.io/ds4sd/docling-serve-cpu:$(TAG) .
$(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve-cpu:$(TAG) ghcr.io/ds4sd/docling-serve-cpu:main
$(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve-cpu:$(TAG) quay.io/ds4sd/docling-serve-cpu:main

.PHONY: docling-serve-gpu-image
docling-serve-gpu-image: Containerfile ## Build docling-serve continaer image with GPU support
docling-serve-gpu-image: Containerfile ## Build docling-serve container image with GPU support
$(ECHO_PREFIX) printf " %-12s Containerfile\n" "[docling-serve with GPU]"
$(CMD_PREFIX) docker build --build-arg CPU_ONLY=false -f Containerfile --platform linux/amd64 -t ghcr.io/ds4sd/docling-serve:$(TAG) .
$(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve:$(TAG) ghcr.io/ds4sd/docling-serve:main
Expand Down
Loading

0 comments on commit c6539c4

Please sign in to comment.