Skip to content
An Mleap Container for OpenWhisk
Branch: master
Clone or download
Pull request Compare This branch is 28 commits ahead of sanjeevghimire:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
mleap-spark-action
.DS_Store
.gitignore
Dockerfile
README.md
buildAndPush.sh
exampledata.json

README.md

openwhisk-scala-spark-mleap

An Apache OpenWhisk Docker Action written in Scala. It serves a Spark MLlib Model, packaged as an Mleap bundle.

Pre-requisites

  • Apache OpenWhisk
  • Java 1.8+
  • scala 2.11.6+ and sbt 0.13+
  • Docker / Docker Hub Account

Run The Example

This repository contains a simple example serving up a model that predicts the price of an Airbnb.

docker run -d -p 8080:8080 jowanza/scalatest:latest

curl -H "Content-Type: application/json" -d '{"value":{"data":["NY", 6.0, 1250.0, 3.0, 50.0,30.0, 2.0, 56.0, 90.0, "Entire home/apt", "1.0", "strict", "1.0"]}}' localhost:8080/run

To deploy this to IBM Cloud please follow the directions here

Write Your Own Example

To create your own Scala action there are a few steps.

  1. Create a main object in src->main->scala

  2. Import dependencies via SBT

  3. Copy code from the main object implementation into an esec function located in whisk-action

  4. Build your code with SBT sbt assembly

  5. Build and push

You can’t perform that action at this time.