Skip to content

Commit

Permalink
more update.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Jan 16, 2025
1 parent 2ef93a3 commit 304b09b
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions update_scripts/upcoming/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ chown -R pioreactor:www-data $DB*
chmod -R 770 $DB*

# 2. make a calibration dir in all pioreactors
sudo -u pioreactor mkdir -p "$STORAGE_DIR"/calibrations/od
sudo -u pioreactor mkdir -p "$STORAGE_DIR"/calibrations/media_pump
sudo -u pioreactor mkdir -p "$STORAGE_DIR"/calibrations/waste_pump
sudo -u pioreactor mkdir -p "$STORAGE_DIR"/calibrations/alt_media_pump
sudo -u pioreactor mkdir -p "$STORAGE_DIR"/calibrations/{od,media_pump,waste_pump,alt_media_pump}

# 3. install pyyaml (only leader has it, but workers need it now)
sudo pip3 install "$SCRIPT_DIR"/PyYAML-6.0.2-cp311-cp311-linux_armv7l.whl
Expand All @@ -37,7 +34,7 @@ sudo bash /usr/local/bin/create_diskcache.sh
# 5. replace old calibrations with new yaml files. This doesn't delete old calibrations
sudo -u pioreactor python "$SCRIPT_DIR"/cal_convert.py "$STORAGE_DIR"/od_calibrations/cache.db
sudo -u pioreactor python "$SCRIPT_DIR"/cal_convert.py "$STORAGE_DIR"/pump_calibrations/cache.db
chown -R pioreactor:pioreactor "$STORAGE_DIR"/calibrations/*/*.yaml
chown -R pioreactor:pioreactor "$STORAGE_DIR"/calibrations/

sudo -u pioreactor python "$SCRIPT_DIR"/cal_active.py "$STORAGE_DIR"/current_pump_calibrations/cache.db
sudo -u pioreactor python "$SCRIPT_DIR"/cal_active.py "$STORAGE_DIR"/current_od_calibrations/cache.db
Expand All @@ -48,16 +45,9 @@ if [ "$HOSTNAME" = "$LEADER_HOSTNAME" ]; then
# 6. remove calibrations dataset file
rm -f /home/pioreactor/.pioreactor/exportable_datasets/*calibrations.yaml


# 7. fix any bad pioreactor start up systemd services
rm -f /usr/lib/systemd/system/[email protected]
cp "$SCRIPT_DIR"/[email protected] /etc/systemd/system/
echo "application/yaml yaml yml" | sudo tee -a /etc/mime.types

# 8. add new config entries
crudini --set /home/pioreactor/.pioreactor/config.ini storage temporary_cache /tmp/pioreactor_cache/local_intermittent_pioreactor_metadata.sqlite \
--set /home/pioreactor/.pioreactor/config.ini storage persistent_cache /home/pioreactor/.pioreactor/storage/local_persistent_pioreactor_metadata.sqlite

sudo -u pioreactor pios sync-configs --shared || :

fi

0 comments on commit 304b09b

Please sign in to comment.