Epics@GSI Webhome

Docker Caen DT1470 Ioc Archiver Gui Setup

Introduction

DT1470.png

Issue of this project is to get a docker based EPICS system
with:
  • EPICS IOC connecting to an DT1470ET device
    • CAENs DT/N147x family can be connected via USB/ETH
  • Archiving the data with cs-studio archiver "beauty"
    • postgres-database
    • archive engine
  • Phoebus based GUI

Thanks to the groundwork of

... this was more or less finding out the right configuration and bits an peaces, no coding.

Status:
  • Implementation finished
  • To be tested May 2019, Jülich by C.Wendisch and J.Pietraszko.
  • Adopted to different contaniner 05-2021

Development:
  • reimplementing it with docker-compose

Setup and Operation

docker

resources

docker pull pklaus/beauty:db-latest
docker pull pklaus/beauty:app-latest
docker pull pklaus/epics_contapps
git clone https://git.gsi.de/EPICS/apps/caen_dt1470et.git && cd caen_dt1470et && git checkout docker-epics_contapps && cd - 

create network

#create common network
docker network create beauty-net

environment

cd <your local path, e.g ~/EPICS/apps/docker/CaenDT1470> &&
export LOCALPATH=$PWD 

IOC

    refers to local code compile with epics_contapps docker (not shown)
    compile
    docker run -i -t --name epics_contapps -v ${LOCALPATH}:/epics/iocs -w /epics/iocs/caen_dt1470et -u $(id -u):$(id -g) pklaus/epics_contapps bash
    
    # and enter
    make distclean && make 
    
    run
    run as internal docker user scs

    # run IOC
    docker run --name caenDT1470 \ 
      --restart always \ 
      --network beauty-net \ 
      --network-alias soft-ioc \ 
      -d \ 
      -it \ 
      -e CAEN_DT_1470_IP=192.168.103.66  \ 
      -p 1470:1470 \ 
      -v ${LOCALPATH}:/epics/iocs \ 
      -w /epics/iocs/caen_dt1470et/iocBoot/ioccaenDT1470 \ 
      -u scs \ 
      pklaus/epics_contapps \ 
      ../../bin/linux-x86_64/caenDT1470 ./st.cmd
    
    

Archiver-Database

database
local host's folder for database data
# Create a folder on the host for the archiver database
export ARCHIVER_DB=<path to archiver's database, e.g. ~/archiver_db>
  mkdir -p ${ARCHIVER_DB:?}

start database
docker run --name beauty-db \ 
  --restart always \ 
  --network beauty-net \ 
  -d \ 
  -e POSTGRES_USER=postgres \ 
  -e POSTGRES_PASSWORD=R4R9V2PXBx \ 
  -v ${ARCHIVER_DB:?}:/var/lib/postgresql/data   \ 
  -p 0.0.0.0:5432:5432 \ 
  pklaus/beauty:db-latest

Archiver engine

configure
# if engine is not already defined
# base is https://git.gsi.de/EPICS/apps/caen_dt1470et.git docker branch
#  dcs_engine.xml is connected to  ${LOCALPATH}/caen_dt1470et/archiver/configuration/DT1470.xml
#  pluginCustomization is connected to ${LOCALPATH}/caen_dt1470et/archiver/configuration/pluginCustomization.ini

# Fire up an instance of the RDB archiver application to initialize the database:                                                                        
docker run --name beauty-app \ 
  --network beauty-net \    
  -v ${LOCALPATH}/caen_dt1470et/archiver/configuration/pluginCustomization.ini:/archiver/pluginCustomization.ini \ 
  -v ${LOCALPATH}/caen_dt1470et/archiver/configuration/DT1470.xml:/archiver/dcs_engine.xml \ 
  -e engine_name=ArchiveEngine \ 
  -e engine_description=DT1470_Archiver \ 
  -it \ 
  pklaus/beauty:app-latest \ 
  /bin/sh

# and enter
./config/ArchiveConfigTool \ 
  -pluginCustomization ${pluginCustomization} \ 
  -engine ${engine_name} \ 
  -port ${engine_port} \ 
  -config ${engine_configuration_file} \ 
  -description ${engine_description} \ 
  ${engine_replace} \ 
  ${engine_steal_channels} \ 
  -import

start
docker run --name beauty-app \ 
--network beauty-net \ 
-v ${LOCALPATH}/caen_dt1470et/archiver/configuration/pluginCustomization.ini:/archiver/pluginCustomization.ini \ 
-v ${LOCALPATH}/caen_dt1470et/archiver/configuration/DT1470.xml:/archiver/dcs_engine.xml \ 
-e engine_name=ArchiveEngine \ 
-e engine_description=DT1470_Archiver \ 
-d \ 
-p 0.0.0.0:4812:4812 \ 
--restart=always \ 
pklaus/beauty:app-latest
NOTE
Philipp Klaus:
  • The database regularly needs an update of the partitioning schema, which must be executed by cronjob.
    I had forgotten this in the instructions before.
    For example, the following command must be executed regularly on the host machine running Docker:

docker exec beauty-db psql -U postgres -d archive -a -c "SELECT archive.sample_update_partitions ('2018-01-01' :: timestamp, 'archive', 'archive', 'week'); "

A corresponding crontab line like this:
0,1 * * * *  /usr/bin/docker exec beauty-db psql -U postgres -d archive -a -c "SELECT archive.sample_update_partitions('2018-01-01'::timestamp, 'archive', 'archive', 'week');"
_If this is not done, the database refuses to archive new values.

Greetings
Philipp_

Phoebus (heir of CS-studio)

compile
wget https://github.com/pklaus/beauty_docker/archive/master.zip
unzip master.zip
cd beauty_docker_master
./build.sh 

run
#start
# change settings if neccessary before start
cd ~${LOCALPATH}/beauty_docker-master/phoebus && ./run.sh
# connects with ~/EPICS/docker/phoebus to /home/scs/


-- PeterZumbruch - 2021-05-12
-- PeterZumbruch - 2021-05-12
Topic revision: r9 - 2021-05-12, PeterZumbruch - This page was cached on 2021-10-16 - 22:50.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Imprint (german) | Privacy Policy (german)