If you are primarily using the Universal Recommender with PIO you should find upgrading fairly easy. Outline:
- With PIO running export your data from the UR
- start Harness
- add a UR engine instance and parameters
- import your data
- train the UR
After step 3 you are ready for input and after 5 you are ready for queries.
With PredictionIO running, export all your data. This is done with:
pio app list
to find yourappid
pio export --appid <id-from-step-1> --output </path/to/export/location>
export all data
This gives you a snapshot of your PIO hosted data.
Follow instructions to Install Harness. This can be done by hand on your host or by using Docker containers. Start Harness, it already contains the UR and other Engines.
Harness is fully multi-tenant so every reference to an Engine Instance uses an engine-id. This is created by setting it in a config JSON file with other parameters. The format is similar to the PIO engine.json for the UR with some changes:
indicators
instead ofeventNames
rules
instead offields
- the Harness version also has a slightly different structure.
Create a JSON file for the UR substituting your values from the PIO version of engine.json
to fit the description in UR Configuration
Harness can run many instances of Engines like the UR. Once you have installed Harness and the Harness-cli you can add one that will work like your PIO UR:
hctl status
checks only harness running status, so hand check that MongoDB and Elasticsearch are also runninghctl add </path/to/ur/config/json>
This will create an Engine Instance for the UR with theengineId
named in the JSON filehctl status engines <ur-instance-id>
see the params you set for this instance and verify everything is running.hctl import <ur-instance-id> </path/to/export/location>
import from data exported by PIO + UR.hctl train <ur-instance-id>
when completed, this will allow you to query the UR using REST or the new Harness SKD (Java, Scala, Python).
At this point Harness and the UR are ready for live input and queries. To make them you need to use the REST endpoints. Below <harness-host>
is your IP address for the instance of Harness you started.
POST http://<harness-host>:9090/engines/<ur-engine-instance>/events
where the request is a UR input JSON packet that is identical to PredictionIO, only the URI is different.POST http://<harness-host>:9090/engines/<ur-engine-instance>/queries
where the request is a UR query JSON packet identical to PIO, only the URI is different.
Alternatively you can use one of the Harness SDKs to do queries and input.