Hello .. I am following the tutorial to use MF on ...
# ask-metaflow
g
Hello .. I am following the tutorial to use MF on AWS infra. Currently using the suggested cloud formation template. When I run my flow locally, it gets executed. When I changed it to run such that
--datastore=s3
, it also runs successfully. The execution fails when I have
--with batch
. The error message is
Copy code
2023-02-18 23:42:12.237 Workflow starting (run-id 1676792530723739):
2023-02-18 23:42:25.550 [1676792530723739/start/1 (pid 41117)] Task is starting.
2023-02-18 23:42:27.145 [1676792530723739/start/1 (pid 41117)] [79e6b696-1231-4cc8-ac53-e57cd2d752e8] Task is starting (status SUBMITTED)...
2023-02-18 23:42:31.308 [1676792530723739/start/1 (pid 41117)] [79e6b696-1231-4cc8-ac53-e57cd2d752e8] Task is starting (status RUNNABLE)...
2023-02-18 23:42:33.511 [1676792530723739/start/1 (pid 41117)] [79e6b696-1231-4cc8-ac53-e57cd2d752e8] Task is starting (status FAILED)...
2023-02-18 23:42:34.307 [1676792530723739/start/1 (pid 41117)] Data store error:
2023-02-18 23:42:34.307 [1676792530723739/start/1 (pid 41117)] No completed attempts of the task was found for task 'ProcessFlowDemo/1676792530723739/start/1'
2023-02-18 23:42:34.720 [1676792530723739/start/1 (pid 41117)] 
2023-02-18 23:42:34.901 [1676792530723739/start/1 (pid 41117)] Task failed.
2023-02-18 23:42:35.057 Workflow failed.
2023-02-18 23:42:35.057 Terminating 0 active tasks...
2023-02-18 23:42:35.058 Flushing logs...
    Step failure:
    Step start (task-id 1) failed.
Actual code:
Copy code
from metaflow import FlowSpec, step
import os

global_value = 5

class ProcessFlowDemo(FlowSpec):
    
    @step
    def start(self):
        global global_value
        global_value = 8
        print(f"Process id: {global_value}")
        print(f"Process id: {os.getpid()}")
        self.next(self.end)

    @step
    def end(self):
        print(f"Process id: {global_value}")
        print(f"Process id: {os.getpid()}")

if __name__ == '__main__':
    ProcessFlowDemo()
As you can there is no permission issue to connect to S3 from Batch. Please LMK if you need additional info to debug this. TIA!
1
v
are you able to log in to Batch console in the AWS console and see if there are additional error messages? It's interesting that it goes directly from RUNNABLE to FAILED
a
following up here - @great-salesclerk-84349 you would want to look for the job
79e6b696-1231-4cc8-ac53-e57cd2d752e8
in the AWS Batch console.
s
@great-salesclerk-84349 were you able to resolve this?
g
Hi @square-wire-39606.. sorry for missing this. I have not had the chance to look into your suggestions yet. Will take a look later today and let you know what I have found.
👍 1
Hi @square-wire-39606 , I get this from that failed job:
Copy code
ECS was unable to assume the role 'arn:aws:iam::003513502334:role/metaflow-tutorial-v1-BatchExecutionRole-1VBU4GBQORXO5' that was provided for this task. Please verify that the role being passed has the proper trust relationship and permissions and that your IAM user has permissions to pass this role.
Current IAM policies that were set from CF template.
Is there anything that does not add up? @square-wire-39606