mirror of
https://github.com/paulscherrerinstitute/sf_daq_broker.git
synced 2026-05-08 01:12:03 +02:00
setup scripts for retrieval machine
This commit is contained in:
committed by
Data Backend account
parent
aac21f5d5e
commit
88f7e8a7df
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=SF DAQ broker
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
TimeoutStartSec=2
|
||||
ExecStart=/bin/bash ./home/dbe/service_scripts/sf-daq_broker.start.sh
|
||||
Restart=on-failure
|
||||
RestartSec=4
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
export PATH=/home/dbe/miniconda3/bin:$PATH
|
||||
|
||||
source /home/dbe/miniconda3/etc/profile.d/conda.sh
|
||||
|
||||
conda deactivate
|
||||
conda activate sf-daq
|
||||
|
||||
taskset -c 0 python /home/dbe/git/sf_daq_broker/sf_daq_broker/broker.py
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
export PATH=/home/dbe/miniconda3/bin:$PATH
|
||||
|
||||
source /home/dbe/miniconda3/etc/profile.d/conda.sh
|
||||
|
||||
conda deactivate
|
||||
conda activate sf-daq
|
||||
|
||||
M=$1
|
||||
|
||||
taskset -c $M python /home/dbe/git/sf_daq_broker/sf_daq_broker/writer/start.py --writer_id $M
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=SF DAQ writer
|
||||
|
||||
[Service]
|
||||
User=root
|
||||
ExecStart=/bin/bash ./home/dbe/service_scripts/sf-daq_writer.start.sh %i
|
||||
TimeoutStartSec=2
|
||||
Restart=on-failure
|
||||
RestartSec=4
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/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=sf-daq
|
||||
envtest=$(conda env list | grep ${CONDA_ENV_NAME})
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
echo "Creating the ${CONDA_ENV_NAME} environment"
|
||||
conda create -y -n ${CONDA_ENV_NAME} -c paulscherrerinstitute -c conda-forge data_api jungfrau_utils cadump
|
||||
|
||||
conda deactivate
|
||||
conda activate ${CONDA_ENV_NAME}
|
||||
|
||||
conda install -y -c conda-forge bottle pika ujson
|
||||
conda install -y -c slsdetectorgroup sls_detector
|
||||
else
|
||||
conda deactivate
|
||||
conda activate ${CONDA_ENV_NAME}
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -d /home/dbe/git ]; then
|
||||
echo "No git repo found, cloning it..."
|
||||
mkdir /home/dbe/git
|
||||
fi
|
||||
|
||||
REPO=sf_daq_broker
|
||||
if [ ! -d /home/dbe/git/${REPO} ]
|
||||
then
|
||||
cd /home/dbe/git && git clone \
|
||||
https://github.com/paulscherrerinstitute/${REPO}.git
|
||||
|
||||
echo "Setting up develop"
|
||||
cd /home/dbe/git/${REPO} && python setup.py develop
|
||||
|
||||
fi
|
||||
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/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
|
||||
|
||||
Reference in New Issue
Block a user