Skip to content

Commit

Permalink
adding new pioreactor db table for liquid volume, update huey
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Oct 15, 2024
1 parent 1f4d3b3 commit 9b0720c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 9 deletions.
4 changes: 2 additions & 2 deletions workspace/scripts/03-configure-rpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ echo "force_turbo=1" | sudo tee -a /boot/config.txt
sudo systemctl disable raspi-config.service
sudo systemctl disable triggerhappy.service
sudo systemctl disable apt-daily.service
sudo systemctl disable apt-daily.timer
sudo systemctl disable apt-daily-upgrade.timer
sudo systemctl disable apt-daily-upgrade.service
sudo systemctl disable alsa-restore.service
sudo systemctl disable alsa-state.service
sudo systemctl disable userconfig.service
sudo systemctl disable rpi-display-backlight.service
sudo systemctl disable rpi-eeprom-update.service

sudo systemctl mask apt-daily-upgrade
sudo systemctl mask apt-daily
Expand Down
4 changes: 1 addition & 3 deletions workspace/scripts/04-install-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ sudo systemctl enable [email protected]

# systemd: add long running pioreactor jobs
sudo cp /files/system/systemd/[email protected] $SYSTEMD_DIR
sudo systemctl enable [email protected]
# sudo systemctl enable [email protected] # this is leader-only, and will just no-op for workers
sudo systemctl enable pioreactor_startup_run@mqtt_to_db_streaming.service # this is leader-only, and will just no-op for workers

# systemd: remove wifi powersave - helps with mdns discovery
sudo cp /files/system/systemd/wifi_powersave.service $SYSTEMD_DIR
Expand Down Expand Up @@ -51,6 +48,7 @@ if [ "$LEADER" == "1" ]; then
sudo systemctl enable avahi_aliases.service
cp /files/bash/avahi_aliases.sh /usr/local/bin/avahi_aliases.sh

sudo systemctl enable pioreactor_startup_run@mqtt_to_db_streaming.service # this is leader-only

fi

Expand Down
2 changes: 1 addition & 1 deletion workspace/scripts/07-install-logging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ sudo chown pioreactor:pioreactor /var/log/pioreactor.log
# give free conditions so anyone can write to it if needed, ie. www-data
sudo chmod 666 /var/log/pioreactor.log

# add a logrotate entry
# add a logrotate entries
sudo cp /files/system/logrotate/pioreactor /etc/logrotate.d/pioreactor

4 changes: 3 additions & 1 deletion workspace/scripts/files/bash/write_ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ done

# Write the information to a file in key-value format
# Use > since we want to rewrite on every boot (not append)
echo -e "$NETWORK_INFO" > /boot/firmware/network_info.txt
echo -e "$NETWORK_INFO" > /boot/firmware/network_info.txt

sudo nmcli device status | sudo tee -a /boot/firmware/network_info.txt
2 changes: 1 addition & 1 deletion workspace/scripts/files/root.cron
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*/5 * * * * (head -n 9 /boot/firmware/network_info.txt && journalctl -u NetworkManager --no-pager -b) > /tmp/network_info.txt && cp /tmp/network_info.txt /boot/firmware/network_info.txt
*/5 * * * * (head -n 15 /boot/firmware/network_info.txt && journalctl -u NetworkManager --no-pager -b) > /tmp/network_info.txt && cp /tmp/network_info.txt /boot/firmware/network_info.txt
14 changes: 14 additions & 0 deletions workspace/scripts/files/sql/create_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ CREATE INDEX IF NOT EXISTS alt_media_fractions_ix
ON alt_media_fractions (experiment);


CREATE TABLE IF NOT EXISTS liquid_volumes (
experiment TEXT NOT NULL,
pioreactor_unit TEXT NOT NULL,
timestamp TEXT NOT NULL,
liquid_volume REAL NOT NULL,
FOREIGN KEY (experiment) REFERENCES experiments (
experiment
) ON DELETE CASCADE
);

CREATE INDEX IF NOT EXISTS liquid_volumes_ix
ON liquid_volumes (experiment);



CREATE TABLE IF NOT EXISTS od_readings_filtered (
experiment TEXT NOT NULL,
Expand Down
3 changes: 2 additions & 1 deletion workspace/scripts/files/system/systemd/huey.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ Before=lighttpd.service
[Service]
User=pioreactor
WorkingDirectory=/var/www/pioreactorui
ExecStart=huey_consumer pioreactorui.tasks.huey -n -b 1.0 -w 2 -f -C
ExecStart=huey_consumer pioreactorui.tasks.huey -n -b 1.0 -w 6 -f -C -d 0.05
ExecStartPost=pio log -m "%n successful" -n systemd --local-only
StandardOutput=null
StandardError=null
KillMode=process

[Install]
WantedBy=multi-user.target

0 comments on commit 9b0720c

Please sign in to comment.