I currently have public preview access for the Azure Cognitive Services for Speech-To-Text as a docker container. This allows the container to be run on an IoT Edge device, rather than accessing the cloud to perform this service. This public preview came with installation instructions that show I can download an existing docker image of one of the containers and run it from a CLI using "docker run".
But I don't want to have to run the docker container manually on my IoT Edge devices. I want it to be automatically deployed to my IoT Edge devices and automatically start running. In order to do this, I believe that it needs to exist as an IoT Edge Module. Is my understanding correct?
So my question is more of an instructional question. Do I need to create my own IoT Edge Module that utilizes this ACS docker container, or is there some other way to automatically deploy it to my IoT Edge Device and have it start running automatically?
I was unable to find any documentation or examples online of deploying an existing docker container to an IoT Edge device. Any guidance would be greatly appreciated!
OK, after much digging, I found a solution. Whatever you do, don't search online for "create iot module from docker container" or anything COMPLETELY MEANINGFUL like that. Instead, I had to search for something very specific to the Azure Cognitive Service's EULA acceptance on the docker run (i.e. I had to search for "iot edge module docker \"eula\""). Note the quotation marks around eula to ensure it is in the search result. I came across this article.
Using the article's guidance, I will repeat in detail what I did here in case the link ever goes stale.
In the deployment.template.json file, under your new module's configuration settings, add the following.
"settings": {
"image": "containerpreview.azurecr.io/microsoft/cognitive-services-speech-to-text:latest",
"createOptions":
{
"Cmd": [
"Eula=accept",
"Billing={enter-your-EndpointURL}",
"ApiKey={enter-your-ApiKey}"
],
"HostConfig": {
"PortBindings": {
"5000/tcp": [
{
"HostPort": "5000"
}
]
}
}
}
This will be equivalent to running "docker run" from the command line with parameters like this:
docker run --rm -it -p 5000:5000 --memory 4g --cpus 1 \
containerpreview.azurecr.io/microsoft/cognitive-services-recognize-text \
Eula=accept \
Billing={BILLING_ENDPOINT_URI} \
ApiKey={BILLING_KEY}
Update: 2020/05/01
After submitting a request for better documentation from MSFT, they updated their docs site to include information on how to modify the deployment.template.json file to match the docker command line arguments: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-use-create-options