Skip to content

Commit c6539c4

Browse files
guimoudolfim-ibmvishnoianil
authoredFeb 3, 2025··
api v1alpha1 (#17)
* 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]>
1 parent ddf3144 commit c6539c4

25 files changed

+3621
-1238
lines changed
 

‎.dockerignore

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Ignore Python cache files
2+
__pycache__/
3+
**/__pycache__/
4+
*.pyc
5+
*.pyo
6+
*.pyd
7+
8+
# Ignore virtual environments
9+
env/
10+
venv/
11+
12+
# Ignore development artifacts
13+
*.log
14+
*.db
15+
*.sqlite3
16+
17+
# Ignore configuration and sensitive files
18+
**/.env
19+
*.env
20+
*.ini
21+
*.cfg
22+
23+
# Ignore IDE and editor settings
24+
.vscode/
25+
.idea/
26+
*.swp
27+
*.swo
28+
29+
# Ignore Git files
30+
.git/
31+
.gitignore
32+
33+
# Ignore Docker files themselves (optional if not needed in the image)
34+
.dockerignore
35+
Dockerfile*
36+
37+
# Ignore build artifacts (if applicable)
38+
build/
39+
dist/
40+
*.egg-info

‎.markdownlint-cli2.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ config:
22
line-length: false
33
no-emphasis-as-header: false
44
first-line-heading: false
5+
MD033:
6+
allowed_elements: ["details", "summary"]
57
globs:
68
- "**/*.md"

‎.pre-commit-config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ repos:
1616
pass_filenames: false
1717
language: system
1818
files: '\.py$'
19+
- repo: local
20+
hooks:
21+
- id: autoflake
22+
name: autoflake
23+
entry: poetry run autoflake docling_serve tests
24+
pass_filenames: false
25+
language: system
26+
files: '\.py$'
1927
- repo: local
2028
hooks:
2129
- id: system

‎Containerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ COPY --chown=1001:0 --chmod=664 ./docling_serve ./docling_serve
5858

5959
EXPOSE 5001
6060

61-
CMD ["uvicorn", "--port", "5001", "--host", "0.0.0.0", "docling_serve.app:app"]
61+
CMD ["python", "-m", "docling_serve"]

‎Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ md-lint-file:
2525
$(CMD_PREFIX) touch .markdown-lint
2626

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.