trjones4 / TelemetricsDSKY

customized source repos for setting up the Telemetrics DSKY
0 stars 0 forks source link

Change software update process for users to prevent bricking DSKY #1

Open trjones4 opened 6 years ago

trjones4 commented 6 years ago

Problem

The current DSKY maintenance mode menu allows the users to perform an update and re-compile of VirtualAGC directly from the master branch of the Git repo (option 7 shown below). This can easily result in the user's DSKY becoming unusable due to upstream changes in parts of the VirtualAGC project.

image

The launch script - runPiDSKY2.sh - contains the following for executing the software update command:

 elif [[ "$REPLY" == "7" && "$NON_NATIVE" == "" ]]
                        then
                                echo $"Fetching from VirtualAGC repository ..."
                                git -C "$SOURCEDIR" fetch --quiet --all
                                git -C "$SOURCEDIR" reset --quiet --hard origin/master

You can see it simply forces the copy of the virtuaagc source tree to the latest master version on Git, later lines initiate the re-compile process.

This design is not appropriate for "normal" users for several reasons:

  1. High risk of "bricking" the DSKY software, creating frustration
  2. Re-compiling the entire virtualagc source tree takes a long time on the pi (many minutes) - this is not what normal users expect in a software update relative to their cell phones
  3. Once the source tree on the pi is updated, only an expert user can reset the repository to a working source version and re-compile - reverting is too hard

Desired Process Requirements

To resolve this issue requires a new process for handling software updates for users and is broader than only script changes. The desired process is more like ...

  1. Telemetrics evaluates new versions of VirtualAGC as new functionality is developed
  2. Telemetrics evaluates new versions of the piPeripheral software and tests functionality with VirtualAGC
  3. Telemetrics "approves" a combination of VirtualAGC version and piPeripheral version as a new release for the DSKY's
  4. Users are notified of a new DSKY software release and given the option to update their system
  5. If user decides to update, the new version is installed
  6. If - for any reason - the update fails, the user should have the option to roll-back to the last working version of the DSKY software

Design Alternatives

In my view, we need to accept that we have (at least) two distinct user groups:

Software Distribution for Normal Users

Over time, the largest user group will (in my view) be the Normal Users. To make their software update experience as simple as possible, I recommend the creation of a binary (pre-compiled) software package that contains the VirtualAGC and piPeripheral software.

Since the RaspbianOS is based on Debian, it would be logical to distribute this binary package as a ".deb" package file hosted on a server controlled by Telemetrics. That way, each DSKY can be configured to query the apt repository and use the existing operating system tools to upgrade, or even rollback, software versions easily.

Software Distribution for Expert Users

Should remain source-code based and distributed through Git. Expert users can access git easily and download any updates they choose and deal with the consequence of a failure themselves.

Next Steps to Resolve

Immediate suggestion is to remove entirely the "Update VirtualAGC" option from the maintenance menu. Expert users can be provided with simple instructions on how to perform source code updates themselves, and this removes the risk of users breaking their DSKY out of the box (has already happened).

Longer term, agree to a new distribution model (Debian package or other) and develop that until it can be rolled out to the user community.

trjones4 commented 6 years ago

Now in DSKY 2.21 is a "patched" version of the runPiDSKY2.sh script with all of the "update" functionality commented out! See the wiki Troubleshooting page for git commands to revert the local repo version

martinlollar commented 6 years ago

Hi Troy. Is this something we can download from GitHub now? mjl

trjones4 commented 6 years ago

Yep! Forgot the link to the updated shell script - for folks that want to try it, I suggest renaming the original file and copying in this new version into the virtualagc/piPeripheral directory, make sure it's executable!

https://github.com/trjones4/pi-gen-dsky/blob/master/stage4/69-dsky/files/runPiDSKY2.sh

martinlollar commented 6 years ago

Troy, just a quick tech note. I noticed in some of your comment statements you mention Stretch. The version in my DSKY is definitely Jessie.

pi@AGC:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)" NAME="Raspbian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" pi@AGC:~ $