Giter Site home page Giter Site logo

paulscherrerinstitute / cam_record_server Goto Github PK

View Code? Open in Web Editor NEW
0.0 10.0 0.0 36 KB

Camera server for sending images in the image buffer.

License: GNU General Public License v3.0

Python 95.04% Batchfile 0.25% Shell 3.94% Dockerfile 0.77%
data-acquisition bsread

cam_record_server's Introduction

Build Status

Camera record server

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.

Table of content

  1. Quick start
  2. Build
    1. Conda setup
    2. Local build
    3. Docker build
  3. Basic concepts
  4. Configuration
  5. Web interface
    1. Python client
    2. REST API
  6. Running the servers
  7. Production configuration
  8. Examples
  9. Deploy in production

Quick start

Build

Conda setup

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.

Local build

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

Requirements

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

Docker build

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.

Basic concepts

Configuration

Web interface

Python client

REST API

Running the servers

Production configuration

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.

Examples

Deploy in production

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.

Production configuration

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

Setup the cam_record_server as a service

On the target system, copy docker/cam_record_server.service into /etc/systemd/system.

Then need to reload the systemctl daemon:

systemctl daemon-reload

Verifying the configuration

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

Run the servers

Using systemctl you then run both servers:

systemctl start cam_record_server.service

Inspecting server logs

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.

cam_record_server's People

Contributors

babicaa avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.