poiesis.core.services.filer.strategy package

Submodules

poiesis.core.services.filer.strategy.content_filer module

Content filer strategy module.

class poiesis.core.services.filer.strategy.content_filer.ContentFilerStrategy(payload)[source]

Bases: FilerStrategy

Content filer, if the content is given in the request.

async download_input_directory(container_path)[source]

Download input directory.

Raises:

NotImplementedError – Content filer doesn’t support downloading directories.

async download_input_file(container_path)[source]

Get the content from request and mount to PVC.

Parameters:

container_path (str) – The path inside the container where the file needs to be downloaded to.

Return type:

None

async upload_glob(glob_files)[source]

Upload output dir.

Raises:

NotImplementedError – Content filer doesn’t support uploading directories.

async upload_output_directory(container_path)[source]

Upload output dir.

Raises:

NotImplementedError – Content filer doesn’t support uploading directories.

async upload_output_file(container_path)[source]

Mount the content to PVC.

Content filer does not support uploads according to TES spec.

Parameters:

container_path (str) – The path inside the container from where the file needs to be uploaded from.

Return type:

None

poiesis.core.services.filer.strategy.filer_strategy module

Filer strategy module.

class poiesis.core.services.filer.strategy.filer_strategy.FilerStrategy(payload)[source]

Bases: ABC

Filer strategy interface.

async download()[source]

Download file from storage and mount to PVC.

Get the appropriate secrets, check permissions and download the file.

abstractmethod async download_input_directory(container_path)[source]

Download the directory content from storage and mount to PVC.

Parameters:

container_path (str) – The path inside the container from where the file needs to be downloaded to the storage.

abstractmethod async download_input_file(container_path)[source]

Download file from storage and mount to PVC.

Parameters:

container_path (str) – The path inside the container from where the file needs to be downloaded to the storage.

async upload()[source]

Upload file to storage created by executors, mounted to PVC.

This method correctly dispatches to glob, file, or directory handlers and includes robust logging and fallback mechanisms.

abstractmethod async upload_glob(glob_files)[source]

Upload files and directories when wildcards are present.

Parameters:

glob_files (list[tuple[str, str, bool]]) – List of tuples containing (file_path, relative_path, is_directory)

abstractmethod async upload_output_directory(container_path)[source]

Upload directory to storage created by executors, mounted to PVC.

Parameters:

container_path (str) – The path inside the container from where the file needs to be uploaded to the storage.

abstractmethod async upload_output_file(container_path)[source]

Upload file to storage created by executors, mounted to PVC.

Parameters:

container_path (str) – The path inside the container from where the file needs to be uploaded to the storage.

poiesis.core.services.filer.strategy.http_filer module

HTTP filer strategy module.

class poiesis.core.services.filer.strategy.http_filer.HttpFilerStrategy(payload)[source]

Bases: FilerStrategy

Filer strategy for HTTP and HTTPS.

async download_input_directory(container_path)[source]

Download the input directory from the HTTP or HTTPS URI.

Parameters:

container_path (str) – The path to download the file to.

async download_input_file(container_path)[source]

Download the input file from the HTTP or HTTPS URI.

Parameters:

container_path (str) – The path to download the file to.

async upload_glob(glob_files)[source]

Upload files using glob patterns.

async upload_output_directory(container_path)[source]

Upload the output directory to the HTTP or HTTPS URI.

Parameters:
  • output – The output file to upload.

  • container_path (str) – The path to upload the file from.

async upload_output_file(container_path)[source]

Upload the output file to the HTTP or HTTPS URI.

Parameters:
  • output – The output file to upload.

  • container_path (str) – The path to upload the file from.

poiesis.core.services.filer.strategy.local_filer module

Local filer strategy module.

class poiesis.core.services.filer.strategy.local_filer.LocalFilerStrategy(payload)[source]

Bases: FilerStrategy

Local filer strategy.

async download_input_directory(container_path)[source]

Download input directory from a local path.

async download_input_file(container_path)[source]

Download file from storage and mount to PVC.

async upload_glob(glob_files)[source]

Upload files and directories using wildcard pattern.

Parameters:

glob_files (list[tuple[str, str, bool]]) – List of tuples containing (file_path, relative_path, is_directory)

async upload_output_directory(container_path)[source]

Upload output directory to a local path.

async upload_output_file(container_path)[source]

Dummy upload output (local).

poiesis.core.services.filer.strategy.s3_filer module

S3 filer strategy module.

class poiesis.core.services.filer.strategy.s3_filer.S3FilerStrategy(payload)[source]

Bases: FilerStrategy

S3 filer strategy.

async download_input_directory(container_path)[source]

Download a directory from S3 or Minio and mount to PVC.

Download directory from S3 or Minio to the path location which is mounted to PVC. I.e if the path is bucket_name/path_name then it download all the files in bucket_name/path_name to container_path.

Parameters:

container_path (str) – The path inside the container where the file needs to be downloaded to.

Return type:

None

async download_input_file(container_path)[source]

Download file from S3 or Minio and mount to PVC.

Download file from S3 or Minio to the path location which is mounted to PVC.

Parameters:

container_path (str) – The path inside the container where the file needs to be downloaded to.

Return type:

None

async upload_glob(glob_files)[source]

Upload files and directories using wildcard pattern.

Parameters:

glob_files (list[tuple[str, str, bool]]) – List of tuples containing (file_path, relative_path, is_directory)

async upload_output_directory(container_path)[source]

Upload directory to S3 or Minio created by executors, mounted to PVC.

Parameters:

container_path (str) – The path inside the container from where the directory needs to be uploaded.

Return type:

None

async upload_output_file(container_path)[source]

Upload file to S3 or Minio created by executors, mounted to PVC.

Parameters:

container_path (str) – The path inside the container from where the file needs to be uploaded from.

Return type:

None

Module contents

Strategy for filing to different storage and via different protocol.