MetaCell / cloud-harness

Other
14 stars 5 forks source link

Fix SingleTaskOperation on Argo worflows #492

Open afonsobspinto opened 2 years ago

afonsobspinto commented 2 years ago

Is my understanding that something like:

my_task = tasks.CustomTask('print-file', 'myapp-mytask')
op = operations.SingleTaskOperation('my-op-', my_task)
op.execute()

Would fail with the error:

[workspaces]   File "/usr/src/app/api/models/population.py", line 59, in save
[workspaces]     execute_generate_population_images_workflow(self.id)
[workspaces]   File "/usr/src/app/api/services/workflows_service.py", line 17, in execute_generate_population_images_workflow
[workspaces]     operations.SingleTaskOperation(
[workspaces]   File "/libraries/cloudharness-common/cloudharness/workflows/operations.py", line 55, in execute
[workspaces]     raise NotImplementedError(f"{self.__class__.__name__} is abstract")
[workspaces] NotImplementedError: SingleTaskOperation is abstract

CH Version: 1.0.0

filippomc commented 2 years ago

A first fix to try is to inherit SimpleTaskOperationfrom AsyncOperationrather than from ContainerizedOperation