running H2O on AWS Lambda ("Server wasn't able to start in %f seconds.")

346 views
Skip to first unread message

Adam Bittlingmayer

unread,
Sep 3, 2016, 9:21:21 AM9/3/16
to H2O Open Source Scalable Machine Learning - h2ostream
I am interest in running H2O not on an EC2 instance but from AWS Lambda.

The demo https://github.com/h2oai/app-malicious-domains runs H2O on Lambda, but to me it is not an ideal blueprint - it uses the Java runtime, and the Java invokes Python that invokes Java.

The approach I took:

- Python runtime, and create a deployment package .zip including the contents of <virtualenv>/lib/python2.7/site-packages/
- cp h2o.jar from S3 to /tmp/ in the init of the Lambda function, as it of course does not end up in <virtualenv>/lib/python2.7/site-packages/
- modified init() in h2o.py to pass jar_path='/tmp/h2o.jar' to H2OLocalServer.start(...

The jar is found but H2OLocalServer never properly starts:

"Server wasn't able to start in %f seconds."

Any guidance on how to fix this?  And what is the most sensible approach?

lau...@h2o.ai

unread,
Sep 13, 2016, 11:24:44 AM9/13/16
to H2O Open Source Scalable Machine Learning - h2ostream
I would suggest looking into the java logs (there is a message in console giving file names of 2 log files: `JVM stdout:` and `JVM stderr:`). If it seems like the server might start if given more time, then you could change the `H2OLocalServer._TIME_TO_START` constant to something greater than 10 seconds. You can change You can change _TIME_TO_START, in the server.py file within the h2o-3 repo.

feel free to post your java logs as well.

cheers,

Lauren

sumant...@gmail.com

unread,
Jun 6, 2017, 4:12:27 PM6/6/17
to H2O Open Source Scalable Machine Learning - h2ostream
I am new to the python. I changed this parameter. But I still keep getting the error with 10 sec. How do i make the change effective? Do I need to recompile the package?
Thanks,
Sachin

sumant...@gmail.com

unread,
Jun 6, 2017, 4:14:43 PM6/6/17
to H2O Open Source Scalable Machine Learning - h2ostream
Hi Lauren,
I am new to the python. I changed _TIME_TO_START parameter. But I still keep getting the error with 10 sec. How do i make the change effective? Do I need to recompile the package?
Thanks,
Sachin


On Tuesday, 13 September 2016 11:24:44 UTC-4, lau...@h2o.ai wrote:

Sachin S

unread,
Jun 6, 2017, 4:48:02 PM6/6/17
to H2O Open Source Scalable Machine Learning - h2ostream
The problem got resolved once I reloaded the packages using importlib


--
You received this message because you are subscribed to a topic in the Google Groups "H2O Open Source Scalable Machine Learning - h2ostream" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/h2ostream/adwuuRh9USI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to h2ostream+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages