adaptation of scripts to run on sf-daq-4

This commit is contained in:
Dmitry Ozerov
2020-11-04 09:23:09 +01:00
committed by Data Backend account
parent 344ea97008
commit fe39841df9
9 changed files with 112 additions and 12 deletions
+9 -5
View File
@@ -8,14 +8,18 @@ fi
M=$1
# Add ourselves to the user cpuset.
echo $$ > /sys/fs/cgroup/cpuset/user/tasks
H=`echo ${HOSTNAME} | sed 's/.psi.ch//'`
#coreAssociatedBuffer=(25 25 26 26 27 27 28 28 29)
coreAssociatedBuffer=(1 2 2 3 3 4 4 5 5)
case ${H} in
'sf-daq-4')
coreAssociatedBuffer=(11 12 13 14 15 16 17 18 19)
;;
*)
CORES=(25 25 26 26 27 27 28 28 29)
esac
initialUDPport=50020
port=$((${initialUDPport}+10#${M}))
DETECTOR=JF02T09V02
taskset -c ${coreAssociatedBuffer[10#${M}]} /usr/bin/sf_buffer ${DETECTOR} M${M} ${port} /gpfs/photonics/swissfel/buffer/${DETECTOR} ${M}
taskset -c ${coreAssociatedBuffer[10#${M}]} /usr/local/bin/sf_buffer ${DETECTOR} M${M} ${port} /gpfs/photonics/swissfel/buffer/${DETECTOR} ${M}
+1 -1
View File
@@ -8,7 +8,7 @@ BindsTo=JF02-buffer.service
PermissionsStartOnly=true
Type=idle
User=root
ExecStart=/usr/bin/sh /home/writer/git/sf_daq_buffer/scripts/JF02-buffer-worker.sh %i
ExecStart=/usr/bin/sh /home/dbe/service_scripts/JF02-buffer-worker.sh %i
TimeoutStartSec=10
RestartSec=10
+1 -1
View File
@@ -3,7 +3,7 @@ Description=All UDP-buffer instances of JF02
[Service]
Type=oneshot
ExecStart=/usr/bin/sh /home/writer/git/sf_daq_buffer/scripts/JF02-buffer-worker.sh
ExecStart=/usr/bin/sh /home/dbe/service_scripts/JF02-buffer-worker.sh
RemainAfterExit=yes
[Install]
+2 -2
View File
@@ -5,10 +5,10 @@ Description=stream service (to streamvis and live analysis) of JF02
PermissionsStartOnly=true
Type=idle
User=root
ExecStart=/usr/bin/sh /home/writer/git/sf_daq_buffer/scripts/JF02-stream.sh
ExecStart=/usr/bin/sh /home/dbe/service_scripts/JF02-stream.sh
TimeoutStartSec=10
Restart=on-failure
RestartSec=10
RestartSec=2
[Install]
WantedBy=multi-user.target
+10 -3
View File
@@ -1,5 +1,12 @@
#!/bin/bash
echo $$ > /sys/fs/cgroup/cpuset/user/tasks
coreAssociated="33,34,35"
taskset -c ${coreAssociated} /usr/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF02.json
H=`echo ${HOSTNAME} | sed 's/.psi.ch//'`
case ${H} in
'sf-daq-4')
coreAssociated="33,34,35"
;;
*)
coreAssociated="12"
esac
taskset -c ${coreAssociated} /usr/local/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF02.json
+13
View File
@@ -0,0 +1,13 @@
[Unit]
Description=streamvis: JF02
[Service]
User=root
TimeoutStartSec=2
ExecStart=/bin/bash ./home/dbe/service_scripts/JF02-vis.sh
Restart=on-failure
RestartSec=4
[Install]
WantedBy=multi-user.target
+28
View File
@@ -0,0 +1,28 @@
export PATH=/home/dbe/miniconda3/bin:$PATH
source /home/dbe/miniconda3/etc/profile.d/conda.sh
conda deactivate
conda activate vis
PORT=5002
PORT_BACKEND=9002
H=`echo ${HOSTNAME} | sed 's/.psi.ch//'`
BACKEND=${H}
case ${H} in
'sf-daq-4')
CORES='36,37'
;;
*)
CORES='2'
esac
taskset -c ${CORES} \
streamvis alvra --allow-websocket-origin=${H}:${PORT} \
--allow-websocket-origin=sf-daq-alvra:${PORT} --port=${PORT} \
--address tcp://${BACKEND}:${PORT_BACKEND} \
--page-title 4p5M_Alvra
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# needed, otherwise executing with Ansible won't work
# see: https://github.com/conda/conda/issues/7267
unset SUDO_UID SUDO_GID SUDO_USER
if [ ! -d /home/dbe/git ]; then
echo "No git repo found, cloning it..."
mkdir /home/dbe/git
fi
REPO=sf_daq_buffer
if [ ! -d /home/dbe/git/${REPO} ]; then
cd /home/dbe/git && git clone https://github.com/paulscherrerinstitute/${REPO}.git
source /opt/rh/devtoolset-9/enable
cd /home/dbe/git/${REPO} && mkdir -p build && cd build/ && cmake3 .. && make
fi
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
# needed, otherwise executing with Ansible won't work
# see: https://github.com/conda/conda/issues/7267
unset SUDO_UID SUDO_GID SUDO_USER
if [ ! -f /home/dbe/miniconda3/bin/conda ]
then
echo "Getting Miniconda"
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh Miniconda3-latest-Linux-x86_64.sh -b -p /home/dbe/miniconda3
rm -rf Miniconda3-latest-Linux-x86_64.sh
fi
# Setup the conda environment.
export PATH=/home/dbe/miniconda3/bin:$PATH
source /home/dbe/miniconda3/etc/profile.d/conda.sh
CONDA_ENV_NAME=vis
envtest=$(conda env list | grep ${CONDA_ENV_NAME})
if [ $? != 0 ]; then
echo "Creating the ${CONDA_ENV_NAME} environment"
conda create -n vis -y -c paulscherrerinstitute -c conda-forge streamvis
fi