aloof-butcher-73366
04/12/2023, 2:46 PMancient-application-36103
04/12/2023, 2:49 PMaloof-butcher-73366
04/12/2023, 2:51 PM2023-04-12 14:05:46.257 [337/eval/1903 (pid 876397)] [pod t-td4jn-w4gmp] Task finished with exit code None.
2023-04-12 14:05:46.811 Workflow failed.
2023-04-12 14:05:46.811 Terminating 4 active tasks...ancient-application-36103
04/12/2023, 3:20 PMelegant-beach-10818
04/12/2023, 3:45 PM@kubernetes(cpu=2, memory=72000, namespace="argo")
@retry
@step
def eval(self):
It's odd in that the failures are intermittent
We are using spot instances, so my current theory is that when the EC2 instance is occasionally terminated due to spot instance interruption, Metaflow isn't given a clean exit code to go and retry the step.
I've manually tested this theory by starting a job and then terminating the EC2 instance that the node is scheduled on. Here was my code and resulting error:
from metaflow import FlowSpec, step, kubernetes, retry
class ForeachFlow(FlowSpec):
@step
def start(self):
self.next(self.a)
@kubernetes(cpu=2, memory=74000)
@retry
@step
def a(self):
import time
for i in range(720):
print(i)
time.sleep(1)
self.next(self.end)
@step
def end(self):
print('done')
if __name__ == '__main__':
ForeachFlow()
2023-04-12 15:39:47.981 [341/a/1977 (pid 19866)] [pod t-rzz57-9rps9] 80
2023-04-12 15:39:48.982 [341/a/1977 (pid 19866)] [pod t-rzz57-9rps9] 81
2023-04-12 15:40:33.425 [341/a/1977 (pid 19866)] [pod t-rzz57-9rps9] Task finished with exit code None.
2023-04-12 15:40:34.113 Workflow failed.
2023-04-12 15:40:34.113 Terminating 1 active tasks...
2023-04-12 15:40:34.114 [341/a/1977 (pid 19866)] [KILLED BY ORCHESTRATOR]
2023-04-12 15:40:34.114 [341/a/1977 (pid 19866)] [KILLED BY ORCHESTRATOR]
2023-04-12 15:40:34.114 Flushing logs...
Data store error:
No completed attempts of the task was found for task 'ForeachFlow/341/a/1977'elegant-beach-10818
04/12/2023, 3:47 PMNone, and indeed it doesn't attempt to retry the stepancient-application-36103
04/12/2023, 4:20 PMelegant-beach-10818
04/13/2023, 6:29 PM"<http://cluster-autoscaler.kubernetes.io/scale-down-disabled|cluster-autoscaler.kubernetes.io/scale-down-disabled>": "true"ancient-application-36103
05/07/2023, 10:58 PMancient-application-36103
05/07/2023, 11:06 PMelegant-beach-10818
05/09/2023, 2:06 PMancient-application-36103
05/09/2023, 4:02 PMelegant-beach-10818
05/09/2023, 4:05 PMsquare-wire-39606
05/09/2023, 4:08 PM