Create a Compute Environment for an h2o flow notebook

If you would like to create a compute environment that will allow you to run an h2o flow notebook, the following definitions can be used in your Compute Environment (CE).
Compute Environment (CE) Definition
Base Image
Create a new or duplicate CE and use one of the domino standard base images.
Note that our current standard images are Ubuntu 18, but this should also work with an older Ubuntu 16 image. Your results on non standard images may vary, but in general the definitions below should work on most images.
Insert in CE Dockerfile Instructions
#### INSTALL H2O Flow from workspaces RUN chmod +x /var/opt/workspaces/h2o/install RUN /var/opt/workspaces/h2o/install
Insert in Pluggable Workspace Tools
h20Flow: title: "H2O Flow" iconUrl: "https://raw.githubusercontent.com/dominodatalab/workspace-configs/develop/workspace-logos/H2O.svg?sanitize=true" start: [ "/var/opt/workspaces/h2o/start" ] httpProxy: port: 8888
Comments
-
While trying to get this to work, I ran into a few problems.
- H20 needs to be on version 3.18.0.11 for this to work. Anything newer will not work as of this post, and we are waiting on H2O to fix this issue.
- Your compute environment needs to be running Java 8. Anything later is not supported by H2O.
- The default start script was trying to open port 8080. The file /var/opt/workspaces/h20/start needs to be modified or a new one created with the correct port of 8888.
- To run this in Domino 4.2, you need to add two parameters under "httpProxy"
- rewrite: false
- requireSubdomain: false
- internalPath: "/{{ownerUsername}}/{{projectName}}/{{sessionPathComponent}}/{{runId}}"
I started with the Domino Analytics Distribution Py3.6 R3.6 (base image docker.io/dominodatalab/base:Ubuntu18_DAD_Py3.6_R3.6_20200508) and added the following to the bottom of the Dockerfile and Plugable Workspace File.
Dockerfile Instructions:
# Install OpenJDK-8 RUN apt-get update && \ apt-get install -y openjdk-8-jdk && \ apt-get install -y ant && \ apt-get clean; # Fix certificate issues RUN apt-get update && \ apt-get install ca-certificates-java && \ apt-get clean && \ update-ca-certificates -f; # Setup docker environment version ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java #Set default system version RUN sudo update-java-alternatives -s java-1.8.0-openjdk-amd64 RUN export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/ RUN export PATH=$PATH:$JAVA_HO #download and install h20 flow v3.18 RUN cd /opt/ && \ curl -o h2o-3.18.0.11.zip http://h2o-release.s3.amazonaws.com/h2o/rel-wolpert/11/h2o-3.18.0.11.zip && \ sudo unzip h2o-3.18.0.11.zip && \ rm h2o-3.18.0.11.zip RUN ln -s /opt/h2o-3.18.0.11 /opt/h2o #make custome start script that has port 8888. RUN mkdir -p /var/opt/workspaces/h2o RUN echo '#!/bin/bash\n\nPREFIX=/${DOMINO_PROJECT_OWNER}/${DOMINO_PROJECT_NAME}/notebookSession/${DOMINO_RUN_ID} \n\njava -jar /opt/h2o/h2o.jar -port 8888 -ice_root /tmp/h2o -flow_dir $DOMINO_WORKING_DIR -context_path ${PREFIX}' > /var/opt/workspaces/h2o/startFlow #make startup script executable RUN sudo chmod -R a+rx /opt/h2o/ RUN sudo chmod a+x /var/opt/workspaces/h2o/startFlow
Pluggable Workspace Tools:
h20Flow: title: "H2O Flow" iconUrl: "https://raw.githubusercontent.com/dominodatalab/workspace-configs/develop/workspace-logos/H2O.svg?sanitize=true" start: [ "/var/opt/workspaces/h2o/startFlow" ] httpProxy: rewrite: false port: 8888 internalPath: "/{{ownerUsername}}/{{projectName}}/{{sessionPathComponent}}/{{runId}}" requireSubdomain: false
0 -
Thanks for sharing your experience and findings @justin.phelps ! This will help improve our H2O docs and integration experience.
Katie
Field Data Scientist @ Domino
0
Howdy, Stranger!