-
Notifications
You must be signed in to change notification settings - Fork 462
E2E infra #4875
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
base: develop
Are you sure you want to change the base?
E2E infra #4875
Changes from all commits
234b4ab
edd819a
bd24a18
5ff4e6a
6ae5020
aee8012
81219e2
d8b9a64
fee2651
964a74b
c8fecac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,6 +126,8 @@ jobs: | |
|
||
- name: Build UI | ||
working-directory: "application/ui" | ||
env: | ||
PUBLIC_API_BASE_URL: "" | ||
run: npm run build | ||
|
||
- name: Compress build | ||
|
@@ -353,84 +355,64 @@ jobs: | |
path: application/ui/playwright-report/ | ||
retention-days: 30 | ||
|
||
# e2e-tests: | ||
# name: E2E Tests | ||
# needs: | ||
# - check_paths | ||
# - build | ||
# - generate-openapi-spec | ||
# if: needs.check_paths.outputs.run_workflow == 'true' | ||
# permissions: | ||
# contents: read | ||
# timeout-minutes: 30 | ||
# runs-on: ubuntu-latest | ||
# container: | ||
# image: mcr.microsoft.com/playwright:v1.54.0-noble@sha256:18d6adb6aaccf1b0f30eba890069972e089138e4a59ddb5303d7e7290e4e38b6 | ||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
# with: | ||
# persist-credentials: false | ||
|
||
# - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 | ||
# with: | ||
# node-version-file: application/ui/.nvmrc | ||
|
||
# - name: Set up Python | ||
# uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | ||
# with: | ||
# python-version: "3.13" | ||
|
||
# - name: Install uv | ||
# uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0 | ||
# with: | ||
# version: "0.8.8" | ||
# enable-cache: false | ||
|
||
# - name: Install OpenCV dependencies | ||
# run: | | ||
# apt-get update | ||
# apt-get install -y libgl1 libglib2.0-0 | ||
|
||
# - name: Setup Backend | ||
# working-directory: application/backend | ||
# run: | | ||
# uv sync --frozen --all-extras | ||
|
||
# - name: Download UI build | ||
# uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | ||
# with: | ||
# name: ui-dist | ||
# path: application/ui | ||
|
||
# - name: Download OpenAPI spec | ||
# uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | ||
# with: | ||
# name: openapi-spec | ||
# path: application/ui/src/api | ||
|
||
# - name: Unpack build | ||
# working-directory: "application/ui" | ||
# run: tar -xzf dist.tar.gz | ||
|
||
# - name: Install dependencies | ||
# working-directory: "application/ui" | ||
# run: npm ci | ||
|
||
# - name: Build OpenAPI type definitions | ||
# working-directory: "application/ui" | ||
# run: npm run build:api | ||
|
||
# - name: Run E2E tests | ||
# working-directory: application/ui | ||
# run: npm run test:e2e | ||
|
||
# - name: Upload E2E results | ||
# uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
# if: always() | ||
# with: | ||
# name: e2e-test-results | ||
# path: application/ui/playwright-report/ | ||
e2e-tests: | ||
name: E2E Tests | ||
needs: | ||
- check_paths | ||
- build | ||
- generate-openapi-spec | ||
if: needs.check_paths.outputs.run_workflow == 'true' | ||
permissions: | ||
contents: read | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Download UI build | ||
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | ||
with: | ||
name: ui-dist | ||
path: application/ui | ||
|
||
- name: Unpack build | ||
working-directory: application/ui | ||
run: tar -xzf dist.tar.gz | ||
|
||
- name: Install dependencies | ||
working-directory: application/ui | ||
run: npm ci | ||
Comment on lines
+370
to
+387
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All this is unnecessary imho. We already have a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree |
||
|
||
- name: Run E2E tests with Docker Compose | ||
working-directory: application/docker | ||
env: | ||
E2E_ASSETS_S3_URL: ${{ vars.E2E_ASSETS_S3_URL }} | ||
run: | | ||
docker compose --profile e2e up \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the important change is this one. |
||
--abort-on-container-exit \ | ||
--exit-code-from playwright-e2e | ||
|
||
- name: Copy test results from container | ||
if: always() | ||
working-directory: application/docker | ||
run: | | ||
# Results are already mounted, just ensure they're visible | ||
ls -la ../ui/playwright-report/ || true | ||
|
||
- name: Upload E2E results | ||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
if: always() | ||
with: | ||
name: e2e-test-results | ||
path: application/ui/playwright-report/ | ||
|
||
- name: Cleanup | ||
if: always() | ||
working-directory: application/docker | ||
run: docker compose --profile e2e down -v | ||
|
||
required_check: | ||
name: Required Check ui-lint-and-test | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
# Backend files | ||
!backend/app | ||
!backend/run.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because we need to copy this bad boy now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, we shouldn't copy it. Can you motivate the need for the copy? |
||
!backend/pyproject.toml | ||
!backend/uv.lock | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the current pace of development, I'm afraid this |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,103 @@ | ||
# Geti Tune | ||
|
||
Geti Tune is a full-stack application for efficiently fine-tuning state-of-the-art computer vision models for tasks like classification, detection, and segmentation. | ||
|
||
## Quick Start | ||
|
||
### Basic Usage | ||
|
||
```bash | ||
# Start the server (development mode) | ||
./run.sh | ||
``` | ||
|
||
### E2E Testing Setup | ||
|
||
```bash | ||
# Full E2E setup with database seeding and test file downloads | ||
DATABASE_FILE=geti_tune_e2e.db SEED_DB=true DOWNLOAD_FILES=true ./run.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just wondering why a db_file name should be different for e2e tests setup? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The goal was to also be able to run these locally, and since some tests require seeding, we need a temporary DB that we can setup/destroy after every run |
||
|
||
## Configuration | ||
|
||
### What `run.sh` Does | ||
|
||
1. **Loads configuration** from environment variables | ||
2. **Seeds database** (if `SEED_DB=true`): | ||
- Creates a test project with labels | ||
- Sets up pipeline with video source and model | ||
3. **Downloads test files** (if `DOWNLOAD_FILES=true`): | ||
- Test video: `data/media/video.mp4` | ||
- Model files: `data/projects/.../model.xml` and `model.bin` | ||
4. **Starts the FastAPI server** on `http://localhost:7860` | ||
|
||
### Test Assets | ||
|
||
By default, test assets are downloaded from a public URL. In CI/GitHub Actions, a repository variable `E2E_ASSETS_S3_URL` can be set to use a private asset location. | ||
|
||
## Docker | ||
|
||
The backend can also run in Docker: | ||
|
||
```bash | ||
cd ../docker | ||
# Build and run E2E backend | ||
docker compose --profile e2e up backend-e2e | ||
# Or run full E2E stack | ||
docker compose --profile e2e up --abort-on-container-exit | ||
``` | ||
|
||
The Docker setup uses the same `run.sh` script for consistency. | ||
|
||
## API Documentation | ||
|
||
Once the server is running, visit: | ||
- http://localhost:7860/docs | ||
|
||
## Development | ||
|
||
### Requirements | ||
|
||
- Python 3.13+ | ||
- `uv` CLI tool for dependency management | ||
- SQLite (included with Python) | ||
|
||
### Project Structure | ||
|
||
``` | ||
backend/ | ||
├── app/ | ||
│ ├── main.py # FastAPI application entry point | ||
│ ├── cli.py # CLI commands (init-db, seed) | ||
│ ├── api/ # API endpoints | ||
│ ├── core/ # Core functionality (scheduler, lifecycle) | ||
│ ├── db/ # Database models and migrations | ||
│ ├── entities/ # Business logic entities | ||
│ ├── repositories/ # Data access layer | ||
│ ├── schemas/ # Pydantic schemas | ||
│ ├── services/ # Business logic services | ||
│ ├── webrtc/ # WebRTC streaming | ||
│ └── workers/ # Background workers | ||
├── data/ # Runtime data (database, media, models) | ||
├── run.sh # Main startup script | ||
``` | ||
## Troubleshooting | ||
### Port already in use | ||
```bash | ||
lsof -ti:7860 | xargs kill -9 | ||
``` | ||
|
||
### Database locked | ||
|
||
```bash | ||
rm data/geti_tune.db | ||
./run.sh | ||
``` | ||
|
||
### Test file download fails | ||
|
||
Check that `E2E_ASSETS_S3_URL` is accessible or verify the public URL is working. The script will exit with an error if downloads fail. |
Uh oh!
There was an error while loading. Please reload this page.
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.
to avoid setting
http://localhost:7680/api/...
to our baseUrl, so the UI use relative urls