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:
FilerStrategyContent 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.
poiesis.core.services.filer.strategy.filer_strategy module¶
Filer strategy module.
- class poiesis.core.services.filer.strategy.filer_strategy.FilerStrategy(payload)[source]¶
Bases:
ABCFiler 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)
poiesis.core.services.filer.strategy.http_filer module¶
HTTP filer strategy module.
- class poiesis.core.services.filer.strategy.http_filer.HttpFilerStrategy(payload)[source]¶
Bases:
FilerStrategyFiler 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.
poiesis.core.services.filer.strategy.local_filer module¶
Local filer strategy module.
- class poiesis.core.services.filer.strategy.local_filer.LocalFilerStrategy(payload)[source]¶
Bases:
FilerStrategyLocal filer strategy.
poiesis.core.services.filer.strategy.s3_filer module¶
S3 filer strategy module.
- class poiesis.core.services.filer.strategy.s3_filer.S3FilerStrategy(payload)[source]¶
Bases:
FilerStrategyS3 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)
Module contents¶
Strategy for filing to different storage and via different protocol.