We can now start the microservice and perform an HTTP request. From the command line, start the server as follows:
$ cd container/local_test
$ docker run -v $(pwd)/test_dir:/opt/ml -p 8080:8080 --rm rul-estimator serve
For your convenience, you can use also the following script: container/local_test/serve_local.sh rul-estimator.
Finally, from the command line, run the following command:
$ curl --data-binary @test.csv -H "Content-Type: text/csv" -v http://localhost:8080/invocations
For your convenience, you can use also the following script: container/local_test/serve_local.sh test.csv.
The expected output will look as follows:
$ < HTTP/1.1 100 Continue
…
$ < Server: nginx/1.10.3 (Ubuntu)
…
$ <
$ 113.80298
The residual life is 113.80, compared to 112, which is the expected value.