diff --git a/bin/start_service.sh b/bin/start_service.sh index d059fd0..1723242 100755 --- a/bin/start_service.sh +++ b/bin/start_service.sh @@ -33,4 +33,5 @@ uv sync --frozen --project ${APP_DIR} # activate .venv, this works in conjunction with the conda environment source ${APP_DIR}/.venv/bin/activate +# TODO: use `exec python3 ...` here? python3 -u -B ${APP_DIR}/src/AGEBD-SERVICE-${SVC_NAME}.py diff --git a/docs/python/epics.md b/docs/python/epics.md new file mode 100644 index 0000000..6ead5cb --- /dev/null +++ b/docs/python/epics.md @@ -0,0 +1,46 @@ +# EPICS + +Where is EPICS Base (https://gitea.psi.ch/epics) installed? +``` +echo $EPICS +``` + +Host architecture that EPICS Base runs on: +``` +echo $EPICS_HOST_ARCH +``` + +Which channel access lib is being used in python? +``` +[sls-vserv-bd-hla01-dev playground]$ python3 -c "import ctypes; import epics.ca; print(epics.ca.find_libca())" +/usr/local/epics/base-7.0.9/lib/RHEL9-x86_64/libca.so +``` + + +Example reading from a PV: +``` +[sls-vserv-bd-hla01-dev ~]$ /bin/python +Python 3.9.25 (main, Apr 17 2026, 00:00:00) +[GCC 11.5.0 20240719 (Red Hat 11.5.0-14)] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> from epics import PV +>>> pv = PV("AGEBD-PLAYGROUND-DEV:AO") +>>> pv.get() +5.0 +>>> +``` + +## System python installed packages + +``` +/bin/python -m pip list -v +``` + +## Systemd Services + +When ssh-ing into a machine, `/etc/profile.d/*` automatically gets sourced. + +When running a `systemd` service, this does not happen. + +That's why we need to source `/etc/profile.d/cas_12_epics.sh` in our startup script +to make sure that `EPICS` is configured properly. \ No newline at end of file diff --git a/docs/python/pixi.md b/docs/python/pixi.md new file mode 100644 index 0000000..f55b0e6 --- /dev/null +++ b/docs/python/pixi.md @@ -0,0 +1,9 @@ +# Pixi + +## Install + +``` +curl -fsSL https://pixi.sh/install.sh | sh +``` + +installs in `${HOME}/.pixi/bin` \ No newline at end of file