Skip to content
Snippets Groups Projects

Release upgrade initial CI

Closed Imported Administrator requested to merge release-upgrade-initial-ci into master
All threads resolved!

Initial upgrade script to test upgrading from the latest stable to edge.

Currently being stuck in the sed command to replace the repositories, it is valid but the the file is never changed in the chroot.

Fixed :) pmbootstrap configured the repos again after I overwritten them :face_palm: Used the proper pmbootstrap interface now to handle this better and avoid this issue.

Current issues:

  • Hardcoded to Pine64 PinePhone rootfs
  • Hardcoded to v21.12
  • Assume that we want firewall + SSH installed and no-image to be generated

I think we can handle these things as in upstream_compat_setup.sh?

Contributes to https://gitlab.com/postmarketOS/pmaports/-/issues/1432

Edited by Administrator

Merge request reports

Checking pipeline status.

Closed by AdministratorAdministrator 2 years ago (Apr 25, 2022 6:23pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Administrator assigned to @dylanvanassche · Imported

    assigned to @dylanvanassche

    By Dylan Van Assche on 2022-04-23T19:36:20

  • Administrator added 1 commit · Imported

    added 1 commit

    • dfab9718 - test_upgrade_compatibility: initial CI

    Compare with previous version

    By Dylan Van Assche on 2022-04-23T19:37:05

  • Administrator added 1 commit · Imported

    added 1 commit

    • 564516bd - test_upgrade_compatibility: initial CI

    Compare with previous version

    By Dylan Van Assche on 2022-04-24T09:23:41

  • Administrator marked this merge request as ready · Imported

    marked this merge request as ready

    By Dylan Van Assche on 2022-04-24T09:24:21

  • Administrator changed the description · Imported

    changed the description

    By Dylan Van Assche on 2022-04-24T09:25:30

  • Administrator added 1 commit · Imported

    added 1 commit

    • db6c4b40 - test_upgrade_compat: initial CI

    Compare with previous version

    By Dylan Van Assche on 2022-04-24T09:29:32

  • Administrator added 1 commit · Imported

    added 1 commit

    • a102699f - test_upgrade_compat: initial CI

    Compare with previous version

    By Dylan Van Assche on 2022-04-24T09:30:14

  • Administrator added 1 commit · Imported

    added 1 commit

    • 1f7a999f - test_upgrade_compat: initial CI

    Compare with previous version

    By Dylan Van Assche on 2022-04-24T09:32:27

  • Author Owner

    2 failures during upgrade from v21.12 --> edge currently:

    apline-baselayout-data

    (1/676) Installing alpine-baselayout-data (3.2.0-r20)
    ERROR: alpine-baselayout-data-3.2.0-r20: trying to overwrite etc/fstab owned by postmarketos-base-15-r7.

    u-boot-pinephone

    (351/676) Upgrading u-boot-pinephone (2021.10-r0 -> 2021.10-r1)
    Executing u-boot-pinephone-2021.10-r1.post-upgrade
    Using default clock: 528 MHz
    Using default clock: 528 MHz
    usage: /usr/sbin/update-u-boot [-n,--dry-run] [-i,--imagedir <imagedir>] [-b|--board <board-type>] [-d|--device <device>] [-r|--ram-freq <freq>] [-s|--skip-delay]
    
    options:
    
     -b,--board <board>       Specify the board type: pinephone, pinetab
                              (current default: none)
    
     -d,--device <device>     Specify the device where to install u-boot
                              (current default: none)
    
     -i,--imagedir <imagedir> Specify u-boot image directory
                              (current default: /usr/share/u-boot)
    
     -n,--dry-run             Print commands but don't execute them
    
     -r,--ram-freq            RAM clock speed, one of:
                              * 528 (default for new postmarketOS installations)
                              * 552 (default before v21.03 / edge 2021-04-05)
                              * 624
    
     -s,--skip-delay          Skip delay and flash the image immediately 
    
    ERROR: u-boot-pinephone-2021.10-r1.post-upgrade: script exited with error 1

    By Dylan Van Assche on 2022-04-24T09:40:40

  • Administrator changed the description · Imported

    changed the description

    By Dylan Van Assche on 2022-04-24T09:42:10

  • Administrator changed the description · Imported

    changed the description

    By Dylan Van Assche on 2022-04-24T09:43:13

    • Author Owner
      Resolved by Administrator

      Thanks a lot for starting this @dylanvanassche!

      • I suggest to put this into a different repository, created postmarketos-release-upgrade.git. Can you create a follow-up MR there? Reasons:

        • monitoring.git CI runs hourly, whereas I think we should run the release upgrade test daily. It takes longer, and having it daily should be enough.
        • the plan is to make a script / cli program that deals with some quirks eventually, which will need its own repository anyway
      • Can you create a .gitlab-ci.yml that actually runs the script, so we can see the errors?

      • Let's make the source branch and the device arguments, so we can easily test other combinations. (Either env vars or cmdline args)

      • Calls directly to the pmbootstrap api like pmb.install._install.create_device_rootfs(args, 2, 2) are a bit fragile. In this test, I think we can do everything by running pmbootstrap as command-line program. And while at it, maybe the whole script becomes a lot simpler if you run it as shell script? Something like this, untested:

      #!/bin/sh -ex
      # copyright, license GPL-3.0-or-later etc.
      
      DEVICE="${DEVICE:-qemu-amd64}"
      UI="${UI:phosh}"
      CHANNEL_OLD="${CHANNEL_OLD:v21.12}"
      CHANNEL_NEW="${CHANNEL_NEW:edge}"
      WORK="$(pmbootstrap -q config work)"
      
      # switch branch etc, see
      # https://gitlab.com/postmarketOS/build.postmarketos.org/-/blob/master/bpo/job_services/sourcehut.py#L80-94
      
      pmbootstrap -q config device "$DEVICE"
      pmbootstrap -q config ui "$UI"
      
      pmbootstrap install --no-image --password test
      
      cp upgrade.sh "$WORK"/chroot_rootfs_$DEVICE/tmp/upgrade.sh
      
      pmbootstrap -q chroot -r -- /tmp/upgrade.sh "$CHANNEL_OLD" "$CHANNEL_NEW"

      Then have a second upgrade.sh script, which will run inside the chroot, and

      • runs sed on /etc/apk/repositories like your current script does
      • apply any quirks, e.g. to fix the postmarketos-base /etc/fstab thing

      Note that some commands have "-q" to shorten the output if it wouldn't print anything interesting anyway.

      • Regarding the 2 failures:
        • alpine-baselayout-data-3.2.0-r20: trying to overwrite etc/fstab: legitimate error. postmarketos-base already "replaces" "alpine-baselayout-data". Not sure how to resolve this best, but for now we could add a quirk in the upgrade script to take care of this. Maybe it works by installing postmarketos-base first, or by running apk fix afterwards? Fixing it "properly" would be best of course, but I'd focus on getting the upgrade test script working at all.
        • u-boot-pinephone: probably trying to write the bootloader and failing to do that while running in qemu / pmb chroot. I'd just use the amd64-qemu device for now to circumvent this.

      By Oliver Smith on 2022-04-25T11:28:49

      Edited by Ghost User
  • Administrator mentioned in merge request postmarketos-release-upgrade!1 (merged) · Imported

    mentioned in merge request postmarketos-release-upgrade!1 (merged)

    By Dylan Van Assche on 2022-04-25T17:04:47

  • Administrator resolved all threads · Imported

    resolved all threads

    By Dylan Van Assche on 2022-04-25T18:23:52

  • Administrator closed · Imported

    closed

Please register or sign in to reply
Loading