bartender.staging#
Attributes#
Exceptions#
When content type is unsupported. |
Functions#
|
Check if files required by application are present in job directory. |
|
Create job directory. |
|
|
|
Unpack archive file to job id directory. |
Module Contents#
- bartender.staging.CHUNK_SIZE#
- exception bartender.staging.UnsupportedContentTypeError#
Bases:
ExceptionWhen content type is unsupported.
- bartender.staging.has_needed_files(application: bartender.config.ApplicatonConfiguration, job_dir: pathlib.Path) Literal[True]#
Check if files required by application are present in job directory.
- Parameters:
application (bartender.config.ApplicatonConfiguration) – Name of application to check config file for.
job_dir (pathlib.Path) – In which directory to look.
- Raises:
IndexError – When one or more needed files can not be found
- Returns:
True when found or no files where needed.
- Return type:
Literal[True]
- async bartender.staging.create_job_dir(job_id: int, job_root_dir: pathlib.Path) pathlib.Path#
Create job directory.
- Parameters:
job_id (int) – id of the job.
job_root_dir (pathlib.Path) – Root directory for all jobs.
- Raises:
HTTPException – When job directory could not be made.
- Returns:
Directory of job.
- Return type:
- async bartender.staging.unpack_upload(job_dir: pathlib.Path, archive: fastapi.UploadFile, dest_fn: str = 'archive.zip') None#
Unpack archive file to job id directory.
- Parameters:
job_dir (pathlib.Path) – Where to put archive file.
archive (fastapi.UploadFile) – The archive file with async read method.
dest_fn (str) – Temporary archive filename.
- Return type:
None