-
Notifications
You must be signed in to change notification settings - Fork 844
π¦ feat(inspect): Add docker build #3136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ashwinvaidya17
wants to merge
85
commits into
open-edge-platform:feature/geti-inspect
Choose a base branch
from
ashwinvaidya17:ashwin/feature/dockerfile_2
base: feature/geti-inspect
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 82 commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
5bdd704
Initial UI setup for Geti Inspect
MarkRedeman 918ba83
π feat(geti-inspect): add initial backend code (#2930)
maxxgx 82dd6b0
π§ͺ test(get-inspect): add unit tests for endpoints (#2942)
maxxgx 1588d72
Add openapi spec to gitignore
MarkRedeman 22f8f8f
Use error page
MarkRedeman 978a895
Delete nginx and Dockerfile
MarkRedeman cbb0a46
π§ chore(geti-inspect): Update Geti Inspect to react 19 (#2948)
MarkRedeman 644f594
π feat(geti-inspect): add training worker and predict endpoint (#2945)
maxxgx 072ef38
π§ chore(inspect): Add Githbu Action workflows for geti inspect (#2961)
MarkRedeman 0614756
π§ chore(inspect): Update route structure and add openapi route (#2963)
MarkRedeman e07a955
chore: Update package lock (#2967)
dwesolow 61d2481
feat(geti-inspect): add pipelines (#2969)
maxxgx e04ef66
feat: Add sidebar with dataset, models and stats (#2970)
dwesolow 3489422
π feat(inspect): Add dataset list (#2971)
dwesolow 4e160a1
π§ chore(inspect): Update UI scripts (#2974)
dwesolow 7437855
π§ chore(inspect): Configure project(s) mocks for playwright tests (#2β¦
dwesolow 590ece3
π feat(inspect): Add project management (#2977)
dwesolow d9a613d
π§ chore(inspect): Update allowed origins so server can receive requesβ¦
dwesolow 6d51c68
π feat(inspect): Allow user to upload images, train model and displayβ¦
dwesolow 1baa2eb
π§ chore(inspect): Update openapi page (#2985)
dwesolow 0a2af70
π§ chore(inspect): Rename folder structure from app to application (#2β¦
dwesolow 8f1ef19
refactor(inspect): Update photo placeholder to use indicator instead β¦
dwesolow f0339cd
chore(inspect): Improve error and suspense handling in router (#2991)
MarkRedeman 237731d
Fix path (#2993)
ashwinvaidya17 2a4f257
π refactor(inspect): Improvements to the jobs management and trainingβ¦
dwesolow 7653915
π§ chore(inspect): Add more models to be used for training (#2994)
dwesolow f0a7643
π fix(inspect): Use null pool for async engine (#2998)
MarkRedeman df8eb42
π§ chore(inspect): Update uv.lock (#2995)
dwesolow 9fc19c1
π feat(geti-inspect): add trainable models (#3005)
maxxgx 3a446de
π feat(geti-inspect): add thumbnails media endpoint (#3004)
maxxgx a2df1cb
chore(gitattributes): Remove uv.lock LFS entry (#3007)
MarkRedeman dc08cf0
π§ chore(dataset): Use thumnbail suffix to get the dataset items (#3013)
dwesolow b84f44c
π§ chore(inspect): Add dev command to run server and ui concurrently (β¦
dwesolow d63f53d
πrefactor(trainable models): Use trainable models from the server (#3β¦
dwesolow fed89a3
ci(inspect): Exclude application/ for geti-inspect (#3009)
MarkRedeman 390f97f
π fix(geti-inspect): daemon worker error (#3016)
maxxgx f6ae55f
π fix(metrics): disable mps for torch metrics (#3018)
maxxgx 3da55dd
π feat(geti-inspect): add inference device selection (#3011)
maxxgx 42c5541
π§ chore(normal images): Add `Normal images` heading (#3028)
dwesolow 4339b78
π feat(inference): Allow user to select media and get the inference (β¦
dwesolow 931af9c
π§ chore(inference): convert to jet and add opacity (#3029)
ashwinvaidya17 cdeeaff
π feat(inference): Display inference on top of the image + opacity (#β¦
dwesolow 6ddb323
π§ chore(geti-inspect): configure loggers (#3039)
maxxgx be6fe07
chore(inspect): minor UI improvements (#3040)
MarkRedeman 31c3d2f
chore (inspect): improve logs (add uvicorn handler) and add job_id toβ¦
maxxgx 701aca5
feat(inspect): add training device selection (#3056)
maxxgx 6bf1e55
feat(inspect): Add train model dialog, job logs and models dataset (#β¦
MarkRedeman 71ca2c1
chore(inspect): improve SSE generator (#3060)
maxxgx 1d14bf1
bug(inspect): add missing db commit (#3075)
maxxgx dace0f0
Refactor(inspect): sources and sinks under project (#3079)
maxxgx cf91762
feat(inspect): delete media endpoint (#3082)
maxxgx 9096eb7
Merge branch 'main' into feature/geti-inspect
maxxgx 87a1efe
feat(inspect): add, remove list and connect sources (#3078)
camiloHimura 19a3461
chore(inspect): fix pre commit and GHA (#3084)
maxxgx 64fe8ea
feat(inspect): add, remove list and connect sinks (#3087)
camiloHimura 32f527a
π feat(inspect): Add progressbar (#3045)
ashwinvaidya17 1d7b9c7
fix(inspect): fix pipeline conflict (#3090)
maxxgx 1a08bee
chore(inspect): improve openapi spec (#3100)
maxxgx 22aa6df
feat(inspect): Pipeline enable/disable (#3097)
camiloHimura 5008712
feat(inspeect): add alembic migration (#3103)
maxxgx 0500abf
feat(inspect): Inference devices (#3106)
camiloHimura 48365ba
π fix(application): set validation split to synthetic (#3111)
ashwinvaidya17 ab12f0e
feat(inspect): Stream autoplay (#3110)
camiloHimura 12fa1a4
feat(inspect): Device selection in training model dialog (#3094)
ActiveChooN e8476dc
feat(inspect): allow webRTC streaming passthrough (#3114)
maxxgx 0202e60
refactor(inspect): update metrics service to be up to date with Geti β¦
maxxgx 80e459a
feat(inspect): Enable/Disable project (#3117)
camiloHimura bdad999
feat(inspect): add stop pipeline endpoint (#3124)
maxxgx 0b08527
feat(inspect): exported model size (#3126)
ActiveChooN 8adc3a1
feat(inspect): Fix backend job cancellation (#3122)
ActiveChooN 0773110
feat(inspect): Enable/Disable inference (#3127)
camiloHimura 9990aca
feat(inspect): Model deletion endpoint (#3128)
ActiveChooN 5cb2bc6
Add docker files
ashwinvaidya17 a9c5f70
Fix non-root user mounting issues
ashwinvaidya17 09d9f27
feat(inspect): enhance ModelsView (#3135)
ActiveChooN 40c5e5a
Merge branch 'feature/geti-inspect' into ashwin/feature/dockerfile_2
ashwinvaidya17 4d09a21
Update Dockerfile to include g++ and modify CORS settings in main.py β¦
ashwinvaidya17 0a232b8
fix proxy issue
ashwinvaidya17 c7ebce5
cuda build
ashwinvaidya17 ef63ed2
Add XPU build
ashwinvaidya17 f0ef85b
Merge branch 'feature/geti-inspect' into ashwin/feature/dockerfile_2
ashwinvaidya17 c0d3c78
Fix conflicts
ashwinvaidya17 438a499
Comment XPU settings
ashwinvaidya17 70f05fa
Merge branch 'feature/geti-inspect' into ashwin/feature/dockerfile_2
ashwinvaidya17 39209fc
Merge branch 'feature/geti-inspect' into ashwin/feature/dockerfile_2
ashwinvaidya17 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # Git | ||
| .git | ||
| .gitignore | ||
| .gitattributes | ||
|
|
||
| # Python | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
| *.so | ||
| .Python | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
| .pytest_cache/ | ||
| .coverage | ||
| htmlcov/ | ||
| .tox/ | ||
| .nox/ | ||
| .hypothesis/ | ||
|
|
||
| # Virtual environments | ||
| venv/ | ||
| env/ | ||
| ENV/ | ||
| .venv | ||
|
|
||
| # IDEs | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
| .DS_Store | ||
|
|
||
| # Node | ||
| node_modules/ | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Application data (will be mounted as volumes) | ||
| application/backend/data/** | ||
| application/backend/logs/** | ||
| application/backend/openvino_cache/** | ||
| application/backend/tests/** | ||
| application/backend/**/__pycache__/** | ||
| application/backend/.*_cache/** | ||
| application/backend/.tmp/** | ||
| application/backend/.venv/** | ||
| application/ui/dist/ | ||
| application/ui/build/ | ||
| application/ui/node_modules/ | ||
| data/ | ||
|
|
||
| # Documentation and examples | ||
| docs/ | ||
| examples/ | ||
| *.md | ||
| !README.md | ||
|
|
||
| # CI/CD | ||
| .github/ | ||
| .gitlab-ci.yml | ||
| .travis.yml | ||
|
|
||
| # Testing | ||
| tests/ | ||
| *.test.js | ||
| *.spec.js | ||
| coverage/ | ||
|
|
||
| # Temporary files | ||
| tmp/ | ||
| temp/ | ||
| *.tmp | ||
| *.log | ||
|
|
||
| # Datasets and model artifacts | ||
| datasets/ | ||
| pre_trained/ | ||
| results/ | ||
| openvino_cache/ | ||
|
|
||
| # Experiment tracking and logs | ||
| wandb/ | ||
| lightning_logs/ | ||
| mlruns/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -176,3 +176,7 @@ docs/source/_build/ | |
| wandb/ | ||
| lightning_logs/ | ||
| mlruns | ||
|
|
||
| # application data | ||
| data/ | ||
| logs/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| #------------------------------------------ | ||
| # Web UI Build Stage | ||
| #------------------------------------------ | ||
| FROM node:24-alpine3.22@sha256:3e843c608bb5232f39ecb2b25e41214b958b0795914707374c8acc28487dea17 AS web-ui-base | ||
|
|
||
| WORKDIR /home/app/web_ui/ | ||
|
|
||
| COPY --link application/ui/package.json ./package.json | ||
| COPY --link application/ui/package-lock.json ./package-lock.json | ||
| COPY --link application/ui/packages ./packages | ||
| RUN npm ci --audit=false --ignore-scripts | ||
|
|
||
|
|
||
| COPY --link application/ui/tsconfig.json ./tsconfig.json | ||
| COPY --link application/ui/rsbuild.config.ts ./rsbuild.config.ts | ||
| COPY --link application/ui/src ./src | ||
|
|
||
| ENV PUBLIC_API_BASE_URL="" | ||
| ENV PUBLIC_API_BASE_URL=${PUBLIC_API_BASE_URL} | ||
|
|
||
| FROM web-ui-base AS web-ui | ||
|
|
||
|
|
||
| RUN npm run build | ||
|
|
||
|
|
||
| #------------------------------------------ | ||
| # Geti Inspect Base with UI built | ||
| #------------------------------------------ | ||
| FROM python:3.13-slim@sha256:58c30f5bfaa718b5803a53393190b9c68bd517c44c6c94c1b6c8c172bcfad040 AS geti-inspect-base | ||
| COPY --from=docker.io/astral/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 /uv /uvx /bin/ | ||
| ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy | ||
| ENV UV_PYTHON_DOWNLOADS=0 | ||
|
|
||
|
|
||
| # Create non-root user and group | ||
| RUN groupadd --gid 10001 non-root && \ | ||
| useradd --uid 10001 --gid 10001 --create-home --shell /bin/bash non-root | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| libgl1 \ | ||
| libglib2.0-0 \ | ||
| g++ \ | ||
| nginx=1.26.* \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && apt-get clean | ||
|
|
||
| ENV PATH=/app/.venv/bin:$PATH | ||
| WORKDIR /app | ||
| ENV PYTHONPATH=/app | ||
|
|
||
| COPY --chown=non-root:non-root application/.packaging/docker/nginx.conf /etc/nginx/nginx.conf | ||
| COPY --chown=non-root:non-root --from=web-ui /home/app/web_ui/dist /usr/share/nginx/html | ||
|
|
||
| # Copy anomalib source code (pyproject.toml depends on README and LICENSE as well) | ||
| COPY --chown=non-root:non-root src ./src | ||
| COPY --chown=non-root:non-root pyproject.toml uv.lock ./ | ||
| COPY --chown=non-root:non-root LICENSE ./LICENSE | ||
| COPY --chown=non-root:non-root README.md ./README.md | ||
|
|
||
| # Copy backend application | ||
| COPY --chown=non-root:non-root application/backend /app/application/backend | ||
|
|
||
| # Create nginx directories and set ownership for non-root user | ||
| RUN mkdir -p /var/lib/nginx/body /var/lib/nginx/proxy /var/lib/nginx/fastcgi \ | ||
| /var/lib/nginx/uwsgi /var/lib/nginx/scgi /var/run/nginx \ | ||
| && chown -R non-root:non-root /var/lib/nginx /var/run/nginx /var/log/nginx \ | ||
| && chmod -R 755 /var/lib/nginx /var/run/nginx /var/log/nginx | ||
|
|
||
| # Create data and logs directories with write permissions for mounted volumes | ||
| RUN mkdir -p /app/data /app/logs \ | ||
| && chown -R non-root:non-root /app | ||
|
|
||
|
|
||
| #------------------------------------------ | ||
| # Geti Inspect CPU version | ||
| #------------------------------------------ | ||
| FROM geti-inspect-base AS geti-inspect-cpu | ||
| USER non-root | ||
| WORKDIR /app | ||
|
|
||
| RUN --mount=type=cache,target=/home/non-root/.cache/uv,uid=10001,gid=10001 \ | ||
| uv sync --frozen --no-dev --extra cpu --extra application | ||
|
|
||
| EXPOSE 80 | ||
|
|
||
| CMD ["sh", "-c", "nginx && exec geti-inspect"] | ||
|
|
||
| #------------------------------------------ | ||
| # Geti Inspect CUDA version | ||
| #------------------------------------------ | ||
| FROM geti-inspect-base AS geti-inspect-cuda | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends wget=1.25.0-2 \ | ||
| && wget -q https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb \ | ||
| && dpkg -i cuda-keyring_1.1-1_all.deb \ | ||
| && rm -rf cuda-keyring_1.1-1_all.deb \ | ||
| && apt-get remove -y wget | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| cuda-cudart-12-4 \ | ||
| libcublas-12-4 \ | ||
| libcufft-12-4 \ | ||
| libcurand-12-4 \ | ||
| libcusolver-12-4 \ | ||
| libcusparse-12-4 \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && apt-get clean | ||
|
|
||
| USER non-root | ||
| WORKDIR /app | ||
|
|
||
| RUN --mount=type=cache,target=/home/non-root/.cache/uv,uid=10001,gid=10001 \ | ||
| uv sync --frozen --no-dev --extra cu124 --extra application | ||
|
|
||
| EXPOSE 80 | ||
|
|
||
| CMD ["sh", "-c", "nginx && exec geti-inspect"] | ||
|
|
||
| #------------------------------------------ | ||
| # Geti Inspect XPU version | ||
| #------------------------------------------ | ||
| FROM geti-inspect-base AS geti-inspect-xpu | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends wget gpg \ | ||
| && wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \ | ||
| gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg \ | ||
| && echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy unified" | \ | ||
| tee /etc/apt/sources.list.d/intel-gpu-jammy.list \ | ||
| && apt-get update \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| libze-intel-gpu1 \ | ||
| libze1 \ | ||
| intel-opencl-icd \ | ||
| clinfo \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && apt-get remove -y wget gpg \ | ||
| && apt-get clean | ||
|
|
||
| RUN groupadd -f render && usermod -aG render non-root | ||
|
|
||
| USER non-root | ||
| WORKDIR /app | ||
|
|
||
| RUN --mount=type=cache,target=/home/non-root/.cache/uv,uid=10001,gid=10001 \ | ||
| uv sync --frozen --no-dev --extra xpu --extra application | ||
|
|
||
| EXPOSE 80 | ||
|
|
||
| CMD ["sh", "-c", "nginx && exec geti-inspect"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Docker distribution for Geti Inspect | ||
|
|
||
| ## To create CPU build | ||
|
|
||
| ```bash | ||
| cd application/.packaging/docker | ||
| docker compose up | ||
| ``` | ||
|
|
||
| ## To create XPU build | ||
|
|
||
| > [!NOTE] | ||
| > You need to first set the `RENDER_GROUP_ID` environment variable to match your host system's render group ID. | ||
|
|
||
| ```bash | ||
| cd application/.packaging/docker | ||
| RENDER_GROUP_ID=$(getent group render | cut -d: -f3) AI_DEVICE=xpu docker compose up | ||
| ``` | ||
|
|
||
| ## To create CUDA build | ||
|
|
||
| > [!NOTE] | ||
| > You need to uncomment the `deploy:` section in the `docker-compose.yml` file to enable GPU support. | ||
ashwinvaidya17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| cd application/.packaging/docker | ||
| AI_DEVICE=cuda docker compose up | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| x-proxy-list: &proxy-list | ||
| - HTTP_PROXY=${HTTP_PROXY} | ||
| - HTTPS_PROXY=${HTTPS_PROXY} | ||
| - NO_PROXY=${NO_PROXY} | ||
| - http_proxy=${http_proxy} | ||
| - https_proxy=${https_proxy} | ||
| - no_proxy=${no_proxy} | ||
|
|
||
| x-proxies: &proxies | ||
| args: *proxy-list | ||
|
|
||
| services: | ||
| geti-inspect: | ||
| image: geti-inspect-${AI_DEVICE:-cpu}:${TAG:-latest} | ||
| environment: *proxy-list | ||
| restart: unless-stopped | ||
| build: | ||
| # Use root directory as context to build the image | ||
| context: ../../.. | ||
| dockerfile: application/.packaging/docker/Dockerfile | ||
| target: geti-inspect-${AI_DEVICE:-cpu} | ||
| <<: *proxies | ||
| working_dir: /app | ||
| container_name: geti-inspect-${AI_DEVICE:-cpu} | ||
| group_add: | ||
| - "${RENDER_GROUP_ID}" # This is needed to allow access to the 'render' group for torch XPU support | ||
| volumes: | ||
| # Persist database and uploaded data | ||
| - backend-data:/app/data | ||
| # Persist logs | ||
| - backend-logs:/app/logs | ||
| ports: | ||
| - "80:80" | ||
Check warningCode scanning / Semgrep OSS Semgrep Finding: trailofbits.yaml.docker-compose.port-all-interfaces.port-all-interfaces Warning
Service port is exposed on all interfaces
|
||
| # Increase file descriptor limits | ||
| ulimits: | ||
| nofile: | ||
| soft: 65536 | ||
| hard: 65536 | ||
| # Uncomment the following lines to enable GPU support (NVIDIA GPUs only) | ||
| # deploy: | ||
| # resources: | ||
| # reservations: | ||
| # devices: | ||
| # - driver: nvidia | ||
ashwinvaidya17 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # count: all | ||
| # capabilities: [gpu] | ||
| # Map all host devices to provide access to webcams and other attached devices | ||
| privileged: true | ||
| devices: | ||
| - /dev:/dev | ||
|
|
||
| volumes: | ||
| backend-data: | ||
| driver: local | ||
| backend-logs: | ||
| driver: local | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why run uv sync from the root anomalib folder instead of application?
Installing inspect as an extra might be useful during development but I don't see the value in production environments