This component is responsible for managing communications between camera processor and interfaces using websockets.
The architecture of the application is made up of the following main components:
There are two ways to start the server:
Dependencies for running the main application are listed in requirements.txt; dependencies for running the tests are listed in requirements-test.txt. All dependencies should be installed with pip.
The following environment variables can be used:
| Variable | Description |
|---|---|
| SSL_CERT | A SSL certificate that should be used to create secure websockets. |
| SSL_KEY: | The private key for the given SSL certificate. |
| PUBLIC_KEY | The public key used for authentication. |
| AUDIENCE | The token audience. |
| CLIENT_ROLE | The role that should be present in tokens for access to the client socket. |
| PROCESSOR_ROLE | The role that should be present in tokens for access to the processor socket. |
| TRACKING_TIMEOUT | The optional time in seconds after which an object should automatically stop being tracked |
Communication with the orchestrator can be done over 2 websocket handlers channels:
Both sockets expect messages in json format. A message should contain at least a "type" property, which specifies the type of the message. The server does not respond if the type is unknown.
The client websocket knows the following types of messages:
"start": This command is used to start the tracking of an object in the specified frame, needs the following additional properties:
Of these properties, it is required that at least the "image" parameter, or, a combination of the "frameId" and "boxId" parameters are sent.
"stop" | This command is used to stop the tracking of an object, it needs the following additional property:
"setUsesImages" | This command is used to specify whether or not this client uses images and should therefore receive cutouts when they are sent alongside a "start" command. It needs the following property:
The processor websocket knows the following types of messages:
Finally, there is also a http handler that serves logging data of a given object. This data is located at
where ID is the id of the object of which the timeline is required.
Timeline tracking data is returned as a json with one property "data" that contains
an array of objects with a "timeStamp" property, and a "processorId" property containing the id of the
processor on which the object was detected.
The project contains two testing stages, unit testing and integration testing. Tests should be run through docker compose, as they may rely on other services which are handled in the compose file. The stages can be run as follows:
Content type
Image
Digest
Size
52.4 MB
Last updated
over 5 years ago
docker pull tracktech/orchestrator