Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move system update script to python #81

Merged
merged 14 commits into from
Oct 15, 2023
Merged

feat: move system update script to python #81

merged 14 commits into from
Oct 15, 2023

Conversation

gerblesh
Copy link
Collaborator

@gerblesh gerblesh commented Oct 9, 2023

this PR (hopefully) fixes a couple issues with rebasing, and switches the update script to python for proper error handling, etc. However this needs testing before a merge, to make sure rebasing, updating, etc works as intended

Copy link
Contributor

@bobslept bobslept left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some trouble building the full package so I have tested 00-system-update.py as a standalone script.
These results are with the changes in the code I made.

Tested F38 installations:

ostree-unverified-registry:ghcr.io/ublue-os/bluefin:38
ostree-unverified-image:docker://ghcr.io/ublue-os/bluefin:38

Rebased to ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:38 after running the script.

Tested F39 installations:

ostree-unverified-registry:ghcr.io/ublue-os/bluefin:39
ostree-unverified-image:docker://ghcr.io/ublue-os/bluefin:39

Rebased to ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:39 after running the script.

Tested latest installations:

ostree-unverified-registry:ghcr.io/ublue-os/bluefin:latest
ostree-unverified-image:docker://ghcr.io/ublue-os/bluefin:latest

Rebased to ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:latest after running the script.

Running the script on ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:39 will lead to rebase failed!, command output: but maybe that's because my code changes are not perfect. The same behavior on 38.

Test with new changes

Ran the same tests as above with 5e5b931 and the results are the same. The rebasing works without any problems in the situations above.

The only thing is when you are on a ostree-image-signed image and you run the script it will output:
rebase failed!, command output:

files/etc/ublue-update.d/system/00-system-update.py Outdated Show resolved Hide resolved
Copy link
Contributor

@bobslept bobslept left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a problem when running the script on a signed image, it contains the tag in one, and not in the other. So they will never match.

files/etc/ublue-update.d/system/00-system-update.py Outdated Show resolved Hide resolved
Copy link
Contributor

@bobslept bobslept left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Offline iso bluefin 38 installation test

I had to fiddle in a image-info.json to make it work. I've used rpm-ostree usroverlay for that because it's an old iso.

State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: no runs since boot
Deployments:
● ostree-unverified-image:oci:/var/ublue-os/image
                   Digest: sha256:211f9a5433234ccbe232fd66b915d33d5d10658eacff0b6ee6c7f8a7d70d90b8
                  Version: 38.20230906.0 (2023-10-15T11:27:53Z)

Running the current 00-system-update.py results in

rebase failed!, command output:
Pulling manifest: ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:

rpm-ostree upgrade returned code 1, program output:
note: automatic updates (stage) are enabled
Pulling manifest: ostree-unverified-image:oci:/var/ublue-os/image

With the change in the code below I ran the script again and result in a working rebase!

State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: no runs since boot
Deployments:
  ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:latest
                   Digest: sha256:14c2b7fd52d70def2fca89ae6dd971431586e09ec1d9e59c79b65033c14eca71
                  Version: 38.20231015.0 (2023-10-15T11:28:12Z)
                     Diff: 268 upgraded, 9 removed, 26 added

● ostree-unverified-image:oci:/var/ublue-os/image
                   Digest: sha256:211f9a5433234ccbe232fd66b915d33d5d10658eacff0b6ee6c7f8a7d70d90b8
                  Version: 38.20230906.0 (2023-10-15T11:27:53Z)

files/etc/ublue-update.d/system/00-system-update.py Outdated Show resolved Hide resolved
Copy link
Contributor

@bobslept bobslept left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested bluefin:38

ostree-unverified-registry:ghcr.io/ublue-os/bluefin:38
ostree-unverified-image:docker://ghcr.io/ublue-os/bluefin:38
----> After running the update script ---->
ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:38

Tested bluefin:39

ostree-unverified-registry:ghcr.io/ublue-os/bluefin:39
ostree-unverified-image:docker://ghcr.io/ublue-os/bluefin:39
----> After running the update script ---->
ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:39

Tested bluefin:latest

ostree-unverified-registry:ghcr.io/ublue-os/bluefin:latest
ostree-unverified-image:docker://ghcr.io/ublue-os/bluefin:latest
----> After running the update script ---->
ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:latest

Tested UBlue-bluefin-38-x86_64.iso

ostree-unverified-image:oci:/var/ublue-os/image
----> After running the update script ----> (with fidling in image-info.json)
ostree-image-signed:docker://ghcr.io/ublue-os/bluefin:latest

@gerblesh gerblesh merged commit be229d1 into main Oct 15, 2023
@gerblesh gerblesh deleted the py-system-update branch October 15, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants