I'm struggling to get ThingWatcher running. I've deployed both services with docker as in the documentation and then found some sample code here on the forums using the SDK.
It seems to work fine for training and then the model is saved and I can see the file appear in my volume. I then get exceptions when it appears the SDK is trying to load the model by connecting directly to the model service using the URI is has received from the training service. This doesn't work because the URI is using the container name (my host cannot resolve this) and on port 8080, not the 8090 that I have mapped it to.
My docker commands to run the containers are:
docker run -d \ -p 8090:8080 \ -v /home/andrew/tw/models:/data/models \ -v /home/andrew/tw/db:/tmp/ \ --name model-service \ twxml/model-service:1.0 \ -Dfile.storage.path=data/models \ -jar maven/model-1.0.jar \ server maven/standalone-evaluator.yml docker run -d \ -p 8091:8080 \ --link model-service \ --name training-service \ twxml/training-service:1.0.0 \ -Dmodel.destination.uri=model://model-service:8080/models \ -jar maven/training-standalone-1.0.0-bin.jar \ server maven/training-standalone-single.yml
Once the training is complete, each call to the monitor method throws an exception
com.thingworx.analytics.thingwatcher.exceptions.ThingWatcherOperationException: Unable to load the PMML model located at http://model-service:8080/models/1/pmml.xml
Followed by a load of inner exceptions.
I can see that http://localhost:8091/training/1 returns JSON that refers to the modelUri that it is trying to load however the host would get it at http://localhost:8090/models/1/pmml.xml so this doesn't work.
I tried to set it up without the model service and setting the model.destination.uri to a file URI as described in the documentation, but then the training service returns a file URI to the path in the container that the host cannot find so really it's the same problem.
I'm not very familiar with Docker so have I missed a step somewhere?