Skip to content

Enhancement: job attachments interface does not use storage profiles by default #829

@crowecawcaw

Description

@crowecawcaw

Describe the bug

The S3AssetManager class which is the public interface for job attachments functionality does not use storage profiles for default.

The S3AssetManager class takes a farm_id, queue_id, and session in its constructor. Then later, the prepare_paths_for_upload method takes storage_profile as an optional parameter. It's not terrible difficult to fetch the storage profile and pass it in, but passing in storage profiles is easy to miss, possible to mess up, and should be done automatically. If S3AssetManager already has the queue ID, it can find the storage profile to use internally and automatically.

storage_profile: Optional[StorageProfile] = None,

def __init__(
self,
farm_id: Optional[str] = None,
queue_id: Optional[str] = None,
job_attachment_settings: Optional[JobAttachmentS3Settings] = None,
asset_uploader: Optional[S3AssetUploader] = None,
session: Optional[boto3.Session] = None,
asset_manifest_version: ManifestVersion = ManifestVersion.v2023_03_03,

More broadly, it'd be nice if there were a single create_job function that wrapped up the job inputs and job attachments together so that consumers of the libraries can simply pass in a list of paths with the job and don't need to know how job attachments, shared storage, and storage profiles all interact.

Expected Behaviour

Job attachments uses a queue's storage profile by default.

Current Behaviour

Job attachments needs to be opted in to using storage profiles.

Reproduction Steps

n/a

Environment

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjob attachmentsFor an issue with job attachments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions