Skip to content

Commit 54be039

Browse files
authored
Add OTX dependency to Geti Tune app (#4977)
1 parent 8eca129 commit 54be039

File tree

5 files changed

+2538
-179
lines changed

5 files changed

+2538
-179
lines changed

.github/workflows/backend-lint-and-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
- name: Install uv
7575
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
7676
with:
77-
version: "0.8.8"
77+
version: "0.9.7"
7878
enable-cache: false
7979

8080
- name: Install OpenCV dependencies
@@ -88,7 +88,7 @@ jobs:
8888
working-directory: application/backend
8989
run: |
9090
uv lock --check
91-
uv sync --frozen --all-extras
91+
uv sync --frozen --extra cpu --extra mqtt
9292
9393
- name: Check formatting with ruff
9494
working-directory: application/backend

.github/workflows/ui-lint-and-test.yaml

Lines changed: 2 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
- name: Install uv
7878
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
7979
with:
80-
version: "0.8.8"
80+
version: "0.9.7"
8181
enable-cache: false
8282

8383
- name: Install OpenCV dependencies
@@ -89,7 +89,7 @@ jobs:
8989
working-directory: application/backend
9090
run: |
9191
uv lock --check
92-
uv sync --frozen --all-extras
92+
uv sync --frozen --extra cpu
9393
9494
- name: Get OpenAPI spec
9595
working-directory: application/backend
@@ -353,85 +353,6 @@ jobs:
353353
path: application/ui/playwright-report/
354354
retention-days: 30
355355

356-
# e2e-tests:
357-
# name: E2E Tests
358-
# needs:
359-
# - check_paths
360-
# - build
361-
# - generate-openapi-spec
362-
# if: needs.check_paths.outputs.run_workflow == 'true'
363-
# permissions:
364-
# contents: read
365-
# timeout-minutes: 30
366-
# runs-on: ubuntu-latest
367-
# container:
368-
# image: mcr.microsoft.com/playwright:v1.54.0-noble@sha256:18d6adb6aaccf1b0f30eba890069972e089138e4a59ddb5303d7e7290e4e38b6
369-
# steps:
370-
# - name: Checkout code
371-
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
372-
# with:
373-
# persist-credentials: false
374-
375-
# - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
376-
# with:
377-
# node-version-file: application/ui/.nvmrc
378-
379-
# - name: Set up Python
380-
# uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
381-
# with:
382-
# python-version: "3.13"
383-
384-
# - name: Install uv
385-
# uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
386-
# with:
387-
# version: "0.8.8"
388-
# enable-cache: false
389-
390-
# - name: Install OpenCV dependencies
391-
# run: |
392-
# apt-get update
393-
# apt-get install -y libgl1 libglib2.0-0
394-
395-
# - name: Setup Backend
396-
# working-directory: application/backend
397-
# run: |
398-
# uv sync --frozen --all-extras
399-
400-
# - name: Download UI build
401-
# uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
402-
# with:
403-
# name: ui-dist
404-
# path: application/ui
405-
406-
# - name: Download OpenAPI spec
407-
# uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
408-
# with:
409-
# name: openapi-spec
410-
# path: application/ui/src/api
411-
412-
# - name: Unpack build
413-
# working-directory: "application/ui"
414-
# run: tar -xzf dist.tar.gz
415-
416-
# - name: Install dependencies
417-
# working-directory: "application/ui"
418-
# run: npm ci
419-
420-
# - name: Build OpenAPI type definitions
421-
# working-directory: "application/ui"
422-
# run: npm run build:api
423-
424-
# - name: Run E2E tests
425-
# working-directory: application/ui
426-
# run: npm run test:e2e
427-
428-
# - name: Upload E2E results
429-
# uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
430-
# if: always()
431-
# with:
432-
# name: e2e-test-results
433-
# path: application/ui/playwright-report/
434-
435356
required_check:
436357
name: Required Check ui-lint-and-test
437358
needs:
@@ -441,7 +362,6 @@ jobs:
441362
- lint
442363
- unit-tests
443364
- playwright-tests
444-
# - e2e-tests
445365
runs-on: ubuntu-latest
446366
env:
447367
CHECKS: ${{ join(needs.*.result, ' ') }}

application/backend/pyproject.toml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ dependencies = [
2828
]
2929

3030
[project.optional-dependencies]
31+
# Choose one of the following training backends:
32+
# - cpu: only CPU training (no GPU support)
33+
# - xpu: support training on compatible Intel GPUs
34+
# - cuda: support training on compatible NVIDIA GPUs
35+
cpu = ["otx[cpu]"]
36+
xpu = ["otx[xpu]"]
37+
cuda = ["otx[cuda]"]
38+
3139
mqtt = [
3240
"paho-mqtt~=2.1.0",
3341
]
@@ -42,19 +50,38 @@ dev = [
4250
]
4351
lint = [
4452
"ruff==0.9.3",
45-
"mypy~=1.17",
53+
"mypy~=1.16.1",
4654
"types-PyYAML~=6.0.12",
4755
"types-requests~=2.32.4",
4856
]
4957

5058
[tool.uv]
51-
default-groups = "all"
52-
required-version = "~=0.8.8"
59+
default-groups = ["dev", "lint"]
60+
required-version = "~=0.9.7"
61+
conflicts = [
62+
[
63+
{ extra = "cpu" },
64+
{ extra = "xpu" },
65+
{ extra = "cuda" },
66+
],
67+
# redeclare library conflicts to workaround bug with uv dependency resolution
68+
# For details, see: https://github.com/astral-sh/uv/issues/9942
69+
[
70+
{ package = "otx", extra = "cpu" },
71+
{ package = "otx", extra = "xpu" },
72+
{ package = "otx", extra = "cuda" },
73+
],
74+
]
5375

5476
[tool.uv.build-backend]
5577
module-root = ""
5678
module-name = "app"
5779

80+
[tool.uv.sources]
81+
# TODO switch to local path after the 'feature/datumaro' branch is merged to develop
82+
# otx = { path = "../../library", editable = true }
83+
otx = { git = "https://github.com/open-edge-platform/training_extensions.git", branch = "feature/datumaro", subdirectory = "library" }
84+
5885
[tool.ruff]
5986
target-version = "py313"
6087
line-length = 120

0 commit comments

Comments
 (0)