PredictionIO Engine template code explanation

You will notice that we have modified the engine template code available at http://predictionio.incubator.apache.org/templates/similarproduct/quickstart/ to meet Heroku needs.

The key things to understand from the engine code are as follows:

  • Procfile: This file resides in the root of the project folder and declares the command necessary to run the app on Heroku dynos. Consider the following commands:
web: source bin/env.sh && target/universal/stage/bin/pio-engine-heroku -main ServerApp
train: source bin/env.sh && target/universal/stage/bin/pio-engine-heroku -main TrainApp

The preceding web command starts the code in the ServerApp Scala object when the Heroku dyno boots up.

  • train: This is a custom command to train the app. The train basically runs the TrainApp object.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset