I am trying to operate DeepDetect (a machine learning server) in Docker [note this is not a DeepDetect question - it is simply a Bash question]. However, I am running into a more general Linux/bash problem that I am hoping to get help on.
Here is what I need to do:
From a shell script launched via Dockerfile ENTRYPOINT, Start DeepDetect server, block on it (it is a server so it should run forever). I want the script running this to be the root process, so that if it ever crashes, Docker will restart the container.
After the server is running, from the same script, send a curl as follows to the above now-running server:
curl -X PUT "http://localhost/services/age " -d '{ "mllib":"caffe", "description":"age classification", "type":"supervised", "parameters":{ "input":{ "connector":"image", "height":227, "width":227 }, "mllib":{ "nclasses":8 } }, "model":{ "repository":"/models/age_model" } }'
OK so here is my problem - how can I run the curl if the server is running forever? It seems like I need to somehow kickoff another process in the background before the server starts, that then comes back after the server starts and runs the above curl expression.
Does anyone have any idea how to accomplish this "call script in 30 seconds" issue? Any help is greatly appreciated!