Files
hla_framework_bd/bin/start_service.sh
T
2026-07-01 16:48:27 +02:00

33 lines
880 B
Bash

#!/bin/bash
SVC_ID=$1
SVC_NAME=$2
ENV=$3
set --
PSI_GFA_FACILITY=SLS
HLA_DIR=/sls/bd/hla
SVC_DIR=${HLA_DIR}/${ENV}/${SVC_ID}-${SVC_NAME}
export EPICS_CA_ADDR_LIST='sls-cagw.psi.ch:5062 129.129.146.88'
# gfa_12_epics.sh died on the 16.04.2026 due to required AFS write access
#. /etc/profile.d/gfa_12_epics.sh
#. /sls/bd/exchange/BeamData/user/felix/workarounds/epicsRHEL8.rc # temporary fix
. /etc/profile.d/cas_12_epics.sh
# activate conda environment
. /opt/gfa/python-3.10/latest/bin/activate
pip install uv
cd ${SVC_DIR}/app
# create venv using site-packages -- uses system-wide installed epics
uv venv --system-site-packages .venv
# install custom python packages from pyproject.toml / uv.lock
uv sync --frozen
# activate .venv, this works in conjunction with the conda environment
source .venv/bin/activate
python3 -u -B ${SVC_DIR}/app/AGEBD-SERVICE-${SVC_NAME}.py