Skip to content

Commit 438aaca

Browse files
authored
[CVAT] Bump oracle deps (#3973)
1 parent b60b89a commit 438aaca

215 files changed

Lines changed: 20443 additions & 11417 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/examples/cvat/exchange-oracle/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/.venv
2+
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
.pytest_cache

packages/examples/cvat/exchange-oracle/README.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

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

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

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

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

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

7878
```sh
79-
docker compose -p "test" \
79+
docker compose -p eo-test \
8080
-f docker-compose.test.yml \
8181
-f docker-compose.test.head.yml \
8282
up --build test --attach test --exit-code-from test; \
83-
docker compose -p "test" \
83+
docker compose -p eo-test \
8484
-f docker-compose.test.yml \
8585
-f docker-compose.test.head.yml \
8686
down
@@ -95,23 +95,39 @@ commands allow running just the services, build, tear down, and run the test sui
9595

9696
```sh
9797
# run services
98-
docker compose -p "test" \
98+
docker compose -p eo-test \
9999
-f docker-compose.test.yml \
100100
up -d --build
101101

102102
# run the tests
103-
docker compose -p "test" \
103+
docker compose -p eo-test \
104104
-f docker-compose.test.yml \
105105
-f docker-compose.test.head.yml \
106106
-f docker-compose.test.head.dev.yml \
107107
up --build test --attach test --exit-code-from test
108108

109109
# tear down
110-
docker compose -p "test" \
110+
docker compose -p eo-test \
111111
-f docker-compose.test.yml \
112112
-f docker-compose.test.head.yml \
113113
-f docker-compose.test.head.dev.yml \
114114
down
115115
```
116116

117117
The dev setup mounts the local directory to speed the things up.
118+
119+
#### Regenerating the test fixtures
120+
121+
Recording Oracle tests run against the fixtures produced by the Exchange Oracle implementation.
122+
Regenerate them whenever the builder output layout or the shared task setups change.
123+
124+
```sh
125+
docker compose -p eo-test \
126+
-f docker-compose.test.yml \
127+
-f docker-compose.test.head.yml \
128+
-f docker-compose.test.head.dev.yml \
129+
run --rm \
130+
-v "$(pwd)/../recording-oracle/tests/assets/cloud/audio_validation:/out" \
131+
test sh -c "alembic upgrade head && PYTHONPATH=. \
132+
python tests/assets/utils/gen_audio_validation_fixture.py /out"
133+
```

packages/examples/cvat/exchange-oracle/alembic.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ file_template = %%(epoch)d_%%(slug)s_%%(rev)s
1515
# defaults to the current working directory.
1616
prepend_sys_path = .
1717

18+
# path separator (os = os.pathsep) used to split prepend_sys_path and version_locations;
19+
# the unified key introduced in alembic 1.16, replacing version_path_separator.
20+
path_separator = os
21+
1822
# timezone to use when rendering the date within the migration file
1923
# as well as the filename.
2024
# If specified, requires the python-dateutil library that can be

packages/examples/cvat/exchange-oracle/alembic/env.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@
1818
disable_existing_loggers=config.attributes.get("disable_existing_loggers", True),
1919
)
2020

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

23-
# add your model's MetaData object here
24-
# for 'autogenerate' support
25-
# from myapp import mymodel
26-
# target_metadata = mymodel.Base.metadata
27-
2824
target_metadata = Base.metadata
2925

3026
# other values from the config, defined by the needs of env.py,
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""
2+
add project assignment_bounty
3+
4+
Revision ID: 9884511c7077
5+
Revises: 216af22b5590
6+
Create Date: 2026-07-15 14:31:16.493245
7+
8+
"""
9+
10+
import sqlalchemy as sa
11+
12+
from alembic import op
13+
14+
# revision identifiers, used by Alembic.
15+
revision = "9884511c7077"
16+
down_revision = "216af22b5590"
17+
branch_labels = None
18+
depends_on = None
19+
20+
21+
def upgrade() -> None:
22+
# ### commands auto generated by Alembic - please adjust! ###
23+
op.add_column("projects", sa.Column("assignment_bounty", sa.String(), nullable=True))
24+
# ### end Alembic commands ###
25+
26+
27+
def downgrade() -> None:
28+
# ### commands auto generated by Alembic - please adjust! ###
29+
op.drop_column("projects", "assignment_bounty")
30+
# ### end Alembic commands ###
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export ENVIRONMENT=development
22

33
alembic upgrade head
4-
python debug.py
4+
python -m src.entrypoints.debug
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export ENVIRONMENT=development
22

33
alembic upgrade head
4-
python run.py
4+
python -m src.entrypoints.run
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export ENVIRONMENT=production
22

33
alembic upgrade head
4-
python run.py
4+
python -m src.entrypoints.run

packages/examples/cvat/exchange-oracle/docker-compose.dev.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ services:
3232
ports:
3333
- 6380:6379
3434
networks:
35-
- test-network
35+
- oracle-network
3636

3737
minio:
3838
container_name: minio
39-
image: minio/minio:RELEASE.2022-05-26T05-48-41Z
39+
image: minio/minio:RELEASE.2025-09-07T16-13-09Z
4040
environment:
4141
MINIO_ROOT_USER: dev
4242
MINIO_ROOT_PASSWORD: devdevdev
@@ -54,7 +54,7 @@ services:
5454
timeout: 5s
5555
retries: 3
5656
networks:
57-
- test-network
57+
- oracle-network
5858
- cvat-human-bridge
5959

6060
minio-mc:
@@ -78,15 +78,15 @@ services:
7878
/usr/bin/mc anonymous set public myminio/launcher;
7979
"
8080
networks:
81-
- test-network
81+
- oracle-network
8282

8383
volumes:
8484
postgres:
8585
redis:
8686
minio:
8787

8888
networks:
89-
test-network:
89+
oracle-network:
9090
cvat-human-bridge:
9191
name: cvat-human-bridge
9292
external: true

packages/examples/cvat/exchange-oracle/docker-compose.test.head.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ services:
1515
STORAGE_ENDPOINT_URL: 'host.docker.internal:9000'
1616
STORAGE_ACCESS_KEY: 'dev'
1717
STORAGE_SECRET_KEY: 'devdevdev'
18-
STORAGE_RESULTS_BUCKET_NAME: 'results'
18+
STORAGE_BUCKET_NAME: 'excor-data'
1919
STORAGE_USE_SSL: 'False'
2020
STORAGE_PROVIDER: 'aws'
2121
ENABLE_CUSTOM_CLOUD_HOST: 'Yes'
2222
REDIS_HOST: 'redis'
23+
REDIS_PORT: 6379
2324
depends_on:
2425
postgres:
2526
condition: service_started

0 commit comments

Comments
 (0)