def job(): return processing_model.ProcessingJob( component=None, container_image=None, download_request=None, upload_request=processing.model.ContainerImageUploadRequest( source_file='file:path', source_ref='source:ref', target_ref='target:ref', processing_callback=None, ), upload_context_url=None, )
def process(self, component, container_image): if not self.matches(component, container_image): return None LOGGER.info( f'{self._name} will process image: ' f'{component.name}:{container_image.access.imageReference}' ) # This path will be used as download first then source image_tar_path = os.path.join( config.RESOURCES_DIR, ci.util.file_extension_join( container_image.access.imageReference, pc.FileExtension.TAR.value, ) ) job = processing_model.ProcessingJob( component=component, container_image=container_image, download_request=None, # will be set by process based on AccessType upload_request=container.model.ContainerImageUploadRequest( source_ref=container_image.access.imageReference, source_file=image_tar_path, target_ref=None, # must be set by a later step processing_callback=None, # _may_ be set by a later step ), upload_context_url=None, # set by uploader ) job = self._downloader.process( processing_job=job, target_file=image_tar_path ) job = self._processor.process(processing_job=job) first = True for uploader in self._uploaders: job = uploader.process(job, target_as_source=not first) first = False return job