Metropolis Microservices/RidgeRun Services/PTZ: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 26: Line 26:
</pre>
</pre>


Then you will have the service with the following options:
<pre>
usage: ptz [-h] [--port PORT] [--host HOST]
options:
-h, --help  show this help message and exit
--port PORT  Port for server
--host HOST  Server ip address
</pre>
==PTZ Microservice Docker==
Before starting with docker support make sure you have nvidia runtime in your system. Follow [https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#configuration | these instructions] to have docker up and runing in your Jetson Board.
===Build the container===
We can build the ptz microservice container using the Dockerfile in the docker directory. This includes a base NVIDA image and the dependencies to run the ptz microservice application.
First, we need to prepare the context directory for this build, please create a directory and include all the needed repositories (listed below). The Dockerfile will look for all the source code in the context directory and copy them to the container.
<pre>
ptz-context/
.
├── gst-cuda
├── gst-rr-panoramaptz
├── gst-rtsp-sink
├── libpanorama
├── ptz
└── rrms-utils
</pre>
Then build the container image running the the following command from the folder containing the Dockerfile and context directory:
<pre>
sudo docker build \
--network=host \
-f Dockerfile \
-t ridgerun/ptz-service:latest ptz-context/
</pre>
Change '''ptz-context''' to your context's path and the tag (-t) to the name you want to give to your image.
===Launch the container===
The container can be launched by running the following command:
<pre>
sudo docker run --runtime nvidia -it --privileged --net=host --ipc=host --name ptz-service  ridgerun/ptz-service:latest
</pre>
You can modify the name you want to give to your container with the option '''--name'''.
Here we are creating a container called '''ptz-service''' that will start the ptz-service application in the default address and path. If a different address and port have to be used, you can do it by running:
<pre>
sudo docker run --runtime nvidia -it --privileged --net=host --ipc=host --name ptz-service  ridgerun/ptz-service:latest --host=HOST --port=PORT
</pre>


<noinclude>
<noinclude>
{{Metropolis Microservices/Foot||}}
{{Metropolis Microservices/Foot||}}
</noinclude>
</noinclude>
89

edits