Skip to content

Commit 7122809

Browse files
committed
[Exchange Oracle] Move cvat timeout settings to cvat config, update .env template
1 parent 4d7683d commit 7122809

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

packages/examples/cvat/exchange-oracle/src/.env.template

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ CVAT_ADMIN_USER_ID=
6969
CVAT_INCOMING_WEBHOOKS_URL=
7070
CVAT_WEBHOOK_SECRET=
7171
CVAT_ORG_SLUG=
72+
CVAT_TASK_SEGMENT_SIZE=
73+
CVAT_MAX_JOBS_PER_TASK=
74+
CVAT_TASK_CREATION_CHECK_INTERVAL=
75+
CVAT_MAX_VALIDATION_CHECKS=
76+
CVAT_IOU_THRESHOLD=
77+
CVAT_OKS_SIGMA=
78+
CVAT_EXPORT_TIMEOUT=
79+
CVAT_IMPORT_TIMEOUT=
7280

7381
# Storage Config (S3/GCS)
7482

@@ -84,6 +92,7 @@ STORAGE_USE_SSL=
8492
# Features
8593

8694
ENABLE_CUSTOM_CLOUD_HOST=
95+
REQUEST_LOGGING_ENABLED=
8796

8897
# Core
8998

@@ -105,6 +114,7 @@ DEFAULT_API_PAGE_SIZE=
105114
LOCALHOST_RECORDING_ORACLE_ADDRESS=
106115
LOCALHOST_RECORDING_ORACLE_URL=
107116
LOCALHOST_JOB_LAUNCHER_URL=
117+
LOCALHOST_REPUTATION_ORACLE_ADDRESS=
108118
LOCALHOST_REPUTATION_ORACLE_URL=
109119

110120
# Encryption

packages/examples/cvat/exchange-oracle/src/core/config.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class CronConfig:
170170

171171

172172
class CvatConfig:
173-
# TODO: it looks odd to use cvat_ prefix in class attributes inside CvatConfig
173+
# TODO: remove cvat_ prefix
174174
cvat_url = os.environ.get("CVAT_URL", "http://localhost:8080")
175175
cvat_admin = os.environ.get("CVAT_ADMIN", "admin")
176176
cvat_admin_pass = os.environ.get("CVAT_ADMIN_PASS", "admin")
@@ -182,6 +182,12 @@ class CvatConfig:
182182
cvat_max_jobs_per_task = int(os.environ.get("CVAT_MAX_JOBS_PER_TASK", 10 * 1000))
183183
cvat_task_creation_check_interval = int(os.environ.get("CVAT_TASK_CREATION_CHECK_INTERVAL", 5))
184184

185+
cvat_export_timeout = int(os.environ.get("CVAT_EXPORT_TIMEOUT", 5 * 60))
186+
"Timeout, in seconds, for annotations or dataset export waiting"
187+
188+
cvat_import_timeout = int(os.environ.get("CVAT_IMPORT_TIMEOUT", 60 * 60))
189+
"Timeout, in seconds, for waiting on GT annotations import"
190+
185191
# quality control settings
186192
cvat_max_validation_checks = int(os.environ.get("CVAT_MAX_VALIDATION_CHECKS", 3))
187193
"Maximum number of attempts to run a validation check on a job after completing annotation"
@@ -233,12 +239,6 @@ class FeaturesConfig:
233239
enable_custom_cloud_host = to_bool(os.environ.get("ENABLE_CUSTOM_CLOUD_HOST", "no"))
234240
"Allows using a custom host in manifest bucket urls"
235241

236-
default_export_timeout = int(os.environ.get("DEFAULT_EXPORT_TIMEOUT", 60))
237-
"Timeout, in seconds, for annotations or dataset export waiting"
238-
239-
default_import_timeout = int(os.environ.get("DEFAULT_IMPORT_TIMEOUT", 60 * 60))
240-
"Timeout, in seconds, for waiting on GT annotations import"
241-
242242
request_logging_enabled = to_bool(os.getenv("REQUEST_LOGGING_ENABLED", "0"))
243243
"Allow to log request details for each request"
244244

packages/examples/cvat/exchange-oracle/src/cvat/api_calls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _get_annotations(
7777
time_begin = utcnow()
7878

7979
if timeout is _NOTSET:
80-
timeout = Config.features.default_export_timeout
80+
timeout = Config.cvat_config.cvat_export_timeout
8181

8282
while True:
8383
(_, response) = endpoint.call_with_http_info(
@@ -641,7 +641,7 @@ def upload_gt_annotations(
641641
*,
642642
format_name: str,
643643
sleep_interval: int = 5,
644-
timeout: int | None = Config.features.default_import_timeout,
644+
timeout: int | None = Config.cvat_config.cvat_import_timeout,
645645
) -> None:
646646
# FUTURE-TODO: use job.import_annotations when CVAT supports a waiting timeout
647647
start_time = datetime.now(timezone.utc)

0 commit comments

Comments
 (0)