]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
restart_readout_service added to repo
authorPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Mon, 26 Aug 2019 09:07:15 +0000 (11:07 +0200)
committerPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Mon, 26 Aug 2019 09:07:15 +0000 (11:07 +0200)
python_suite/restart_readout_service/Dockerfile [new file with mode: 0644]
python_suite/restart_readout_service/build.sh [new file with mode: 0755]
python_suite/restart_readout_service/restart_readout.sh [new file with mode: 0755]
python_suite/restart_readout_service/run_restart_service.sh [new file with mode: 0755]

diff --git a/python_suite/restart_readout_service/Dockerfile b/python_suite/restart_readout_service/Dockerfile
new file mode 100644 (file)
index 0000000..209ba8c
--- /dev/null
@@ -0,0 +1,38 @@
+FROM pklaus/epics_base:debian-stretch
+
+ARG USERNAME
+RUN test -n "$USERNAME" || (>&2 echo "--build-arg USERNAME=myusername    is mandatory" && false)
+ENV USERNAME=$USERNAME
+
+ARG PASSWORD
+RUN test -n "$PASSWORD" || (>&2 echo "--build-arg PASSWORD=mypassword    is mandatory" && false)
+ENV PASSWORD=$PASSWORD
+
+ARG EPICS_CA_ADDR_LIST
+RUN test -n "$EPICS_CA_ADDR_LIST" || (>&2 echo "--build-arg EPICS_CA_ADDR_LIST=192.168.111.222    is mandatory" && false)
+ENV EPICS_CA_ADDR_LIST=$EPICS_CA_ADDR_LIST
+
+USER root
+
+# Installing different required Debian packages:
+RUN apt-get update \
+ && apt-get install --no-install-recommends -yq \
+  python3 \
+  python3-dev \
+  python3-setuptools \
+  python3-wheel \
+  python3-pip \
+  # to get the repo:
+  git \
+ && apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt
+
+RUN ln -s /usr/bin/python3 /usr/bin/python \
+ && ln -s /usr/bin/pip3 /usr/bin/pip
+
+RUN git clone https://github.com/pklaus/assert_epics_value_updates.git
+WORKDIR assert_epics_value_updates
+RUN pip install -r requirements.txt
+ADD restart_readout.sh .
+ADD run_restart_service.sh .
+
+CMD /bin/bash -c ./run_restart_service.sh
diff --git a/python_suite/restart_readout_service/build.sh b/python_suite/restart_readout_service/build.sh
new file mode 100755 (executable)
index 0000000..c82ce72
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+echo "Please state username and password..."
+echo "for the testgui at http://jspc55.x-matter.uni-frankfurt.de/mvdsensorcontrol/tools/testgui.pl?setup=PRESTO_2018_readout.xml"
+echo "MIMOSA is the key!"
+
+echo -n "USERNAME: "
+read username
+
+echo -n "PASSWORD: "
+read -s password
+
+echo ""
+echo "username:password is $username:$password"
+
+
+echo "HOST on which the mvd_trbnet IOC is running"
+echo "(goes into environment variable EPICS_CA_ADDR_LIST):"
+echo -n "EPICS_CA_ADDR_LIST: "
+read epics_ca_addr_list
+
+docker build --build-arg USERNAME=$username --build-arg PASSWORD=$password --build-arg EPICS_CA_ADDR_LIST=$epics_ca_addr_list -t pklaus/mvd_restart_readout_service .
diff --git a/python_suite/restart_readout_service/restart_readout.sh b/python_suite/restart_readout_service/restart_readout.sh
new file mode 100755 (executable)
index 0000000..481c5fd
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+curl -u "$USERNAME:$PASSWORD" 'http://jspc55.x-matter.uni-frankfurt.de/mvdsensorcontrol/tools/run.pl?runtime=0.2&setupFile=%2Flocal.1%2Fhtdocs%2Fmvdsensorcontrol%2F..%2Fmvdconfig%2Fsetup%2F%2FPRESTO_2018_readout.xml'
diff --git a/python_suite/restart_readout_service/run_restart_service.sh b/python_suite/restart_readout_service/run_restart_service.sh
new file mode 100755 (executable)
index 0000000..1f1e0a5
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+./assert_epics_value_updates.py  \
+ --pv CBM:MVD:TRB:Mvd-0xd010-DataLength.0 \
+ --pv CBM:MVD:TRB:Mvd-0xd010-DataLength.1 \
+ --pv CBM:MVD:TRB:Mvd-0xd011-DataLength.0 \
+ --pv CBM:MVD:TRB:Mvd-0xd011-DataLength.1 \
+ --pv CBM:MVD:TRB:Mvd-0xd012-DataLength.0 \
+ --pv CBM:MVD:TRB:Mvd-0xd012-DataLength.1 \
+ --pv CBM:MVD:TRB:Mvd-0xd013-DataLength.0 \
+ --pv CBM:MVD:TRB:Mvd-0xd013-DataLength.1 \
+ --script ./restart_readout.sh