Skip to main content

Productionizing H2O

H2O-3 Secure

H2O-3 Secure provides the supported, production-grade path for deploying models. Contact enterprise@h2o.ai.

About POJOs and MOJOs​

H2O allows you to convert the models you have built to either a Plain Old Java Object (POJO) or a Model ObJect, Optimized (MOJO).

H2O-generated MOJO and POJO models are intended to be easily embeddable in any Java environment. The only compilation and runtime dependency for a generated model is the h2o-genmodel.jar file produced as the build output of these packages. This file is a library that supports scoring. For POJOs, it contains the base classes from which the POJO is derived from. (You can see "extends GenModel" in a POJO class. The GenModel class is part of this library.) For MOJOs, it also contains the required readers and interpreters. The h2o-genmodel.jar file is required when POJO/MOJO models are deployed to production.

Users can refer to the Quick Start topics that follow for more information about generating POJOs and MOJOs.

Developers can refer to the POJO and MOJO Model Javadoc.

See MOJO Quickstart and POJO Quickstart for step-by-step instructions.

Example design patterns​

Here is a collection of example design patterns for how to productionize H2O.

Consumer loan application​

CharacteristicValue
Pattern nameJetty servlet
Example training languageR
Example training data sourceCSV file
Example scoring data sourceUser input to Javascript application running in browser
Scoring environmentREST API service provided by Jetty servlet
Scoring engineH2O POJO
Scoring latency SLAReal-time
ResourceLocation
Git reposhttps://github.com/h2oai/app-consumer-loan
Slideshttp://docs.h2o.ai/h2o-tutorials/latest-stable/tutorials/building-a-smarter-application/index.html

Malicious domain application​

CharacteristicValue
Pattern nameAWS Lambda
Example training languagePython
Example training data sourceCSV file
Example scoring data sourceUser input to Javascript application running in browser
Scoring environmentAWS Lambda REST API endpoint
Scoring engineH2O POJO
Scoring latency SLAReal-time
ResourceLocation
Git reposhttps://github.com/h2oai/app-malicious-domains
Slideshttps://github.com/h2oai/h2o-meetups/tree/master/2016_05_03_H2O_Open_Tour_Chicago_Application

Storm bolt​

CharacteristicValue
Pattern nameStorm bolt
Example training languageR
Example training data sourceCSV file
Example scoring data sourceStorm spout
Scoring environmentPOJO embedded in a Storm bolt
Scoring engineH2O POJO
Scoring latency SLAReal-time
ResourceLocation
Git reposhttps://github.com/h2oai/h2o-tutorials/tree/master/tutorials/streaming/storm
Tutorialshttp://docs.h2o.ai/h2o-tutorials/latest-stable/tutorials/streaming/storm/index.html

Invoking POJO directly in R​

CharacteristicValue
Pattern namePOJO in R
Example training languageR
Scoring environmentR
Scoring engineH2O POJO
Scoring latency SLABatch

MOJO as a JAR resource​

CharacteristicValue
Pattern nameMOJO JAR
Example training languageR
Example training data sourceIris
Example scoring data sourceSingle Row
Scoring environmentPortable
Scoring engineH2O MOJO
Scoring latency SLAReal-time example, but can be adapted for batch scoring
ResourceLocation
Git reposhttps://github.com/h2oai/h2o-tutorials/tree/master/tutorials/mojo-resource

Steam scoring server from H2O.ai​

CharacteristicValue
Pattern nameSteam
Scoring data sourceREST API client
Scoring environmentSteam scoring server
Scoring engineH2O POJO
Scoring latency SLAReal-time
ResourceLocation
Web siteshttp://www.h2o.ai/steam/

Scoring server on AWS​

You can deploy a RESTful server on AWS using the marketplace AMI (H2O Inference server - Hourly). Notice that this is a paid AMI.

Transfer the MOJO file into the /tmp folder of this instance before launching. If your MOJO is in S3, assign a role that provides S3 access to the instance.

Run following bash script as "userdata" to transfer your MOJO into the instance before you launch the instance. Be sure you change the mojofile path below.

#cloud-boothook
#!/bin/bash
export mojofile="s3://yourbucket/yourmojo.zip"
aws s3 cp $mojofile /tmp/pipeline.mojo

After this instance has launched, you can make real time inference using the following command. Remember to change the IP address. Input data is provided through the row parameter in the URL.

curl "http://<yourIP>:8080/model?type=1&row=2000,2000"

Additional resources​


Feedback