tesk package

Subpackages

Submodules

tesk.app module

API server entry point.

tesk.app.init_app()[source]

Initialize and return the FOCA app.

This function initializes the FOCA app by loading the configuration from the environment variable TESK_FOCA_CONFIG_PATH if set, or from the default path if not. It raises a FileNotFoundError if the configuration file is not found.

Return type:

FlaskApp

Returns:

A Connexion application instance.

Raises:

FileNotFoundError – If the configuration file is not found.

tesk.app.main()[source]

Run FOCA application.

Return type:

None

tesk.constants module

Tesk scoped constants.

class tesk.constants.TeskConstants(**data)[source]

Bases: BaseModel

Tesk’s K8s scoped constants.

FILER_IMAGE_NAME

Name of the filer image

FILER_IMAGE_VERSION

Version of the filer image

TASKMASTER_IMAGE_NAME

Name of the taskmaster image

TASKMASTER_IMAGE_VERSION

Version of the taskmaster image

TESK_NAMESPACE

Namespace in which api will create K8s resources from TES request

TASKMASTER_SERVICE_ACCOUNT_NAME

Taskmaster service account name

TASKMASTER_ENVIRONMENT_EXECUTOR_BACKOFF_LIMIT

Backoff limit for taskmaster env

FILER_BACKOFF_LIMIT

Backoff limit got filer job

EXECUTOR_BACKOFF_LIMIT

Backoff limit for executor job

class Config[source]

Bases: object

Configuration for class.

frozen = True
EXECUTOR_BACKOFF_LIMIT: str
FILER_BACKOFF_LIMIT: str
FILER_IMAGE_NAME: str
FILER_IMAGE_VERSION: str
TASKMASTER_IMAGE_NAME: str
TASKMASTER_IMAGE_VERSION: str
TASKMASTER_SERVICE_ACCOUNT_NAME: str
TESK_NAMESPACE: str

tesk.custom_config module

Custom configuration model for the FOCA app.

class tesk.custom_config.CustomConfig(**data)[source]

Bases: BaseModel

Custom configuration model for the FOCA app.

Parameters:
  • service_info – Service information.

  • taskmaster – Taskmaster environment.

service_info: Service
taskmaster: Taskmaster
class tesk.custom_config.ExecutorSecret(**data)[source]

Bases: BaseModel

Executor secret configuration.

Parameters:
  • name – Name of a secret that will be mounted as volume to each executor. The same name will be used for the secret and the volume.

  • mountPath – The path where the secret will be mounted to executors.

  • enabled – Indicates whether the secret is enabled.

enabled: bool
mountPath: Optional[str]
name: Optional[str]
class tesk.custom_config.FtpConfig(**data)[source]

Bases: BaseModel

Ftp configuration model for the TESK.

Parameters:
  • secretName – Name of the secret with FTP account credentials.

  • enabled – If FTP account enabled (based on non-emptiness of secretName).

enabled: bool
secretName: Optional[str]
class tesk.custom_config.Taskmaster(**data)[source]

Bases: BaseModel

Taskmaster’s configuration model for the TESK.

Parameters:
  • imageName – Taskmaster image name.

  • imageVersion – Taskmaster image version.

  • filerImageName – Filer image name.

  • filerImageVersion – Filer image version.

  • ftp – FTP account settings.

  • debug – If verbose (debug) mode of taskmaster is on (passes additional flag to taskmaster and sets image pull policy to Always).

  • environment – Environment variables, that will be passed to taskmaster.

  • serviceAccountName – Service Account name for taskmaster.

  • executorSecret – Executor secret configuration

debug: bool
environment: Optional[Dict[str, str]]
executorBackoffLimit: str
executorSecret: Optional[ExecutorSecret]
filerBackoffLimit: str
filerImageName: str
filerImageVersion: str
ftp: FtpConfig
imageName: str
imageVersion: str
serviceAccountName: str

tesk.exceptions module

App exceptions.

exception tesk.exceptions.ConfigInvalidError[source]

Bases: ValueError

Configuration file is invalid.

exception tesk.exceptions.ConfigNotFoundError[source]

Bases: FileNotFoundError

Configuration file not found error.

exception tesk.exceptions.KubernetesError(status=None, reason=None, http_resp=None)[source]

Bases: ApiException

Kubernetes error.

exception tesk.exceptions.ValidationError[source]

Bases: Exception

Value or object is not compatible with required type or schema.

tesk.utils module

Utility functions for the TESK package.

tesk.utils.get_config_path()[source]

Get the configuration path.

Return type:

Path

Returns:

The path of the config file.

tesk.utils.get_custom_config()[source]

Get the custom configuration.

Return type:

CustomConfig

Returns:

The custom configuration.

tesk.utils.get_taskmaster_config()[source]

Get the taskmaster env property from the custom configuration.

Return type:

Taskmaster

Returns:

The taskmaster env property.

tesk.utils.get_taskmaster_template()[source]

Get the taskmaster template from the custom configuration.

This will be used to create the taskmaster job, API will inject values into the template, depending upon the type of job and request.

Return type:

V1Job

Returns:

The taskmaster template.

Module contents

TESK package initialization file.