diff --git a/src/deadline_worker_agent/sessions/actions/scripts/attachment_upload.py b/src/deadline_worker_agent/sessions/actions/scripts/attachment_upload.py index 87decf0e..40b866d1 100644 --- a/src/deadline_worker_agent/sessions/actions/scripts/attachment_upload.py +++ b/src/deadline_worker_agent/sessions/actions/scripts/attachment_upload.py @@ -13,8 +13,11 @@ from deadline.job_attachments.models import ManifestSnapshot """ -A small script to upload job output using attachment upload. -This is available in deadline-cloud as python API and AWS Deadline Cloud CLI. +A small script to +1. capture the difference since the given base input manifest to generate manifests via manifest snapshot +2. upload job output based on the diff manifests using attachment upload + +The manifest snapshot and attachment upload commands are available in deadline-cloud as python API and AWS Deadline Cloud CLI. Example usage: @@ -41,12 +44,15 @@ def snapshot(manifest_paths_by_root: dict[str, str]) -> list[str]: manifests = list() for root, path in manifest_paths_by_root.items(): + # TODO - use the public api for manifest snapshot once that's final and made public manifest: Optional[ManifestSnapshot] = _manifest_snapshot( root=root, + # direcotry to put the generated diff manifests destination=str(output_path), # `output` is used for job download to discover output manifests # manifest file name need to contain the hash of root path for attachment CLI path mapping name=f"output-{os.path.basename(path)}", + # this path to manifest servers as a base for the snapshot, generate only difference since this manifest diff=path, ) if manifest: diff --git a/test/unit/sessions/actions/test_run_attachment_download.py b/test/unit/sessions/actions/test_run_attachment_download.py index ced95dd3..36a8b448 100644 --- a/test/unit/sessions/actions/test_run_attachment_download.py +++ b/test/unit/sessions/actions/test_run_attachment_download.py @@ -91,6 +91,7 @@ class TestStart: def session( self, session_id: str, + session_dir: str, job_details: JobDetails, job_user: SessionUser, job_attachment_details: JobAttachmentDetails, @@ -102,6 +103,7 @@ def session( session._job_attachment_details = job_attachment_details session._os_user = job_user session.openjd_session = mock_openjd_session_cls + session.working_directory = session_dir session._queue_id = TestStart.QUEUE_ID session._queue._job_id = TestStart.JOB_ID return session diff --git a/test/unit/sessions/test_session.py b/test/unit/sessions/test_session.py index 954db1e5..a5159ae5 100644 --- a/test/unit/sessions/test_session.py +++ b/test/unit/sessions/test_session.py @@ -1589,7 +1589,7 @@ def mock_now(*arg, **kwarg) -> datetime: @pytest.mark.skipif( ASSET_SYNC_JOB_USER_FEATURE, - reason="This test will be removed after releasing the asset sync job user feature", + reason="This test will be re-written before releasing the asset sync job user feature", ) def test_success_task_run_fail_output_sync( self, @@ -1675,7 +1675,7 @@ def mock_now(*arg, **kwarg) -> datetime: @pytest.mark.skipif( ASSET_SYNC_JOB_USER_FEATURE, - reason="This test will be removed after releasing the asset sync job user feature", + reason="This test will be re-written before releasing the asset sync job user feature", ) def test_logs_succeeded( self,