thorrak / fermentrack

A replacement web interface for BrewPi
MIT License
134 stars 61 forks source link

New BrewPi-Script Daemon, Eliminate Circus, and Refactor Backups #724

Closed thorrak closed 1 year ago

thorrak commented 1 year ago

This PR introduces a number of substantial changes from the previous release of Fermentrack.

Major Changes

BrewPi-Script Manager Rewrite

Since the early days of Fermentrack, Circus has been used to launch & manage individual instances of brewpi-script for each individual BrewPi Device. Unfortunately, Circus imposes a number of upstream dependencies that make keeping Fermentrack up-to-date an extremely onerous task. This PR replaces Circus with a custom BrewPi-Script management daemon.

Backup/Restore Refactor

The original implementation of backup/restore relied on an internal Django management command to read the database and write out database object descriptions to a JSON file. Although this works in theory, in practice this means that the backup is fairly dumb given that it is not aware of the nuance of Fermentrack's object relationships.

This PR replaces the use of the internal Django management command with new logic that generates a "smart" backup, which includes a Fermentrack-generated (rather than database-driven) representation of Fermentrack objects in JSON.

Changes from the previous logic when using newly-generated backups

UUIDs

As part of the backup/restore refactoring, I have added UUIDs to every object that is likely to be exported. These UUIDs allow Fermentrack to recognize when an object in a backup file already exists in the Fermentrack database, and will update that object (rather than attempting to install a second instance).

New Upgrade Workflow

Unfortunately, Docker resets containers to their "downloaded" state which means that the previous upgrade workflow no longer functions as intended. The ability to "upgrade from GitHub" has now been removed in favor of providing instructions on how to re-run the install script which pulls the latest image from Docker Hub.

TiltBridge Jr (New Tilt Bluetooth support)

The existing Tilt Bluetooth daemon has been removed in favor of a new, standalone bluetooth daemon called "TiltBridge Jr." This should hopefully allow for Tilt support to be upgraded/improved independently from Fermentrack while simultaneously providing a better experience.

Full Changelog (so far)

Added

Changed

Removed

cdnninja commented 1 year ago

After install of this my tilt reconnected but the brewpi Arduino isn't connected.

Traceback (most recent call last): File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/app/brewpi-script/brewpi.py", line 31, in <module> from scriptlibs.brewpiScriptConfig import BrewPiScriptConfig ModuleNotFoundError: No module named 'scriptlibs'

image

thorrak commented 1 year ago

You switched to the testing (or docker-dev) images? Did you upgrade by using the install.sh script or by clicking the button inside Fermentrack?

cdnninja commented 1 year ago

I used the update within the app. I will update via docker and report back.