0

I am trying to spawn a mapreduce job using the mrjob library from AWS Lambda. The job takes longer than the 5 minute Lambda time limit, so I want to execute a remote job. Using the paramiko package, I ssh'd onto the server and ran a nohup command to spawn a background job, but this still waits until the end of job. Is there anyway to do this with Lambda?

Romano Zumbé
  • 7,735
  • 4
  • 32
  • 52
user2820906
  • 155
  • 10

2 Answers2

0

In python you can launch a shell command without waiting for its end. Here you'll find more information

0

Instead of using SSH I've solved this before by pushing a message onto a SQS queue that a process on the server monitors. This is much simpler to implement and avoids needing to keep credentials in the lambda function or place it in a VPC.

Robo
  • 942
  • 4
  • 10