This page offers an overview about what a service could be (or not) and the (detailed) steps of how to integrate it a service into the SIC Framework. Become familiar with what a service could (not) be by checking out Services - Restructured . The code for all the existing services can be found at https://bitbucket.org/socialroboticshub/processing/src/master/.
What Is (Not) a Service?
Do’s
A service is required to:
use input from a device and/or another service
do more than 1 line of code in processing
give output that is useful for another service and/or an application
Additionally, it should be reusable/generic (i.e. more than 1 specific application can make use of the service).
Do’nts
A service should only relate to the software aspect of the SIC framework. An example of what would NOT count as a service is integrating both a third-party device (e.g.: smartwatch) and the data collected from it into an application. In this case, the device should be added separately as one, and the data collection and processing should be turned into a service itself.
Summary How to Add a Service to the SIC Framework
...
Summary How to Add a Service to the SIC Framework
create a new folder in https://bitbucket.org/socialroboticshub/processing/src/master/ with the name of the service
copy the certificate file https://bitbucket.org/socialroboticshub/docker/src/master/sic/beamforming/cert.pem from any of the other services' folders into the service’s folder
copy any additional files that the services may need into the service’s folder
create a factory file inheriting from the
SICfactory
in the service’s folder, and override the superclass’s methodscreate a service file inheriting from
SICservice
in the service’s folder, and override the superclass’s methodsupdate the https://bitbucket.org/socialroboticshub/processing/src/master/ with the name of the servicecopy the certificate file deploy_to_docker.sh file in the root folder with the new service files
deploy the new service to the https://bitbucket.org/socialroboticshub/docker/src/master/sic/beamforming/cert.pem from any of the other services' folders into the service’s folder
copy any additional files that the services may need into the service’s folder
create a factory file inheriting from the
SICfactory
in the service’s folder, and override the superclass’s methodscreate a service file inheriting from
SICservice
in the service’s folder, and override the superclass’s methodsupdate the folder by running the
deploy_to_docker.sh
fileupdate the https://bitbucket.org/socialroboticshub/docker/src/master/docker-compose.yml file in the
docker
folder with the new serviceupdate the https://bitbucket.org/socialroboticshub/processingdocker/src/master/deploy_to_docker.shDockerfile.python3 file in the root
docker
folder with the new service filesdeploy the new service to service’s dependenciesupdate the topics in the constructor of the Abstract Connector from the https://bitbucket.org/socialroboticshub/dockerconnectors/src/master/ folder by running the
deploy_to_docker.sh
fileupdate the https://bitbucket.org/socialroboticshub/docker/src/master/docker-compose.yml file in the
docker
folder with the new serviceupdate the https://bitbucket.org/socialroboticshub/docker/src/master/Dockerfile.python3 file in the
docker
folder with the new service’s dependenciesupdate the topics in the constructor of the Abstract Connector from the https://bitbucket.org/socialroboticshub/connectors/src/master/python/social_interaction_cloud/ folder with the name of the new service
update the device listeners in
enable_service
in the Abstract Connector with the serviceupdate the listened to channels in
__listen
in the Abstract Connector with the servicecreate the corresponding event handler method for the service in the Abstract Connector
create the corresponding event handler method for the service in the Basic Connector
use the service in a new file
The detailed explanation of these steps with a sentiment analysis example can be found below:
...
/python/social_interaction_cloud/ folder with the name of the new service
update the device listeners in
enable_service
in the Abstract Connector with the serviceupdate the listened to channels in
__listen
in the Abstract Connector with the servicecreate the corresponding event handler method for the service in the Abstract Connector
create the corresponding event handler method for the service in the Basic Connector
use the service in a new file
The detailed explanation of these steps with a sentiment analysis example can be found below:
Detailed How to Add a (Sentiment) Service to the SIC Framework
There are two shared libraries that handle a lot of the common logic that is needed to interact with our framework: one for Python-based integrations and one for Java-based integrations (using Maven). In order to allow users to run services without worrying about compatibility and installations, Docker Compose is used.
If a service is not simply an alternative to an existing service, adding a new service will also require updates to the connectors (EIS and Python) in order to be fully integrated.
create a new folder in https://bitbucket.org/socialroboticshub/processing/src/master/ with the name of the service.
sentiment_analysis
(https://bitbucket.org/socialroboticshub/docker/src/master/sic/sentiment/ ) will be used as the example folder and service in this casecopy the certificate file https://bitbucket.org/socialroboticshub/docker/src/master/sic/beamforming/cert.pem from any of the other services' folders into the
sentiment
foldercopy the https://bitbucket.org/socialroboticshub/docker/src/master/sic/sentiment/classifier.pickle into the
sentiment
foldercreate a https://bitbucket.org/socialroboticshub/docker/src/master/sic/sentiment/sentiment_factory.py file in the
sentiment
folder
...