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:

Attributes Summary

arq_mode

What mode to use for the arq queue.

arq_redis_settings

Settings for Redis for the arq queue.

async_post_route

Route configuration for creating an async job via POST.

execution_duration

Maximum execution time in seconds.

job_summary_type

Type representing the parameter-qualified job summary type.

lifetime

The lifetime of jobs.

parameters_type

Type representing the job parameters.

signing_service_account

Email of service account to use for signed URLs.

slack_webhook

Slack incoming webhook for reporting errors.

sync_get_route

Route configuration for creating a sync job via GET.

sync_post_route

Route configuration for creating a sync job via POST.

sync_timeout

Maximum lifetime of a sync request.

url_lifetime

How long result URLs should be valid for.

validate_destruction

Validate a new destruction time for a job.

validate_execution_duration

Validate a new execution duration for a job.

wait_timeout

Maximum time a client can wait for a job change.

wobbly_url

URL to the Wobbly UWS job tracking API.

worker

Name of the backend worker to call to execute a job.

Attributes Documentation

arq_mode: ArqMode = <dataclasses._MISSING_TYPE object>

What mode to use for the arq queue.

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 of Parameters. 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.

slack_webhook: SecretStr | None = None

Slack incoming webhook for reporting errors.

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.

sync_timeout: timedelta = datetime.timedelta(seconds=300)

Maximum lifetime of a sync request.

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.

wobbly_url: str | HttpUrl = <dataclasses._MISSING_TYPE object>

URL to the Wobbly UWS job tracking API.

worker: str = <dataclasses._MISSING_TYPE object>

Name of the backend worker to call to execute a job.