Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f8489d2
refactor(exchange-oracle): split job_creation into per-task package
zhiltsov-max Jun 30, 2026
b5ada8c
refactor(exchange-oracle): move entrypoints and app factory out of pa…
zhiltsov-max Jun 30, 2026
a28c4e5
Prepare code for manifest version update
zhiltsov-max Jul 1, 2026
1df26e0
Introduce manifest v2
zhiltsov-max Jul 2, 2026
7e3138d
Move TaskTypes to core.tasks
zhiltsov-max Jul 2, 2026
e36e0b9
Make some task creation symbols public
zhiltsov-max Jul 2, 2026
7fb34a7
Update manifest imports for compatibility
zhiltsov-max Jul 2, 2026
f2c2beb
Refactor simple task creation
zhiltsov-max Jul 2, 2026
eab8bba
Factor out task configuration from complex task builders
zhiltsov-max Jul 2, 2026
7ceaca1
Define audio task spec
zhiltsov-max Jul 2, 2026
e566857
Implement audio transcription task builder
zhiltsov-max Jul 3, 2026
6c2cc77
Bump cvat-sdk to 2.69.0
zhiltsov-max Jul 3, 2026
e066ecf
Refine audio task builder: bundling caps, clips subdir, debug dumps
zhiltsov-max Jul 3, 2026
928522c
Fix manifest parsing
zhiltsov-max Jul 6, 2026
d084d7a
Create test assets directory
zhiltsov-max Jul 6, 2026
ab44088
Update cuts location
zhiltsov-max Jul 6, 2026
4fec9c9
Rename completed_escrows to job_completion
zhiltsov-max Jul 6, 2026
56b3530
Refactor job completion handlers, add audio task completion handler
zhiltsov-max Jul 6, 2026
eaff5ab
Add audio transcription export
zhiltsov-max Jul 6, 2026
a0ce8cf
Fix typo
zhiltsov-max Jul 7, 2026
e3b449f
Sync core changes in EO and RO
zhiltsov-max Jul 7, 2026
53ea4ae
Refactor factory placement
zhiltsov-max Jul 7, 2026
f130c69
Refactor validation in RO
zhiltsov-max Jul 7, 2026
5725e0f
add audio qe library
zhiltsov-max Jul 7, 2026
0e97e49
Use TargetMetrics enum for audio target_metric
zhiltsov-max Jul 7, 2026
118bd80
Implement audio transcription quality checker
zhiltsov-max Jul 7, 2026
9592f8b
Set poetry package-mode = false in the CVAT oracle examples
zhiltsov-max Jul 7, 2026
c795091
Move RO entrypoints under src/entrypoints; use in-project venvs
zhiltsov-max Jul 7, 2026
6af734c
Add audio final-result export in the recording oracle
zhiltsov-max Jul 8, 2026
a9f352f
Add gt min span requirement, fix assignment composition, migrate to t…
zhiltsov-max Jul 9, 2026
5269b6f
Use assignment timeouts from manifest
zhiltsov-max Jul 9, 2026
e2082f0
build(exchange-oracle): declare numpy as a direct dependency
zhiltsov-max Jul 9, 2026
ab08288
fix condition
zhiltsov-max Jul 9, 2026
6e67875
feat(cvat-audio): span-based GT honeypots + configurable boundary tol…
zhiltsov-max Jul 9, 2026
7c6ce11
chore(cvat): relock poetry for the audio feature deps
zhiltsov-max Jul 13, 2026
fb050b2
Improve test minio file layout
zhiltsov-max Jul 13, 2026
e59fb72
Revert extra change
zhiltsov-max Jul 13, 2026
59dda0c
Update tests
zhiltsov-max Jul 13, 2026
04a350c
Refactor str enums, format code
zhiltsov-max Jul 14, 2026
2102b7c
fix rebase
zhiltsov-max Jul 14, 2026
a0dde05
remove extra files
zhiltsov-max Jul 14, 2026
0254d27
Fix minio version conflict with boto3, https://github.com/minio/minio…
zhiltsov-max Jul 14, 2026
27ff8b0
Fix tests, add audio task creation tests
zhiltsov-max Jul 14, 2026
c0d8777
cleanup
zhiltsov-max Jul 14, 2026
4aba5b1
test(cvat-audio): add audio task-creation and validation tests
zhiltsov-max Jul 14, 2026
b0f49e5
Change the recommended compose project to avoid dev image clobber
zhiltsov-max Jul 14, 2026
4af197d
Update readme
zhiltsov-max Jul 15, 2026
cbbad7c
Bump cvat sdk
zhiltsov-max Jul 15, 2026
5afa1fc
Sync with cvat sdk changes
zhiltsov-max Jul 15, 2026
9c49ef9
Fix alembic migration autogeneration
zhiltsov-max Jul 15, 2026
1e9fda3
Support getting job bounty from escrow
zhiltsov-max Jul 15, 2026
b115830
Fix formatting
zhiltsov-max Jul 15, 2026
a953cc3
Validate media file paths
zhiltsov-max Jul 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/examples/cvat/exchange-oracle/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/.venv

# Byte-compiled / optimized / DLL files
__pycache__/
.pytest_cache
Expand Down
32 changes: 24 additions & 8 deletions packages/examples/cvat/exchange-oracle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Prerequisites:
```
1. poetry shell
1. poetry config virtualenvs.in-project true # create .venv inside the project so editors/debuggers pick it up
2. poetry install
3. pre-commit install
4. Make sure you have postgres-devel packages installed on your OS. It is required for psycopg2 build phase.
Expand All @@ -30,13 +30,13 @@ docker compose -f docker-compose.dev.yml up -d
./bin/start_debug.sh
```

When running service from `./bin/start_debug.sh` (`debug.py`), simplified development flow is available:
When running service from `./bin/start_debug.sh` (`src/entrypoints/debug.py`), simplified development flow is available:

- When JWT token is required, simple JSON can be used instead of JWT token.
- When webhook signature is required, `{oracle_name}:unique_string` can be used
- You can upload manifest.json to minio `manifests` bucket and use its filename as an escrow_address

### Environemt
### Environment
Env example file: [.env.example](https://github.com/humanprotocol/human-protocol/blob/feat/cvat/exchange-oracle/packages/examples/cvat/exchange-oracle/src/.env.example)

Config: [config file](https://github.com/humanprotocol/human-protocol/blob/feat/cvat/exchange-oracle/packages/examples/cvat/exchange-oracle/src/config.py)
Expand Down Expand Up @@ -76,11 +76,11 @@ Available at `/docs` route
A single command to build, run, and tear down the test suite:

```sh
docker compose -p "test" \
docker compose -p eo-test \
-f docker-compose.test.yml \
-f docker-compose.test.head.yml \
up --build test --attach test --exit-code-from test; \
docker compose -p "test" \
docker compose -p eo-test \
-f docker-compose.test.yml \
-f docker-compose.test.head.yml \
down
Expand All @@ -95,23 +95,39 @@ commands allow running just the services, build, tear down, and run the test sui

```sh
# run services
docker compose -p "test" \
docker compose -p eo-test \
-f docker-compose.test.yml \
up -d --build

# run the tests
docker compose -p "test" \
docker compose -p eo-test \
-f docker-compose.test.yml \
-f docker-compose.test.head.yml \
-f docker-compose.test.head.dev.yml \
up --build test --attach test --exit-code-from test

# tear down
docker compose -p "test" \
docker compose -p eo-test \
-f docker-compose.test.yml \
-f docker-compose.test.head.yml \
-f docker-compose.test.head.dev.yml \
down
```

The dev setup mounts the local directory to speed the things up.

#### Regenerating the test fixtures

Recording Oracle tests run against the fixtures produced by the Exchange Oracle implementation.
Regenerate them whenever the builder output layout or the shared task setups change.

```sh
docker compose -p eo-test \
-f docker-compose.test.yml \
-f docker-compose.test.head.yml \
-f docker-compose.test.head.dev.yml \
run --rm \
-v "$(pwd)/../recording-oracle/tests/assets/cloud/audio_validation:/out" \
test sh -c "alembic upgrade head && PYTHONPATH=. \
python tests/assets/utils/gen_audio_validation_fixture.py /out"
```
6 changes: 1 addition & 5 deletions packages/examples/cvat/exchange-oracle/alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@
disable_existing_loggers=config.attributes.get("disable_existing_loggers", True),
)

import src.models # noqa: E402, F401 (registers all models on Base.metadata for autogenerate)
from src.db import Base # noqa: E402

# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata

target_metadata = Base.metadata

# other values from the config, defined by the needs of env.py,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
add project assignment_bounty

Revision ID: 9884511c7077
Revises: 216af22b5590
Create Date: 2026-07-15 14:31:16.493245

"""

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision = "9884511c7077"
down_revision = "216af22b5590"
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("projects", sa.Column("assignment_bounty", sa.String(), nullable=True))
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("projects", "assignment_bounty")
# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion packages/examples/cvat/exchange-oracle/bin/start_debug.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export ENVIRONMENT=development

alembic upgrade head
python debug.py
python -m src.entrypoints.debug
2 changes: 1 addition & 1 deletion packages/examples/cvat/exchange-oracle/bin/start_dev.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export ENVIRONMENT=development

alembic upgrade head
python run.py
python -m src.entrypoints.run
2 changes: 1 addition & 1 deletion packages/examples/cvat/exchange-oracle/bin/start_prod.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export ENVIRONMENT=production

alembic upgrade head
python run.py
python -m src.entrypoints.run
8 changes: 4 additions & 4 deletions packages/examples/cvat/exchange-oracle/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
ports:
- 6380:6379
networks:
- test-network
- oracle-network

minio:
container_name: minio
Expand All @@ -54,7 +54,7 @@ services:
timeout: 5s
retries: 3
networks:
- test-network
- oracle-network
- cvat-human-bridge

minio-mc:
Expand All @@ -78,15 +78,15 @@ services:
/usr/bin/mc anonymous set public myminio/launcher;
"
networks:
- test-network
- oracle-network

volumes:
postgres:
redis:
minio:

networks:
test-network:
oracle-network:
cvat-human-bridge:
name: cvat-human-bridge
external: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ services:
STORAGE_ENDPOINT_URL: 'host.docker.internal:9000'
STORAGE_ACCESS_KEY: 'dev'
STORAGE_SECRET_KEY: 'devdevdev'
STORAGE_RESULTS_BUCKET_NAME: 'results'
STORAGE_BUCKET_NAME: 'excor-data'
STORAGE_USE_SSL: 'False'
STORAGE_PROVIDER: 'aws'
ENABLE_CUSTOM_CLOUD_HOST: 'Yes'
REDIS_HOST: 'redis'
REDIS_PORT: 6379
depends_on:
postgres:
condition: service_started
Expand Down
17 changes: 8 additions & 9 deletions packages/examples/cvat/exchange-oracle/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ services:
PGDATA: '/var/lib/postgresql/data/pgdata'
networks:
- test-network
ports:
- 5432:5432

redis:
container_name: oracle-redis
Expand All @@ -21,25 +19,24 @@ services:
"--save", "60", "100",
"--appendonly", "yes",
]
ports:
- 6379:6379
networks:
- test-network

minio:
container_name: minio
image: minio/minio:RELEASE.2022-05-26T05-48-41Z
image: quay.io/minio/minio:RELEASE.2025-09-07T16-13-09Z
ports:
- 9001:9001
- 9000:9000
environment:
MINIO_ROOT_USER: dev
MINIO_ROOT_PASSWORD: devdevdev
volumes:
- ./tests/utils/manifest.json:/tmp/manifests/manifest.json
# Each subdirectory under the shared assets dir seeds a same-named bucket.
- ./tests/assets/cloud:/tmp/cloud:ro
entrypoint: 'sh'
command:
-c "mkdir -p /data/manifests && cp /tmp/manifests/manifest.json /data/manifests/manifest.json && minio server /data --console-address ':9001'"
-c "mkdir -p /data && cp -r /tmp/cloud/. /data/ && minio server /data --console-address ':9001'"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
Expand All @@ -57,9 +54,11 @@ services:
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add myminio http://minio:9000 dev devdevdev;
/usr/bin/mc mb -p myminio/datasets myminio/manifests myminio/excor-data myminio/recor-data;
/usr/bin/mc anonymous set public myminio/datasets;
/usr/bin/mc anonymous set public myminio/manifests;
/usr/bin/mc mb myminio/results;
/usr/bin/mc anonymous set public myminio/results;
/usr/bin/mc anonymous set public myminio/excor-data;
/usr/bin/mc anonymous set public myminio/recor-data;
"
networks:
- test-network
Expand Down
Loading
Loading