Files
hla_framework_bd/search.json
T

1 line
29 KiB
JSON

{"config":{"separator":"[\\s\\-_,:!=\\[\\]()\\\\\"`/]+|\\.(?!\\d)"},"items":[{"location":"","level":1,"title":"Overview","text":"<p>Documentation for the SLS 2.0 High Level Applications Framework</p>","path":["Overview"],"tags":[]},{"location":"developer/caget/","level":1,"title":"Using <code>caget</code> to check the values of PVs","text":"<pre><code>ssh sls-lc\n</code></pre> <p>On sls-lc or sls-vserv-bd-hla01-dev: <pre><code>ca office network\nexport EPICS_CA_ADDR_LIST=\"129.129.130.255 129.129.131.255 129.129.137.255 129.129.158.255 129.129.217.255 129.129.150.255 129.129.152.255 sls-cagw.psi.ch:5062\"\ncaget AGEBD-PLAYGROUND-DEV:AO\n</code></pre></p>","path":["Developer","Using caget to check the values of PVs"],"tags":[]},{"location":"developer/cicd_runner/","level":1,"title":"CI/CD Runner","text":"","path":["Developer","CI/CD Runner"],"tags":[]},{"location":"developer/cicd_runner/#hosts","level":2,"title":"Hosts","text":"<ul> <li><code>sls-vserv-bd-01(-dev)</code><ul> <li>Runs the shellbox commands, which the runner triggers over <code>ssh</code> (see <code>.gitea/scripts/ioc-start.sh</code>)</li> </ul> </li> <li><code>sls-vserv-bd-hla01(-dev)</code><ul> <li>Runs the runner itself, and therefore everything else: the deployments to <code>/sls/bd/hla/&lt;env&gt;/</code> and the <code>ioc ...</code> commands</li> </ul> </li> </ul>","path":["Developer","CI/CD Runner"],"tags":[]},{"location":"developer/cicd_runner/#install-the-runner","level":2,"title":"Install the runner","text":"<pre><code>sudo dnf install act-runner\n</code></pre>","path":["Developer","CI/CD Runner"],"tags":[]},{"location":"developer/cicd_runner/#setup","level":2,"title":"Setup","text":"<p>Resources:</p> <ul> <li>https://docs.gitea.com/usage/actions/act-runner</li> <li>https://linux.psi.ch/documentation/services/gitea/gitea-runner/</li> </ul> <p>Register the runner: (by default the name is the machine name <code>sls-vserv-bd-hla01-dev.psi.ch</code>) <pre><code>sudo su svcusr-sls2hla\nmkdir ~/gitea-runner\ncd ~/gitea-runner\n/usr/local/bin/act_runner generate-config | sudo tee /etc/act_runner/config.yaml &gt; /dev/null\n/usr/local/bin/act_runner --config /etc/act_runner/config.yaml register --instance https://gitea.psi.ch/ --labels &lt;labels&gt; --token &lt;token&gt; --no-interactive\n</code></pre></p> <p>where we used <code>hla-dev</code> or <code>hla-prod</code> for the labels.</p> <p>Note, if you use a systemd service with a config file as in the example below, the labels will be read from that file.</p> <p>This generates a <code>.runner</code> file.</p> <p>Set up deployment dirs (not directly related to the gitea cicd runner setup) <pre><code>mkdir /sls/bd/hla\nchmod 755 /sls/bd/hla\n...\n</code></pre></p> <p>Install Node -- required for actions like repo checkout (TODO: was not done on <code>prod</code> runner <code>sls-vserv-bd-hla01</code> yet → no internet access) <pre><code>mkdir ~/.local/bin\n\ncd /tmp\ncurl -LO https://nodejs.org/dist/v20.11.1/node-v20.11.1-linux-x64.tar.xz\ntar -xf node-v20.11.1-linux-x64.tar.xz --strip-components=2 -C ~/.local/bin/ node-v20.11.1-linux-x64/bin/\nrm node-v20.11.1-linux-x64.tar.xz\n</code></pre></p>","path":["Developer","CI/CD Runner"],"tags":[]},{"location":"developer/cicd_runner/#manually-run-the-runner","level":2,"title":"Manually run the runner","text":"<pre><code>sudo su svcusr-sls2hla\n/usr/local/bin/act_runner daemon\n</code></pre>","path":["Developer","CI/CD Runner"],"tags":[]},{"location":"developer/cicd_runner/#run-the-runner-as-a-systemd-service","level":2,"title":"Run the runner as a systemd service","text":"<p>Edit the service file <code>/etc/systemd/system/act_runner.service</code>:</p> <pre><code>[Unit]\nConditionPathExists=/etc/act_runner/config.yaml\nDescription=Gitea Actions runner\nDocumentation=https://gitea.com/gitea/act_runner\nAfter=podman.socket\nRequires=podman.socket\n\n[Service]\nUser=svcusr-sls2hla\nWorkingDirectory=/home/svcusr-sls2hla/gitea-runner\nEnvironment=\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/svcusr-sls2hla/.local/bin\"\nExecStart=/usr/local/bin/act_runner daemon --config /etc/act_runner/config.yaml\nExecReload=/bin/kill -s HUP $MAINPID\nTimeoutSec=0\nRestartSec=10\nRestart=always\n\n[Install]\nWantedBy=multi-user.target\n</code></pre> <p>As your own user (not <code>svcusr-sls2hla</code>; need access to sudo): <pre><code># 1. Install Podman\nsudo dnf install -y podman\n\n# 2. Enable and start the system-wide Podman socket\nsudo systemctl enable --now podman.socket\n\n# 3. Create the symlink so the Gitea runner finds Podman at the expected Docker path\nsudo ln -s /run/podman/podman.sock /var/run/docker.sock\n\n# 4. Create podman group\nsudo groupadd podman\n\n# 5. Add service user to this new group\nsudo usermod -aG podman svcusr-sls2hla\n</code></pre></p> <p>Configure podman socket: <pre><code>sudo systemctl edit podman.socket\n</code></pre> add this to the file:</p> <pre><code>[Socket]\nSocketMode=0660\nSocketGroup=podman\n</code></pre> <p>Created uv cache dir, for <code>UV_CACHE_DIR</code>:</p> <pre><code>sudo mkdir -m 777 /var/cache/uv\n</code></pre> <p>Change the location of the act cache and working directory (uv .venvs are built here, take up lots of space)</p> <pre><code>sudo mkdir -m 777 /var/lib/act_runner/cache\nsudo mkdir -m 777 /var/lib/act_runner/work\n</code></pre> <p>and edit <code>/etc/act_runner/config.yaml</code></p> <pre><code>cache:\n dir: \"/var/lib/act_runner/cache\"\nhost:\n # The parent directory of a job's working directory.\n # If it's empty, $HOME/.cache/act/ will be used.\n workdir_parent: \"/var/lib/act_runner/work\"\n</code></pre> <p>Configure the runner labels: (edit <code>/etc/act_runner/config.yaml</code>)</p> <pre><code>runner:\n labels:\n - \"hla-dev\" # or \"hla-prod\"\n</code></pre> <p>Enable and restart:</p> <pre><code># Enable act_runner\nsudo systemctl enable --now act_runner\n\n# Reload configurations\nsudo systemctl daemon-reload\n\n# Restart the socket so it applies the new group owner\nsudo systemctl restart podman.socket\n\n# Fire up the runner\nsudo systemctl restart act_runner.service\n</code></pre>","path":["Developer","CI/CD Runner"],"tags":[]},{"location":"developer/cicd_runner/#check-logs-of-systemd-service","level":3,"title":"Check logs of systemd service","text":"<pre><code>sudo su svcusr-sls2hla\njournalctl -u act_runner.service -n 20\n</code></pre> <p>Should show </p> <pre><code>Jul 24 10:05:30 sls-vserv-bd-hla01-dev.psi.ch act_runner[3662214]: time=\"2026-07-24T10:05:30+02:00\" level=info msg=\"Starting runner daemon\"\nJul 24 10:05:30 sls-vserv-bd-hla01-dev.psi.ch act_runner[3662214]: time=\"2026-07-24T10:05:30+02:00\" level=info msg=\"labels updated to: [hla-dev:host]\"\nJul 24 10:05:30 sls-vserv-bd-hla01-dev.psi.ch act_runner[3662214]: time=\"2026-07-24T10:05:30+02:00\" level=info msg=\"runner: sls-vserv-bd-hla01-dev.psi.ch, with version: v2.0.0, with labels: [hla-dev], declare successfully\"\n...\n</code></pre>","path":["Developer","CI/CD Runner"],"tags":[]},{"location":"developer/cicd_runner/#user","level":2,"title":"User","text":"<p>The gitea actions run as user <code>svcusr-sls2hla</code></p>","path":["Developer","CI/CD Runner"],"tags":[]},{"location":"developer/cicd_runner/#auth","level":2,"title":"Auth","text":"","path":["Developer","CI/CD Runner"],"tags":[]},{"location":"developer/cicd_runner/#todo-this-is-a-temporary-workaround","level":3,"title":"#TODO: this is a temporary workaround","text":"<p>I created an ssh key on <code>sls-vserv-bd-hla01-dev</code> (where the runner runs), and added the public key to my gitea profile ssh keys. That way the <code>svcusr</code> can clone the repos I can clone.</p>","path":["Developer","CI/CD Runner"],"tags":[]},{"location":"developer/cicd_runner/#setup-sls-vserv-bd-01-dev","level":2,"title":"Setup <code>sls-vserv-bd-01-dev</code>","text":"<p>On <code>sls-vserv-bd-hla01-dev</code></p> <pre><code>sudo su - svcusr-sls2hla\ncat ~/.ssh/id_ed25519.pub\n</code></pre> <p>If it does not exist yet: <pre><code>sudo su - svcusr-sls2hla\nssh-keygen -t ed25519 -N \"\" -C \"svcusr-sls2hla@sls-vserv-bd-hla01-dev\" -f ~/.ssh/id_ed25519\ncat ~/.ssh/id_ed25519.pub\n</code></pre></p> <pre><code>ssh sls-vserv-bd-01-dev # lands as your own user\nsudo install -d -m 700 -o svcusr-sls2hla -g unx-nogroup /home/svcusr-sls2hla /home/svcusr-sls2hla/.ssh\necho '&lt;paste the pubkey&gt;' | sudo tee /home/svcusr-sls2hla/.ssh/authorized_keys\nsudo chown svcusr-sls2hla:unx-nogroup /home/svcusr-sls2hla/.ssh/authorized_keys\nsudo chmod 600 /home/svcusr-sls2hla/.ssh/authorized_keys\n</code></pre>","path":["Developer","CI/CD Runner"],"tags":[]},{"location":"developer/gui/","level":1,"title":"UI","text":"","path":["Developer","UI"],"tags":[]},{"location":"developer/gui/#caqtdm","level":2,"title":"CAQTDM","text":"<pre><code>ssh -J sls-lc -X labrec_b@sls-vserv-bd-hla01-dev.psi.ch\n</code></pre> <p>also works?: <pre><code>ssh hla-dev\n</code></pre></p> <p>Macro substitution <pre><code>caqtdm -m'TESTAGEBDALH=AGEBD-ALH' A_BD_ServiceManager.ui\n</code></pre></p> <p><code>caqtdm</code> does not exists when using <code>svcusr-sls2hla</code></p>","path":["Developer","UI"],"tags":[]},{"location":"developer/gui/#todo-removedelete-old-autodeployed-ui-files","level":1,"title":"TODO: remove/delete old autodeployed ui files","text":"","path":["Developer","UI"],"tags":[]},{"location":"developer/hosts/","level":1,"title":"Hosts overview","text":"<p>Check which network a host lives in, e.g. for <code>sls-lca</code>: <pre><code>ping sls-lca.psi.ch\n</code></pre></p>","path":["Developer","Hosts overview"],"tags":[]},{"location":"developer/hosts/#machine-net-prod","level":3,"title":"Machine Net (<code>prod</code>)","text":"<ul> <li>sls-lca</li> <li>sls-vserv-bd-01</li> <li>sls-vserv-bd-hla01</li> </ul>","path":["Developer","Hosts overview"],"tags":[]},{"location":"developer/hosts/#office-net-dev","level":3,"title":"Office Net (<code>dev</code>)","text":"<ul> <li>sls-lc8</li> <li>sls-lc9</li> <li>sls-vserv-bd-01-dev</li> <li>sls-vserv-bd-hla01-dev</li> </ul>","path":["Developer","Hosts overview"],"tags":[]},{"location":"developer/overview/","level":1,"title":"HLA Framework BD","text":"<p>TODO</p>","path":["Developer","HLA Framework BD"],"tags":[]},{"location":"developer/systemd-service/","level":1,"title":"Systemd Service","text":"","path":["Developer","Systemd Service"],"tags":[]},{"location":"developer/systemd-service/#check-all-logs","level":2,"title":"Check all logs","text":"<pre><code>sudo su svcusr-sls2hla\njournalctl --user -u AGEBD-SERVICE-MASTER.service\n</code></pre>","path":["Developer","Systemd Service"],"tags":[]},{"location":"developer/ioc/ioc/","level":1,"title":"IOC","text":"<p>The following instructions explain the basics of starting and managing IOCs on the IOC host. They describe the manual steps. In practice the CI/CD runner does this for you, see Automation below. </p> <ul> <li>TODO: some iocs not associated to a service, where to put? </li> <li>TODO: need to dev/prod template them too</li> </ul>","path":["Developer","Ioc","IOC"],"tags":[]},{"location":"developer/ioc/ioc/#host","level":2,"title":"Host","text":"<p><code>sls-vserv-bd-01(-dev)</code></p>","path":["Developer","Ioc","IOC"],"tags":[]},{"location":"developer/ioc/ioc/#shell","level":2,"title":"Shell","text":"<p>Start up an IOC shell:</p> <pre><code>iocsh AGEBD-CPCL-MASTER_main.subs\n</code></pre> <p>or:</p> <pre><code>ioc shell AGEBD-CPCL-MASTER-DEV\n</code></pre> <p>then you can run commands to interact with EPICS.</p> <p>List available PVs:</p> <pre><code>&gt; dbl\n</code></pre> <p>Exit:</p> <pre><code>Ctrl + d\n</code></pre>","path":["Developer","Ioc","IOC"],"tags":[]},{"location":"developer/ioc/ioc/#install","level":2,"title":"Install","text":"<p>For existing IOCs, a login to the IOC and a restart via <code>ctrl+x</code> is sufficient.</p> <p>On <code>sls-lc*</code></p> <pre><code>ioc install -V --ioc AGEBD-CPCL-PLAYGROUND --clean\nioc shell AGEBD-CPCL-PLAYGROUND\nctrl+x\n</code></pre> <p>For the initial install, additionally, the shellbox on the ioc host must be restarted. </p> <pre><code>sudo shellbox reload # new ioc installed\n</code></pre> <p>Result: on ioc host, e.g. <code>sls-vserv-bd-01-dev</code></p> <pre><code>vim /etc/shellbox/&lt;port-number&gt;\n</code></pre>","path":["Developer","Ioc","IOC"],"tags":[]},{"location":"developer/ioc/ioc/#local-tests","level":3,"title":"Local Tests","text":"<pre><code>iocsh AGEBD-CPCL-PLAYGROUND_main.subs\n</code></pre> <p>using template file:</p> <pre><code>iocsh PLAYGROUND.template DEVICE=TEST\n</code></pre>","path":["Developer","Ioc","IOC"],"tags":[]},{"location":"developer/ioc/ioc/#delete","level":2,"title":"\"Delete\"","text":"<p>There is no way to really delete an IOC through the <code>ioc</code> cli.</p> <p>What you can do: <code>ssh sls-lc*</code> and delete the entry from <code>/ioc/hosts/sls-vserv-bd-01(-dev)/shellbox.conf</code></p>","path":["Developer","Ioc","IOC"],"tags":[]},{"location":"developer/ioc/ioc/#restart-an-ioc-via-shellbox","level":2,"title":"Restart an IOC via shellbox","text":"<p>On BD host <code>sls-vserv-bd-01(-dev)</code></p> <pre><code>sudo shellbox reload # new ioc installed\nsudo shellbox status # status of all iocs on server\nsudo shellbox stop 50045 # stop ioc\nsudo shellbox start 50045 # start ioc\nsudo shellbox log 50045 -f # log file (tail)\nexit # exit ssh\n</code></pre>","path":["Developer","Ioc","IOC"],"tags":[]},{"location":"developer/ioc/ioc/#automation","level":2,"title":"Automation","text":"<p>Installing, starting and restarting IOCs is done by the gitea runner, not by hand:</p> <ul> <li><code>.gitea/scripts/ioc-install.sh &lt;service-name&gt; &lt;dev|prod&gt;</code></li> <li><code>.gitea/scripts/ioc-start.sh &lt;service-name&gt; &lt;dev|prod&gt;</code> (shellbox, over <code>ssh</code>)</li> <li><code>.gitea/scripts/ioc-restart.sh &lt;service-name&gt; &lt;dev|prod&gt;</code></li> </ul> <p>The scripts operate on the deployed IOC files in <code>/sls/bd/hla/&lt;env&gt;/services/&lt;service-name&gt;/current/ioc</code>, so a service has to be deployed before its IOC can be installed.</p> <p>They run automatically when a new service is added (<code>.gitea/workflows/add-new-service.yml</code>).</p>","path":["Developer","Ioc","IOC"],"tags":[]},{"location":"developer/ioc/ioc/#manual-cicd-workflow-trigger","level":2,"title":"Manual CICD Workflow trigger","text":"<p>IOC commands can be triggered manually for any service (or <code>all</code> services) through the <code>Ioc</code> workflow (<code>.gitea/workflows/ioc.yml</code>) in the gitea Actions tab:</p> <pre><code>Gitea Repo &gt; Actions tab &gt; Ioc (row on left side) &gt; Run Workflow\n</code></pre>","path":["Developer","Ioc","IOC"],"tags":[]},{"location":"developer/python/epics/","level":1,"title":"EPICS","text":"<p>Where is EPICS Base (https://gitea.psi.ch/epics) installed? <pre><code>echo $EPICS\n</code></pre></p> <p>Host architecture that EPICS Base runs on: <pre><code>echo $EPICS_HOST_ARCH\n</code></pre></p> <p>Which channel access lib is being used in python? <pre><code>[sls-vserv-bd-hla01-dev ~]$ which python\n/bin/python\n[sls-vserv-bd-hla01-dev playground]$ python3 -c \"import ctypes; import epics.ca; print(epics.ca.find_libca())\"\n/usr/local/epics/base-7.0.9/lib/RHEL9-x86_64/libca.so\n[sls-vserv-bd-hla01-dev ~]$ source /opt/gfa/python-3.10/latest/bin/activate\n(base) [sls-vserv-bd-hla01-dev ~]$ which python\n/opt/gfa/python-3.10/20220602/bin/python\n(base) [sls-vserv-bd-hla01-dev ~]$ python3 -c \"import ctypes; import epics.ca; print(epics.ca.find_libca())\"\n/opt/gfa/python-3.10/20220602/epics/lib/linux-x86_64/libca.so\n</code></pre></p> <p>How does the conda env configure which EPICS to use?</p> <pre><code>(base) [sls-vserv-bd-hla01-dev ~]$ cat /opt/gfa/python-3.10/20220602/etc/conda/activate.d/epics-base_activate.sh\nexport EPICS_BASE=\"/opt/gfa/python-3.10/20220602/epics\"\nexport EPICS_HOST_ARCH=\"linux-x86_64\"\nexport EPICS_BASE_HOST_BIN=\"/opt/gfa/python-3.10/20220602/epics/bin/linux-x86_64\"\nexport EPICS_BASE_VERSION=\"7.0.5.0\"\nexport PATH=$EPICS_BASE_HOST_BIN:$PATH\n</code></pre> <p>How does the conda env configure which EPICS python uses? <pre><code>(base) [sls-vserv-bd-hla01-dev ~]$ cat /opt/gfa/python-3.10/20220602/etc/conda/activate.d/pyepics_activate.sh\nexport PYEPICS_LIBCA=\"${EPICS_BASE}/lib/${EPICS_HOST_ARCH}/libca.so\"\n</code></pre></p> <p>Example reading from a PV: <pre><code>[sls-vserv-bd-hla01-dev ~]$ /bin/python\nPython 3.9.25 (main, Apr 17 2026, 00:00:00)\n[GCC 11.5.0 20240719 (Red Hat 11.5.0-14)] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n&gt;&gt;&gt; from epics import PV\n&gt;&gt;&gt; pv = PV(\"AGEBD-PLAYGROUND-DEV:AO\")\n&gt;&gt;&gt; pv.get()\n5.0\n&gt;&gt;&gt;\n</code></pre></p>","path":["Developer","Python","EPICS"],"tags":[]},{"location":"developer/python/epics/#system-python-installed-packages","level":2,"title":"System python installed packages","text":"<pre><code>/bin/python -m pip list -v\n</code></pre>","path":["Developer","Python","EPICS"],"tags":[]},{"location":"developer/python/epics/#systemd-services","level":2,"title":"Systemd Services","text":"<p>When ssh-ing into a machine, <code>/etc/profile.d/*</code> automatically gets sourced. And thus we have:</p> <pre><code>[sls-vserv-bd-hla01-dev ~]$ env | grep EPICS\nEPICS_CA_ADDR_LIST=sls-cagw.psi.ch:5062\n</code></pre> <p>When running a <code>systemd</code> service, this does not happen.</p> <p>Note -- it seems that the following does not work as expected: <pre><code>That's why we need to source `/etc/profile.d/cas_12_epics.sh` in our startup script\nto make sure that `EPICS` is configured properly. \n</code></pre> After sourcing the script, we still have: <code>EPICS_CA_ADDR_LIST=</code> (i.e. the script does not set <code>EPICS_CA_ADDR_LIST=sls-cagw.psi.ch:5062</code>) in <code>systemd</code> service.</p> <p>Whereas in the shell <code>unset EPICS_CA_ADDR_LIST</code> and then <code>. /etc/profile/cas_12_epics.sh</code> properly sets <code>EPICS_CA_ADDR_LIST=sls-cagw.psi.ch:5062</code>.</p> <p>Check which env variables a <code>systemd</code> service is running with:</p> <pre><code>[sls-vserv-bd-hla01-dev ~]$ systemctl --user restart AGEBD-SERVICE-SCRUBBING.service &amp;&amp; sleep 1 &amp;&amp; PID=$(systemctl --user show -p MainPID --value AGEBD-SERVICE-SCRUBBING.service)\n[sls-vserv-bd-hla01-dev ~]$ tr '\\0' '\\n' &lt; /proc/$PID/environ | grep EPICS\nEPICS_CAS_IGNORE_ADDR_LIST=\nEPICS_CA_ADDR_LIST= 129.129.146.255\nEPICS_HOST_ARCH=linux-x86_64\nEPICS_BASE_HOST_BIN=/opt/gfa/python-3.10/20220602/epics/bin/linux-x86_64\nPYEPICS_LIBCA=/opt/gfa/python-3.10/20220602/epics/lib/linux-x86_64/libca.so\nEPICS_BASE_VERSION=7.0.5.0\nEPICS_BASE=/opt/gfa/python-3.10/20220602/epics\n</code></pre>","path":["Developer","Python","EPICS"],"tags":[]},{"location":"developer/python/packaging/","level":1,"title":"Python packaging","text":"","path":["Developer","Python","Python packaging"],"tags":[]},{"location":"developer/python/packaging/#gitea","level":2,"title":"Gitea","text":"<p>See: - docs: https://linux.psi.ch/documentation/services/gitea/gitea-packages/#pypi-package-registry - example: https://gitea.psi.ch/sls/OM</p>","path":["Developer","Python","Python packaging"],"tags":[]},{"location":"developer/python/pixi/","level":1,"title":"Pixi","text":"","path":["Developer","Python","Pixi"],"tags":[]},{"location":"developer/python/pixi/#install","level":2,"title":"Install","text":"<pre><code>curl -fsSL https://pixi.sh/install.sh | sh\n</code></pre> <p>installs in <code>${HOME}/.pixi/bin</code></p>","path":["Developer","Python","Pixi"],"tags":[]},{"location":"user/add-new-service/","level":1,"title":"Adding a new service","text":"","path":["User","Adding a new service"],"tags":[]},{"location":"user/add-new-service/#python-setup","level":2,"title":"Python setup","text":"<p>Install the uv package manager</p>","path":["User","Adding a new service"],"tags":[]},{"location":"user/add-new-service/#cli-command-line-interface","level":2,"title":"CLI (Command-Line Interface)","text":"<p>We have our own cli called <code>agebd</code>.</p> <p>To use the cli, first clone this repo. Then:</p> <pre><code>cd cli\nuv sync\nsource .venv/bin/activate\nagebd --help\n</code></pre>","path":["User","Adding a new service"],"tags":[]},{"location":"user/add-new-service/#adding-a-new-service_1","level":3,"title":"Adding a new service","text":"<pre><code>agebd service add --help\n</code></pre> <p>This command has side effects you should know about before running it. It requires a clean working tree, then it:</p> <ol> <li>Assigns the service the next free IOC port and registers it in <code>config/services_registry.yml</code>.</li> <li>Adds the service to <code>AGEBD-CPCL-MASTER</code>'s IOC pattern file, so it gets the standard ALH lifecycle PVs (<code>AGEBD-ALH$(SUFFIX):$(SERVICE)-*</code>) and appears in the <code>ServiceManager</code> GUI screen.</li> <li>Appends a row to <code>iocs_overview.md</code>.</li> <li>Creates a new branch <code>feature/add-service-&lt;name&gt;</code>, scaffolds the new service's files from the templates, and pushes the branch automatically — you don't run <code>git push</code> yourself.</li> </ol> <p>Pushing that branch triggers the <code>Add new service</code> Gitea Actions workflow (<code>.gitea/workflows/add-new-service.yml</code>), which deploys <code>master</code>, installs/restarts its IOC, deploys your new service, and installs/starts its own IOC — all in <code>dev</code>. Check the Actions tab for that run to confirm it succeeded before doing anything else with the new service.</p>","path":["User","Adding a new service"],"tags":[]},{"location":"user/add-new-service/#environments","level":2,"title":"Environments","text":"<p>The services are deployed to 2 environments:</p> Environment Network Host Deploy path on host <code>prod</code> <code>machine</code> <code>sls-vserv-bd-hla01</code> <code>/sls/bd/hla/prod/</code> <code>dev</code> <code>office</code> <code>sls-vserv-bd-hla01-dev</code> <code>/sls/bd/hla/dev/</code>","path":["User","Adding a new service"],"tags":[]},{"location":"user/add-new-service/#process-variables-pvs","level":3,"title":"Process Variables (PVs)","text":"<p>We distinguish between </p> <ul> <li><code>prod</code> vs <code>dev</code> PVs </li> <li>service specific PVs from a dedicated IOC vs external PVs from other IOCs</li> </ul>","path":["User","Adding a new service"],"tags":[]},{"location":"user/add-new-service/#pvs-service-specific","level":4,"title":"PVs - Service Specific","text":"<p>These are defined as EPICS records in your service's own <code>services/&lt;name&gt;/current/ioc/*.template</code> file, instantiated by <code>services/&lt;name&gt;/current/ioc/AGEBD-CPCL-&lt;NAME&gt;_main.subs</code>.</p> <p><code>prod</code> and <code>dev</code> PVs automatically get created: at deploy time, <code>{{ agebd_env_suffix_upper }}</code>/ <code>{{ agebd_env_suffix_lower }}</code> placeholders in those files are substituted with <code>-DEV</code>/<code>-dev</code> in <code>dev</code>, or left empty in <code>prod</code> (see <code>.gitea/scripts/deploy-service.sh</code>).</p> <p>In your code, you only use the <code>prod</code> name of a PV, e.g. <code>PV(\"AGEBD-MYSERVICE:MYPVNAME\")</code>. The <code>PVLink</code>/<code>DevPVLink</code> framework (<code>packages/agebd/src/agebd/pv.py</code>) automatically appends <code>-DEV</code> when the service runs in <code>dev</code> — but only for PVs belonging to your own service, plus <code>AGEBD-ALH</code>/<code>AGEBD-MASTER</code>. See \"External\" below for PVs owned by another service.</p>","path":["User","Adding a new service"],"tags":[]},{"location":"user/add-new-service/#pvs-external","level":4,"title":"PVs - External","text":"<p>PVs owned by another service (including another AGEBD service, e.g. <code>AGEBD-PARAMS:...</code> used from a different service) or by real accelerator hardware (e.g. <code>ARS01-MOCT-...</code>) are used verbatim — no <code>-DEV</code> suffix is ever added, even in <code>dev</code>.</p>","path":["User","Adding a new service"],"tags":[]},{"location":"user/add-new-service/#pvs-examples","level":4,"title":"PVs - Examples","text":"Environment Service Specific External <code>prod</code> <code>PV(\"AGEBD-MYSERVICE:MYPVNAME\")</code> read&amp;write <code>PV(\"AGEOP-SOME-SERVICE:SOME-PVNAME\")</code> read&amp;write <code>dev</code> <code>PV(\"AGEBD-MYSERVICE-DEV:MYPVNAME\")</code> read&amp;write <code>PV(\"AGEOP-SOME-SERVICE:SOME-PVNAME\")</code> readonly","path":["User","Adding a new service"],"tags":[]},{"location":"user/add-new-service/#python","level":3,"title":"Python","text":"<p>For python services there are 3 environments. The python environment is set through the env variable <code>AGEBD_ENV</code>.</p> Environment PVs <code>AGEBD_ENV=prod</code> uses <code>prod</code> PVs <code>AGEBD_ENV=dev</code> uses <code>dev</code> PVs <code>AGEBD_ENV=local</code> uses fake/mock python objects as PVs, no access to real PVs","path":["User","Adding a new service"],"tags":[]},{"location":"user/gui/","level":1,"title":"GUI","text":"","path":["User","GUI"],"tags":[]},{"location":"user/gui/#launch","level":2,"title":"Launch","text":"<p>In <code>prod</code>: <code>ssh sls-vserv-bd-hla01</code> <pre><code>cd /sls/bd/hla/prod/qt\n../bin/sls_hla_launch_gui.sh A_BD_ServiceManager.ui\n</code></pre></p> <p>In <code>dev</code>: <code>ssh sls-vserv-bd-hla01-dev</code> <pre><code>cd /sls/bd/hla/dev/qt\n../bin/sls_hla_launch_gui.sh A_BD_ServiceManager.ui \"dev\"\n</code></pre></p> <p>Any extra arguments are passed straight through to <code>caqtdm</code>, e.g. to set a macro:</p> <pre><code>../bin/sls_hla_launch_gui.sh A_BD_ServiceManager.ui \"dev\" -macro \"OTHER_ENV_VAR=HEYHEY\"\n</code></pre> <p>Note: launching straight from a git checkout, as above, uses the raw <code>.ui</code> files as committed - including the literal <code>{{ agebd_env_suffix_upper }}</code>/<code>{{ agebd_env_suffix_lower }}</code> placeholders in their PV names. Those only get substituted with <code>-DEV</code>/<code>-dev</code> (or emptied out, in <code>prod</code>) at deploy time, by <code>.gitea/workflows/deploy.yml</code>'s <code>\"Qt - deploy\"</code> step, on the deployed copy at <code>/sls/bd/hla/&lt;env&gt;/qt/</code>. If widgets show up blank or unresponsive, check whether you're accidentally pointing at the raw checkout instead of the deployed <code>.ui</code> file.</p>","path":["User","GUI"],"tags":[]},{"location":"user/ioc/iocs_overview/","level":1,"title":"Overview of IOCs for Beam Dynamics","text":"<p>The ports are configured in the service registry</p> IOC NAME Description AGEBD-CPCL-MASTER IOC providing PVs for the service master application, and monitoring the health status of BD High Level Application Services via the alarm handler ALH. ALH is not a separate IOC - its <code>AGEBD-ALH$(SUFFIX):$(SERVICE)-*</code> PVs are defined directly in <code>MASTER.template</code>, one row per registered service. AGEBD-CPCL-TUNE IOC providing PVs for the tune measurement AGEBD-CPCL-SCRUBBING IOC providing PVs for the vacuum scrubbing service AGEBD-CPCL-NTURNS IOC providing PVs for the DBPM3 stage0 and stage1 nr. of turns calculation service AGEBD-CPCL-TIMING IOC providing PVs for working around limitations of the SLS 2.0 timing system AGEBD-CPCL-INJECTIONGUARD IOC providing PVs for the injection guard application AGEBD-CPCL-POSTMORTEMLOG IOC providing PVs for the post mortem elog service application AGEBD-CPCL-TUNEBUMP IOC providing PVs for the tune bump service application AGEBD-CPCL-PLOTS IOC providing Buffers of PVs for plots AGEBD-CPCL-ORBITBUMP IOC providing PVs for orbit bumps for the beamlines AGEBD-CPCL-TAUBPM IOC providing PVs for the lifetime measurement (BPM based) AGEBD-CPCL-TAUPCT IOC providing PVs for PCT based lifetime measurement AGEBD-CPCL-TOPUPTOOL IOC providing PVs for the top up tool AGEBD-CPCL-TUNEFBX IOC providing PVs for the horizontal tune feedback AGEBD-CPCL-TUNEFBY IOC providing PVs for the vertical tune feedback AGEBD-CPCL-PARAMS IOC providing PVs for machine parameters (e.g. injection state, lifetime, current limit) AGEBD-CPCL-DBPM3CURR IOC providing PVs for the DBPM3 stage2 average current calculation service AGEBD-CPCL-SHIFTTOOL IOC providing PVs for the shift log / handover tool AGEBD-CPCL-BEAMTRANSFERCHECKS IOC providing PVs for beam transfer checks AGEBD-CPCL-OPTICSFF-X02S IOC providing PVs for optics feed-forward on the I-TOMCAT beamline AGEBD-CPCL-OPTICSFF-X03M IOC providing PVs for optics feed-forward on the ADRESS beamline AGEBD-CPCL-OPTICSFF-X04S IOC providing PVs for optics feed-forward on the ADDAMS beamline AGEBD-CPCL-OPTICSFF-X05L IOC providing PVs for optics feed-forward on the QUEST beamline AGEBD-CPCL-OPTICSFF-X06S IOC providing PVs for optics feed-forward on the PXI beamline AGEBD-CPCL-OPTICSFF-X07M IOC providing PVs for optics feed-forward on the PHOENIX/XTREME beamline AGEBD-CPCL-OPTICSFF-X08S IOC providing PVs for optics feed-forward on the MicroXAS beamline AGEBD-CPCL-OPTICSFF-X09L IOC providing PVs for optics feed-forward on the OPERA beamline AGEBD-CPCL-OPTICSFF-X10S IOC providing PVs for optics feed-forward on the PXII beamline AGEBD-CPCL-OPTICSFF-X11M IOC providing PVs for optics feed-forward on the SIM beamline AGEBD-CPCL-OPTICSFF-X12S IOC providing PVs for optics feed-forward on the cSAXS beamline","path":["User","Ioc","Overview of IOCs for Beam Dynamics"],"tags":[]}]}