Cam record server is bsread based streaming proxy that acts as an interface between cam_server and the ImageBuffer. It needs to convert a PUB/SUB stream to a PUSH/PULL and make all the data in the stream ImageBuffer compliant.
- Quick start
- Build
- Basic concepts
- Configuration
- Web interface
- Running the servers
- Production configuration
- Examples
- Deploy in production
If you use conda, you can create an environment with the cam_record_server library by running:
conda create -c paulscherrerinstitute --name <env_name> cam_record_server
After that you can just source you newly created environment and start using the server.
You can build the library by running the setup script in the root folder of the project:
python setup.py install
or by using the conda also from the root folder of the project:
conda build conda-recipe
conda install --use-local cam_record_server
The library relies on the following packages:
- cam_server
In case you are using conda to install the packages, you might need to add the paulscherrerinstitute channel to your conda config:
conda config --add channels paulscherrerinstitute
Warning: When you build the docker image with build.sh, your built will be pushed to the PSI repo as the latest cam_record_server version. Please use the build.sh script only if you are sure that this is what you want.
To build the docker image, run the build from the docker/ folder:
./build.sh
Before building the docker image, make sure the latest version of the library is available in Anaconda.
Please note: There is no need to build the image if you just want to run the docker container. Please see the Docker Container chapter.
The production configurations are not part of this repository but are available on:
You can download it using git:
git clone https://git.psi.ch/controls_highlevel_applications/cam_server_configuration.git
And later, when you start the docker container, map the configuration using the -v parameter:
docker run --net=host -it -v /CURRENT_DIR/cam_server_configuration/configuration:/configuration docker.psi.ch:5000/cam_server
WARNING: Docker needs (at least on OSX) a full path for the -v option. Replace the CURRENT_DIR with your actual path.
Before deploying in production, make sure the latest version was tagged in git (this triggers the Travis build) and that the Travis build completed successfully (the new cam_record_server package in available in anaconda). After this 2 steps, you need to build the new version of the docker image (the docker image checks out the latest version of cam_record_server from Anaconda). The docker image version and the cam_record_server version should always match - If they don't, something went wrong.
Login to the target system, where cam_record_server will be running. Checkout the production configuration into the root of the target system filesystem.
cd /
git clone https://git.psi.ch/controls_highlevel_applications/cam_server_configuration.git
On the target system, copy docker/cam_record_server.service into /etc/systemd/system.
Then need to reload the systemctl daemon:
systemctl daemon-reload
On the target system, copy docker/validate_configs.sh into your home folder. Run it to verify if the deployed configurations are valid for the current version of the cam_record_server.
./validate_configs.sh
Using systemctl you then run both servers:
systemctl start cam_record_server.service
To inspect the logs for each server, use journalctl:
journalctl -u cam_record_server.service
Note: The '-f' flag will make you follow the log file.