UWSConfig¶
- class safir.uws.UWSConfig(arq_mode, arq_redis_settings, async_post_route, execution_duration, job_summary_type, lifetime, parameters_type, signing_service_account, wobbly_url, worker, slack_webhook=None, sync_get_route=None, sync_post_route=None, sync_timeout=datetime.timedelta(seconds=300), url_lifetime=datetime.timedelta(seconds=900), validate_destruction=None, validate_execution_duration=None, wait_timeout=datetime.timedelta(seconds=60))¶
Bases:
object
Configuration for the UWS service.
The UWS service may be embedded in a variety of VO applications. This class encapsulates the configuration of the UWS component that may vary by service or specific installation.
- Parameters:
arq_mode (
ArqMode
)arq_redis_settings (
RedisSettings
)async_post_route (
UWSRoute
)execution_duration (
timedelta
)job_summary_type (
type
[JobSummary
])lifetime (
timedelta
)parameters_type (
type
[ParametersModel
])signing_service_account (
str
)wobbly_url (
str
|HttpUrl
)worker (
str
)slack_webhook (
SecretStr
|None
, default:None
)sync_timeout (
timedelta
, default:datetime.timedelta(seconds=300)
)url_lifetime (
timedelta
, default:datetime.timedelta(seconds=900)
)validate_destruction (
TypeAliasType
|None
, default:None
)validate_execution_duration (
TypeAliasType
|None
, default:None
)wait_timeout (
timedelta
, default:datetime.timedelta(seconds=60)
)
Attributes Summary
What mode to use for the arq queue.
Settings for Redis for the arq queue.
Route configuration for creating an async job via POST.
Maximum execution time in seconds.
Type representing the parameter-qualified job summary type.
The lifetime of jobs.
Type representing the job parameters.
Email of service account to use for signed URLs.
Slack incoming webhook for reporting errors.
Route configuration for creating a sync job via GET.
Route configuration for creating a sync job via POST.
Maximum lifetime of a sync request.
How long result URLs should be valid for.
Validate a new destruction time for a job.
Validate a new execution duration for a job.
Maximum time a client can wait for a job change.
URL to the Wobbly UWS job tracking API.
Name of the backend worker to call to execute a job.
Attributes Documentation
-
arq_redis_settings:
RedisSettings
= <dataclasses._MISSING_TYPE object>¶ Settings for Redis for the arq queue.
-
async_post_route:
UWSRoute
= <dataclasses._MISSING_TYPE object>¶ Route configuration for creating an async job via POST.
The FastAPI dependency included in this object should expect POST parameters and return the Pydantic model of the job parameters.
-
execution_duration:
timedelta
= <dataclasses._MISSING_TYPE object>¶ Maximum execution time in seconds.
Jobs that run longer than this length of time will be automatically aborted.
-
job_summary_type:
type
[JobSummary
] = <dataclasses._MISSING_TYPE object>¶ Type representing the parameter-qualified job summary type.
Must be set to
JobSummary
qualified with the appropriate subclass ofParameters
. This is necessary to work around limitations in pydantic-xml, which require the types to be known at class instantiation time.
-
lifetime:
timedelta
= <dataclasses._MISSING_TYPE object>¶ The lifetime of jobs.
After this much time elapses since the creation of the job, all of the results from the job will be cleaned up and all record of the job will be deleted.
-
parameters_type:
type
[ParametersModel
] = <dataclasses._MISSING_TYPE object>¶ Type representing the job parameters.
This will be used to validate parameters and to parse them before passing them to the worker.
-
signing_service_account:
str
= <dataclasses._MISSING_TYPE object>¶ Email of service account to use for signed URLs.
The default credentials that the application frontend runs with must have the
roles/iam.serviceAccountTokenCreator
role on the service account with this email.
-
sync_get_route:
UWSRoute
|None
= None¶ Route configuration for creating a sync job via GET.
The FastAPI dependency included in this object should expect GET parameters and the Pydantic model of the job parameters. If
None
, no route to create a job via sync GET will be created.
-
sync_post_route:
UWSRoute
|None
= None¶ Route configuration for creating a sync job via POST.
The FastAPI dependency included in this object should expect POST parameters and return the Pydantic model of the job parameters. If
None
, no route to create a job via sync POST will be created.
-
url_lifetime:
timedelta
= datetime.timedelta(seconds=900)¶ How long result URLs should be valid for.
-
validate_destruction:
TypeAliasType
|None
= None¶ Validate a new destruction time for a job.
If provided, called with the requested destruction time and the current job record and should return the new destruction time. Otherwise, any destruction time before the configured maximum lifetime will be allowed.
-
validate_execution_duration:
TypeAliasType
|None
= None¶ Validate a new execution duration for a job.
If provided, called with the requested execution duration and the current job record and should return the new execution duration time. Otherwise, the execution duration may not be changed.
-
wait_timeout:
timedelta
= datetime.timedelta(seconds=60)¶ Maximum time a client can wait for a job change.