melodic-flag-24742
05/17/2023, 3:59 PMworried-mechanic-36312
05/17/2023, 4:12 PMhappy-wolf-7852
05/17/2023, 4:22 PMhappy-wolf-7852
05/19/2023, 11:18 AMpython batch2.py run --with batch
see below code but get:
Validating your flow...
The graph looks good!
Running pylint...
Pylint is happy!
AWS Batch error:
The @batch decorator requires --datastore=s3.
from metaflow import FlowSpec, step, batch
class AddTwoNumbersFlow(FlowSpec):
@step
def start(self):
self.number1 = 20
self.number2 = 30
self.next(self.add)
@batch(cpu=1, memory=500)
@step
def add(self):
self.result = self.number1 + self.number2
self.next(self.end)
@step
def end(self):
print("The result is:", self.result)
if __name__ == '__main__':
AddTwoNumbersFlow().main()
worried-mechanic-36312
05/19/2023, 11:55 AMworried-mechanic-36312
05/19/2023, 11:55 AMhappy-wolf-7852
05/19/2023, 12:29 PMworried-mechanic-36312
05/19/2023, 12:35 PMAWS_PROFILE=metaflow_enabled_profile python file run
and same with Metaflow profilesworried-mechanic-36312
05/19/2023, 12:36 PM<https://github.com/jacopotagliabue/recs-at-resonable-scale/blob/2b16a7701abfad74f9b2c7c3354f1ad27f792137/src/my_merlin_flow.py#L109>
happy-wolf-7852
05/19/2023, 1:22 PMcrooked-jordan-29960
05/19/2023, 8:01 PM@batch
?
I am not sure why you'd be getting this Cross-account pass role
error unless you are trying to access resources in another AWS account from the account Metaflow was deployed in. Is this the case?happy-wolf-7852
05/20/2023, 11:32 AMcrooked-jordan-29960
05/20/2023, 2:06 PMhappy-wolf-7852
05/20/2023, 2:16 PMclass AddTwoNumbersFlow(FlowSpec):
@step
def start(self):
self.number1 = 20
self.number2 = 30
self.next(self.add)
@batch(cpu=1, memory=500)
# @retry
@step
def add(self):
self.result = self.number1 + self.number2
self.next(self.end)
@step
def end(self):
print("The result is:", self.result)
if __name__ == '__main__':
AddTwoNumbersFlow().main()
crooked-jordan-29960
05/20/2023, 2:18 PMfrom metaflow import FlowSpec, step
class F(FlowSpec):
@step
def start(self):
self.next(self.end)
@step
def end(self):
pass
if __name__ == '__main__':
F()
happy-wolf-7852
05/20/2023, 2:18 PMcrooked-jordan-29960
05/20/2023, 2:20 PMpython batch2.py run
crooked-jordan-29960
05/20/2023, 2:22 PMhappy-wolf-7852
05/20/2023, 2:22 PMhappy-wolf-7852
05/20/2023, 2:24 PMhappy-wolf-7852
05/20/2023, 2:26 PMcrooked-jordan-29960
05/20/2023, 2:29 PMcrooked-jordan-29960
05/20/2023, 2:37 PMunset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_PROFILE
and then run the flow --with batch again?happy-wolf-7852
05/20/2023, 2:51 PMhappy-wolf-7852
05/20/2023, 2:54 PMhappy-wolf-7852
05/20/2023, 2:56 PMhappy-wolf-7852
05/20/2023, 3:08 PMhappy-wolf-7852
05/20/2023, 3:30 PMhappy-wolf-7852
05/21/2023, 5:57 PM