git clone https://github.com/Lab5015/automator.gitInside the cfg/ folder, create a configuration file corresponding to one of the following setups:
[CERN, CIT, MIB, PKU, UVA]
e.g. (cfg/CERN.yaml):
automator_path: /home/cmsdaq/DAQ/automator/
db_path: /home/cmsdaq/DAQ/automator/runs.db
mtd_daq_path: /home/cmsdaq/DAQ/mtd_daq/
qaqc_url: http://pc-mtd-tb03/tray_qaqc
pre_cmd: ""
lyso_peaks_correlate: falseYou need to create two service files in /etc/systemd/system/ to enable communication between the reco PC and Serenity.
[Unit]
Description=automator processor
After=multi-user.target
[Service]
Type=simple
User=cmsdaq
Restart=always
ExecStart=/bin/bash -c 'source ~/.bashrc; micromamba activate automator-env; cd /home/cmsdaq/DAQ/automator/ && python -u processor_demon.py -b CERN'
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
[Unit]
Description=automator server
After=multi-user.target
[Service]
Type=simple
User=cmsdaq
Restart=always
ExecStart=/bin/bash -c 'source ~/.bashrc; micromamba activate automator-env; cd /home/cmsdaq/DAQ/automator/ && python -u main.py -b CERN'
[Install]
WantedBy=multi-user.target
In the ExecStart command, make sure you specify your Python environment.
In the examples above, we use a micromamba environment called automator-env.
You’ll need the following Python packages:
fastapisqlalchemyruamel.yamlaiosqlite
example of environment
micromamba create -n automator-env python=3.10
micromamba activate automator-env
pip install fastapi sqlalchemy ruamel.yaml aiosqliteEnsure that both service files have the correct ownership and SELinux context.
They should show something like:
unconfined_u:object_r:systemd_unit_file_t:s0
and not home_t or other types.
If needed, you can adjust permissions using:
sudo chown root:root /etc/systemd/system/automator_*.service
sudo restorecon -v /etc/systemd/system/automator_*.serviceDepending on your OS, the procedure may vary.
For AlmaLinux 9, use:
# Add the port
sudo firewall-cmd --permanent --add-port=5558/tcp
# Reload firewall rules
sudo firewall-cmd --reload
# Check that the port was added
sudo firewall-cmd --list-portssudo systemctl daemon-reload
sudo systemctl start automator_server.service
sudo systemctl start automator_processor.serviceCheck their status:
sudo systemctl status automator_server.service
sudo systemctl status automator_processor.serviceOnce everything is set up, you can access the web interface at:
http://<your-pc-hostname>:5558