Skip to content
Snippets Groups Projects

don't create artifacts tars for curation

Merged Charlotte Hausman requested to merge fixing-full-ui-launching into 2.8.2.3-DEVELOPMENT
Files
3
@@ -440,11 +440,19 @@ class IngestionManifestBuilder:
destination_dir=self.manifest_destination_dir,
)
artifacts_ap = self._build_artifacts_product()
if is_full_curation:
# find the existing artifacts tar file name
artifacts_ap = self._find_existing_record(self.files_found)
else:
# build new artifacts tar
artifacts_ap = self._build_artifacts_product()
if artifacts_ap not in manifest.output_group.ancillary_products:
manifest.output_group.ancillary_products.append(artifacts_ap)
manifest_file = manifest.write()
self.write_ingestion_artifacts_tar(self.manifest_destination_dir / artifacts_ap.filename)
if not is_full_curation:
# we're running initial ingestion, make a new artifacts tar
self.write_ingestion_artifacts_tar(self.manifest_destination_dir / artifacts_ap.filename)
return manifest, manifest_file
@@ -548,6 +556,18 @@ class IngestionManifestBuilder:
AncillaryProductType.INGESTION_ARTIFACTS, IngestionManifestBuilder._build_artifacts_filename()
)
@staticmethod
def _find_existing_record(available_files: list) -> AncillaryProduct:
"""
Find an existing artifacts tar for curation
:param available_files: existing files list
:return: Ancillary Product of existing tar
"""
for file in available_files:
if INGESTION_ARTIFACTS_NAME in file.name:
return AncillaryProduct(AncillaryProductType.INGESTION_ARTIFACTS, file.name)
def write_ingestion_artifacts_tar(self, artifacts_path: Path) -> tarfile.TarFile:
"""
Take the list of files and write a tar file for inclusion in the archive.
Loading