3,072
edits
Efernandez (talk | contribs) |
Efernandez (talk | contribs) |
||
Line 157: | Line 157: | ||
==== Pre-build Image ==== | ==== Pre-build Image ==== | ||
{{message|[https://www.ridgerun.com/contact Contact Ridgerun] if you want an evaluation version of the | {{message|[https://www.ridgerun.com/contact Contact Ridgerun] if you want an evaluation version of the engagement analytics service docker image.}} | ||
Once you have obtained the | Once you have obtained the engagement-analytics-service docker image, you can install it in your jetson with the following command: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
docker load < | docker load < engagement-analytics-service.tar.gz | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== Build Image ==== | ==== Build Image ==== | ||
{{message|[https://www.ridgerun.com/contact Contact Ridgerun] if you want access to the | {{message|[https://www.ridgerun.com/contact Contact Ridgerun] if you want access to the engagement analytics service source code.}} | ||
You can build the | You can build the engagement analytics service image using the Dockerfile in the docker directory. First, we need to prepare the context directory for this build. You need to create a directory and include this repository and the remaining dependencies. The Dockerfile will look for all the packages in the context directory and copy them to the container. | ||
After this, your context directory should look like this: | After this, your context directory should look like this: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
analytics-context/ | |||
├── | ├── engagement-analytics | ||
└── rrms-utils | └── rrms-utils | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 187: | Line 187: | ||
}} | }} | ||
Then build the container image with the following command: | Then, build the container image with the following command: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
docker build \ | docker build \ | ||
--network=host \ | --network=host \ | ||
- | --tag ridgerun/engagement-analytics-service \ | ||
- | -f Dockerfile analytics-context/ | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Change | Change analytics-context/ to your context's path and the tag to the name you want to give to the image. | ||
==== Launch the container ==== | ==== Launch the container ==== | ||
Line 211: | Line 210: | ||
nvidia@ubuntu:~$ docker images | nvidia@ubuntu:~$ docker images | ||
REPOSITORY TAG | REPOSITORY TAG | ||
ridgerun/ | ridgerun/engagement-analytics-service latest | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 217: | Line 216: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
docker run -it \ | |||
docker run | |||
-it \ | |||
--network host \ | --network host \ | ||
- | --volume <path to directory containing your configuration file>:/configs \ | ||
--name | -e INFLUXDB_TOKEN=<your influx db token> \ | ||
ridgerun/ | --name engagement-analytics-service \ | ||
ridgerun/engagement-analytics-service:latest \ | |||
--config-file /configs/<your configuration file name> \ | |||
--retry | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Here we are creating a container called engagement-analytics-service that will start the engagement analytics service application (check [[Metropolis_Microservices/RidgeRun_Services/Engagement Analytics#Using_Standalone_Application|Using Standalone Application]]), launching the server in 127.0.0.1 and port 5053. When the service starts, it will communicate with both redis and influxdb, so make sure both services are running. | |||
- | |||
After starting the service, you should see an entry with the engagement-analytics-service container: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
nvidia@ubuntu:~$ docker ps | nvidia@ubuntu:~$ docker ps | ||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
258b111a9721 ridgerun/engagement-analytics-service "engagement-analytics…" 2 hours ago Up 5 minutes engagement-analytics-servvice | |||
</syntaxhighlight> | </syntaxhighlight> | ||