canonical / ubuntu-flavor-installer

Ubuntu Desktop Installer starting point for Ubuntu flavors.
https://github.com/canonical/ubuntu-desktop-installer
GNU General Public License v3.0
8 stars 4 forks source link

Flavours - how can we test our slides #3

Closed fossfreedom closed 1 year ago

fossfreedom commented 1 year ago

Hi there,

the current instructions in the README starts the installer from the first installer screen. I'm a little nervous running through since it appears to want to erase my disk - will it?

I just want to see how the slideshow will appear. In ubiquity there is a test slideshow app. With the new installer is there a similar way to just start at the slideshow itself to see how they will appear?

jpnurmi commented 1 year ago

Hey, the UI runs Subiquity in dry-run mode by default.

For testing purposes, there's a hidden --initial-route command-line argument that lets you jump straight to a specific page. If you're using e.g. VS Code, you can add it to the launch configuration. Passing it from the command-line using the Flutter tool:

flutter run -a "--initial-route=/installation-slides"

or running the executable directly:

./build/linux/x64/debug/bundle/ubuntu-flavor-installer --initial-route=/installation-slides

I'll add some docs next week. :)

fossfreedom commented 1 year ago

Hi,

is there anyway to get the two column format we had for ubiquity slideshows - i.e. text on the left handside and a graphic on the right handside? At the moment text just spills across the screen.

jpnurmi commented 1 year ago

I've added a bit more realistic examples:

The slides can be composed of any Flutter widgets, basically. There's a nice overview of layouts in Flutter.

fossfreedom commented 1 year ago

@jpnurmi I've knocked together a slideshow for UB. Needs more finesse but its something we can proceed with

https://github.com/UbuntuBudgie/ubuntu-flavor-installer

Thoughts and next steps? TIA

jpnurmi commented 1 year ago

Nice! I must warn you that at the same time, our design team has started looking into modernizing the slides. I can't tell yet how exactly it'll affect flavors but it's likely that the slide layout will change to something more scalable in the near future.

Have you looked into building an image yet? It would be good to see whether Subiquity is able to handle flavors or if there's anything that needs adjustments.

jpnurmi commented 1 year ago

Did you disable PRs on purpose? :)

diff --git a/lib/main.dart b/lib/main.dart
index 1e0e98d..33a40e3 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -9,8 +9,8 @@ Future<void> main(List<String> args) {
     args,
     flavor: FlavorData(
       name: 'Ubuntu Budgie',
-      theme: yaruLight,
-      darkTheme: yaruDark,
+      theme: yaruUbuntuBudgieLight,
+      darkTheme: yaruUbuntuBudgieDark,
       localizationsDelegates: AppLocalizations.localizationsDelegates,
     ),
     slides: [
jpnurmi commented 1 year ago

I noticed that UbuntuBudgie/ubuntu-flavor-installer is marked as a template and shows up as a fork of canonical/ubuntu-flavor-installer. I wonder if it might work better in terms of PRs if you press the "Use this template" button in canonical/ubuntu-flavor-installer to generate a new repo instead to detach it from this template repo.

fossfreedom commented 1 year ago

Re building images

That's thus Q I raised https://github.com/canonical/ubuntu-desktop-installer/issues/1352

When we became an official flavour I remember the release team helped heavily getting ubiquity stuff and image building stuff sorted out.

I don't know the in's and out's on all of this ... I e. Where do we proceed from here?

I don't believe there are budgie variants of yaru... we don't ship with yaru stuff in our images

jpnurmi commented 1 year ago

The Yaru theme for Flutter comes with lots of variants, including various Ubuntu flavors.

You can build a custom Flutter theme if you prefer but using the ready-made Yaru variant with Ubuntu Budgie blue is the easiest way to get started :)

https://pub.dev/documentation/yaru/latest/yaru/yaru-library.html

jpnurmi commented 1 year ago

I can help with anything Flutter-related but I'm not an expert when it comes to building the image. :) But I believe we'd start by building a snap out of the Ubuntu Budgie installer, and somehow seed that on the image, replacing ubuntu-desktop-installer.

fossfreedom commented 1 year ago

I've used the template button to create https://github.com/ubuntu-budgie-installer

I've followed the README instructions but the flutter run -d linux returns

flutter run -d linux
Launching lib/main.dart on Linux in debug mode...
ERROR: /home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-05e3654441e5616bc8c1e1f67abd39aa80a02e4b/packages/ubuntu_desktop_installer/lib/pages/installation_slides/installation_slides_model.dart:28:63: Error: Type 'SystemShutdown' not found.
ERROR: class InstallationSlidesModel extends SafeChangeNotifier with SystemShutdown {
ERROR:                                                               ^^^^^^^^^^^^^^
ERROR: /home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-05e3654441e5616bc8c1e1f67abd39aa80a02e4b/packages/ubuntu_desktop_installer/lib/pages/installation_slides/installation_slides_model.dart:28:7: Error: The type 'SystemShutdown' can't be mixed in.
ERROR: class InstallationSlidesModel extends SafeChangeNotifier with SystemShutdown {
ERROR:       ^
ERROR: /home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-05e3654441e5616bc8c1e1f67abd39aa80a02e4b/packages/ubuntu_desktop_installer/lib/installer.dart:102:3: Error: Method not found: 'onWindowClosed'.
ERROR:   onWindowClosed().then((_) async {
ERROR:   ^^^^^^^^^^^^^^
ERROR: /home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-05e3654441e5616bc8c1e1f67abd39aa80a02e4b/packages/ubuntu_desktop_installer/lib/installer.dart:211:19: Error: The method 'setWindowTitle' isn't defined for the class '_UbuntuDesktopInstallerAppState'.
ERROR:  - '_UbuntuDesktopInstallerAppState' is from 'package:ubuntu_desktop_installer/installer.dart' ('/home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-05e3654441e5616bc8c1e1f67abd39aa80a02e4b/packages/ubuntu_desktop_installer/lib/installer.dart').
ERROR: Try correcting the name to the name of an existing method, or defining a method named 'setWindowTitle'.
ERROR:                   setWindowTitle(lang.windowTitle(widget.flavor.name));
ERROR:                   ^^^^^^^^^^^^^^
ERROR: /home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-05e3654441e5616bc8c1e1f67abd39aa80a02e4b/packages/ubuntu_desktop_installer/lib/pages/try_or_install/try_or_install_page.dart:79:7: Error: No named parameter with the name 'footer'.
ERROR:       footer: Html(
ERROR:       ^^^^^^
ERROR: /home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-4240284b258779531aca374b9b61fc06e6e0d588/packages/ubuntu_wizard/lib/src/widgets/wizard_page.dart:17:9: Context: Found this candidate, but the arguments don't match.
ERROR:   const WizardPage({
ERROR:         ^^^^^^^^^^
ERROR: /home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-05e3654441e5616bc8c1e1f67abd39aa80a02e4b/packages/ubuntu_desktop_installer/lib/pages/updates_other_software/updates_other_software_page.dart:103:7: Error: No named parameter with the name 'footer'.
ERROR:       footer: model.onBattery
ERROR:       ^^^^^^
ERROR: /home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-4240284b258779531aca374b9b61fc06e6e0d588/packages/ubuntu_wizard/lib/src/widgets/wizard_page.dart:17:9: Context: Found this candidate, but the arguments don't match.
ERROR:   const WizardPage({
ERROR:         ^^^^^^^^^^
ERROR: /home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-05e3654441e5616bc8c1e1f67abd39aa80a02e4b/packages/ubuntu_desktop_installer/lib/pages/installation_slides/installation_slides_model.dart:141:18: Error: Superclass has no method named 'reboot'.
ERROR:     return super.reboot(immediate: immediate);
ERROR:                  ^^^^^^
ERROR: /home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-05e3654441e5616bc8c1e1f67abd39aa80a02e4b/packages/ubuntu_desktop_installer/lib/pages/not_enough_disk_space/not_enough_disk_space_model.dart:22:18: Error: The method 'closeWindow' isn't defined for the class 'NotEnoughDiskSpaceModel'.
ERROR:  - 'NotEnoughDiskSpaceModel' is from 'package:ubuntu_desktop_installer/pages/not_enough_disk_space/not_enough_disk_space_model.dart' ('/home/dad/snap/flutter/common/flutter/.pub-cache/git/ubuntu-desktop-installer-05e3654441e5616bc8c1e1f67abd39aa80a02e4b/packages/ubuntu_desktop_installer/lib/pages/not_enough_disk_space/not_enough_disk_space_model.dart').
ERROR: Try correcting the name to the name of an existing method, or defining a method named 'closeWindow'.
ERROR:   void quit() => closeWindow();
ERROR:                  ^^^^^^^^^^^
ERROR: Target kernel_snapshot failed: Exception

any ideas?

jpnurmi commented 1 year ago

Managing these Git dependencies with sha1's in pubspec_overrides.yaml feels a bit clumsy but I don't have a better idea for the time being...

EDIT: Thanks for bringing it up! :)

fossfreedom commented 1 year ago

@jpnurmi many thanks - that has resolved matters.

Hopefully in the last stretch on creating the slides etc.

I am now trying to run snapcraft build but I see this during building - any ideas?

Building wheels for collected packages: pyyaml, bson, urwid
  Building wheel for pyyaml (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /root/parts/curtin/install/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_kbgtv5c/pyyaml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_kbgtv5c/pyyaml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ol4u7vj2
       cwd: /tmp/pip-install-_kbgtv5c/pyyaml/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for pyyaml
  Running setup.py clean for pyyaml
  Building wheel for bson (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /root/parts/curtin/install/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_kbgtv5c/bson/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_kbgtv5c/bson/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ug6o9tzx
       cwd: /tmp/pip-install-_kbgtv5c/bson/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for bson
  Running setup.py clean for bson
  Building wheel for urwid (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /root/parts/curtin/install/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_kbgtv5c/urwid/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_kbgtv5c/urwid/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-b7l8t4g4
       cwd: /tmp/pip-install-_kbgtv5c/urwid/
  Complete output (46 lines):
  Traceback (most recent call last):
    File "/usr/lib/python3.8/distutils/dist.py", line 539, in _parse_command_opts
      cmd_class = self.get_command_class(command)
    File "/root/parts/curtin/install/lib/python3.8/site-packages/setuptools/dist.py", line 837, in get_command_class
      return _Distribution.get_command_class(self, command)
    File "/usr/lib/python3.8/distutils/dist.py", line 843, in get_command_class
      raise DistutilsModuleError("invalid command '%s'" % command)
  distutils.errors.DistutilsModuleError: invalid command 'bdist_wheel'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/distutils/core.py", line 134, in setup
      ok = dist.parse_command_line()
    File "/root/parts/curtin/install/lib/python3.8/site-packages/setuptools/dist.py", line 707, in parse_command_line
      result = _Distribution.parse_command_line(self)
    File "/usr/lib/python3.8/distutils/dist.py", line 483, in parse_command_line
      args = self._parse_command_opts(parser, args)
    File "/root/parts/curtin/install/lib/python3.8/site-packages/setuptools/dist.py", line 1014, in _parse_command_opts
      nargs = _Distribution._parse_command_opts(self, parser, args)
    File "/usr/lib/python3.8/distutils/dist.py", line 541, in _parse_command_opts
      raise DistutilsArgError(msg)
  distutils.errors.DistutilsArgError: invalid command 'bdist_wheel'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/tmp/pip-install-_kbgtv5c/urwid/setup.py", line 82, in <module>
      setup(**setup_d)
    File "/root/parts/curtin/install/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3.8/distutils/core.py", line 136, in setup
      raise SystemExit(gen_usage(dist.script_name) + "\nerror: %s" % msg)
  SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  Couldn't build the extension module, trying without it...
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help

  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for urwid
  Running setup.py clean for urwid
Failed to build pyyaml bson urwid
jpnurmi commented 1 year ago

Those errors have been there for a long time but they should not be critical:

Does it finish to build the snap regardless like it does for me?

$ snapcraft 
Launching a container.
Waiting for container to be ready
Created symlink /etc/systemd/system/dbus-org.freedesktop.network1.service → /lib/systemd/system/systemd-networkd.service.
Waiting for network to be ready...
[...]
Priming ubuntu-flavor-installer 
+ snapcraftctl prime
Determining the version from the project repo (version: git).
The version has been set to '0+git.14b4f78'
Icon ubiquity specified in desktop file bin/data/flutter_assets/assets/ubuntu-flavor-installer.desktop not found in prime directory
Snapping |                                                                                                                                                                        
Snapped ubuntu-flavor-installer_0+git.14b4f78_amd64.snap
fossfreedom commented 1 year ago

cheers - yes I can confirm that the snap builds - just was a worrying error on the build that I wanted assurance for.

I installed the snap on our live session - unfortunately there are quite a few subiquity errors I noticed in the terminal after running snap run ubuntu-flavor-installer and the installer doesnt get past the installer type screen.

But thats a new issue probably. thx for your help - much appreciated.

On Fri, 3 Mar 2023 at 08:15, J-P Nurmi @.***> wrote:

Those errors have been there for a long time but they should not be critical:

Does it finish to build the snap regardless like it does for me?

$ snapcraft

Launching a container.

Waiting for container to be ready

Created symlink /etc/systemd/system/dbus-org.freedesktop.network1.service → /lib/systemd/system/systemd-networkd.service.

Waiting for network to be ready...

[...]

Priming ubuntu-flavor-installer

  • snapcraftctl prime

Determining the version from the project repo (version: git).

The version has been set to '0+git.14b4f78'

Icon ubiquity specified in desktop file bin/data/flutter_assets/assets/ubuntu-flavor-installer.desktop not found in prime directory

Snapping |

Snapped ubuntu-flavor-installer_0+git.14b4f78_amd64.snap

— Reply to this email directly, view it on GitHub https://github.com/canonical/ubuntu-flavor-installer/issues/3#issuecomment-1453141341, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHTHEGLN6TWYKVMT362UALW2GSBVANCNFSM6AAAAAAUYIBEEI . You are receiving this because you authored the thread.Message ID: @.***>

jpnurmi commented 1 year ago

Awesome, that's great progress! :) Let's close the original issue about the slides and we can then continue with more targeted issues for the remaining things. Thanks!

P.S. Please attach the logs in /var/log/installer when we might be dealing with any subiquity/curtin/probert related issues.