Files
2026-07-02 08:28:06 +02:00

38 lines
965 B
Bash

#!/bin/bash
SVC_ID=$1
SVC_NAME=$2
ENV=$3
set --
# TODO:
PSI_GFA_FACILITY=SLS
SERVICES_DIR=/sls/bd/hla/services
SVC_NAME_LOWER=${SVC_NAME,,}
SVC_DIR=${SERVICES_DIR}/${ENV}/${SVC_ID}-${SVC_NAME_LOWER}
# 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
# TODO: only for dev
export EPICS_CA_ADDR_LIST='sls-cagw.psi.ch:5062 129.129.146.88'
# 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