Files
hla_framework_bd/bin/start_service.sh
T
Benjamin Labrecque 6b61b52c27
Deploy bin / deploy (push) Successful in 3s
Deploy, build and restart MASTER / deploy (push) Successful in 1s
Deploy agebd python package / deploy (push) Successful in 4s
chore: deploy script for all services
2026-07-07 09:00:51 +02:00

39 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
SVC_ID=$1
SVC_NAME=$2
ENV=$3
set --
# TODO:
# PSI_FACILITY=SLS
SERVICES_DIR=/sls/bd/hla/${AGEBD_ENV}/services
SVC_NAME_LOWER=${SVC_NAME,,}
SVC_DIR=${SERVICES_DIR}/${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
# to run `uv ...`
PATH="${HOME}/.local/bin:${PATH}"
APP_DIR=${SVC_DIR}/current/app
echo "App dir: ${APP_DIR}"
# (re)create venv using site-packages -- uses system-wide installed epics
uv venv --system-site-packages ${APP_DIR}/.venv --clear
# install custom python packages from pyproject.toml / uv.lock
uv sync --frozen --project ${APP_DIR}
# activate .venv, this works in conjunction with the conda environment
source ${APP_DIR}/.venv/bin/activate
python3 -u -B ${APP_DIR}/src/AGEBD-SERVICE-${SVC_NAME}.py