Commit Graph

4762 Commits

Author SHA1 Message Date
Dan Bungert a17bd659e2 filesystem: move MiB constant to fix import loop 2022-03-09 17:43:18 -07:00
Dan Bungert 05310f2ffd
Merge pull request #1205 from dbungert/partition-sizing
sizing: scaling funcs usage & constants
2022-03-09 16:23:01 -07:00
Dan Bungert 9554b2471c client fs: drop duplicate constants 2022-03-09 15:06:28 -07:00
Dan Bungert 00d239f2c2 sizing: scaling funcs usage & constants
Move these around so that we don't need a manipulator instance to use.
2022-03-09 14:34:14 -07:00
Olivier Gayot ffc0502e48
Merge pull request #1203 from ogayot/detect-warnings
Better detect server-side warnings / errors in integration tests
2022-03-09 09:23:47 +01:00
Dan Bungert e491da11a0
Merge pull request #1204 from jpnurmi/setxkbmap
keyboard: run setxkbmap for the desktop installer
2022-03-08 13:19:39 -07:00
J-P Nurmi 0a3cd5c40d keyboard: run setxkbmap for the desktop installer 2022-03-08 21:06:14 +01:00
Olivier Gayot 7b5b9506f3
Merge pull request #1202 from ogayot/lsb-jammy
Force ubuntu-advantage screen to show in jammy installer until it is marked LTS
2022-03-08 18:18:51 +01:00
Olivier Gayot 813448683c Enable tracemalloc in integration tests with at most 3 frames
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-08 12:12:07 +01:00
Olivier Gayot a1df5ea409 Make integration tests fail if anything shows up in server-stderr
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-08 12:12:07 +01:00
Olivier Gayot 9856b79f36 Redirect stdout and stderr from server into two distinct files
Instead of having interleaved stdout and stderr in server-output, we now
have respectively:

* stdout redirected to server-stdout
* stderr redirected to server-stderr

This will allow us to monitor for warnings / errors more efficiently.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-08 12:12:07 +01:00
Olivier Gayot 9a5e5b3406
Merge pull request #1201 from ogayot/fix-ud-await
Fix not awaited ubuntu-drivers command existence check
2022-03-08 10:56:31 +01:00
Olivier Gayot 23a66ad335 ubuntu-advantage: handle expiration date with Z time zone suffix
RFC3339 allows dates to use the Z suffix instead of a time zone offset
of 0. Unfortunately, this is not supported by Python
datetime.date.fromisoformat. Work around the issue by replacing the
optional Z character with +00:00 before parsing the date.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-08 10:03:14 +01:00
Olivier Gayot 0af416c388 ubuntu-advantage: show screen on Jammy which is not yet marked LTS
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-08 09:32:03 +01:00
Michael Hudson-Doyle e6d2c8bdb8
Merge pull request #1185 from ogayot/systemd-run
Add option to run commands with private mounts and use it for curtin in-target
2022-03-08 09:34:41 +13:00
Dan Bungert 6927d3bec8
Merge pull request #1199 from dbungert/aptdep-cloudinit
aptdeps: cloud-init, cleanup
2022-03-07 08:14:13 -07:00
Olivier Gayot 45e919eb51 Fix not awaited ubuntu-drivers command existence check
The ensure_cmd_exists() coroutine from ubuntu_drivers was never awaited.
Therefore, the check would always silently succeed. Taking a look in
server-output would show the warning though:

RuntimeWarning: coroutine
'UbuntuDriversHasDriversInterface.ensure_cmd_exists' was never awaited
  self.ubuntu_drivers.ensure_cmd_exists(d.mountpoint)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Also, the implementation of ensure_cmd_exists() when
SUBIQUITY_DEBUG=run-drivers is set was failing because we use a shell
builtin as an executable. This was not noticed since ensure_cmd_exists()
was not executed and arun_command() does not check for errors by
default.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-07 15:51:46 +01:00
Olivier Gayot 9bbe592794 Merge remote-tracking branch 'upstream/main' into systemd-run
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-07 10:52:22 +01:00
Dan Bungert c3a8285300 aptdeps: move to external file
This info is redundant, and contained depends in one spot that were not
in the other.  Centralize.
2022-03-04 10:49:23 -07:00
Dan Bungert dbbf43e945 aptdeps: +cloud-init 2022-03-04 10:49:23 -07:00
Dan Bungert c769ae1845
Merge pull request #1198 from jpnurmi/install-deps
Allow calling installdeps.sh from anywhere
2022-03-04 10:49:02 -07:00
J-P Nurmi cbde0a4762 Allow calling installdeps.sh from anywhere
It's nice for the desktop installer contributors to be able to run
"./path/to/subiquity/scripts/installdeps.sh" without changing dir.
2022-03-04 18:35:37 +01:00
Michael Hudson-Doyle d1d3f82be5
Merge pull request #1194 from ogayot/fix-post-drivers
Fix POST to drivers not using payload wrapper for install
2022-03-02 11:12:52 +13:00
Olivier Gayot b63939497d Fix POST to drivers not using payload wrapper for install
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-01 10:32:05 +01:00
Olivier Gayot 2e6fffe02b
Merge pull request #1179 from ogayot/FR-2025
Server-side implementation of third-party drivers
2022-03-01 10:21:59 +01:00
Dan Bungert e35cc87a69
Merge pull request #1193 from dbungert/the-os-prober-saga
os-prober: installer newer version
2022-02-28 16:20:55 -07:00
Dan Bungert 1f8569fcf1
Merge pull request #1176 from dbungert/FR-1182-dual-boot
storage/v2: expose Gap object
2022-02-28 16:20:43 -07:00
Dan Bungert b8db34bb21 test/api: add test for partition to existing table 2022-02-28 16:05:12 -07:00
Dan Bungert 838b83b0b5 test/api: add test for multi-gap case
This test should work once multi-gap is ready, but skip for now since
the gap is reported as one large one.
2022-02-28 16:05:12 -07:00
Dan Bungert e1911cba93 test/api: add notes about debug usage 2022-02-28 16:05:12 -07:00
Dan Bungert e64b3781f9 ui: ignore Gap object in Partition list summary 2022-02-28 16:05:12 -07:00
Dan Bungert e5770f029a storage/v2: start showing Gaps on the v2 api 2022-02-28 16:05:12 -07:00
Dan Bungert 16d0325cf8 storage/v2: reject partition add with no space 2022-02-28 16:05:12 -07:00
Dan Bungert c68a32fe42 examples: add disk with free space at end 2022-02-28 16:01:49 -07:00
Dan Bungert 5124762de4 probert: rev for os-prober, mdadm 2022-02-28 15:56:04 -07:00
Dan Bungert 9179777aa2 os-prober: use snapified source
Use my branch of os-prober which adds env variables for finding the lib
& share directories.  And set those env variables.
2022-02-28 15:56:04 -07:00
Dan Bungert 3b6f6024ae os-prober: build from a git
Build os-prober from a git repo instead of staging the focal version.
Point to my mirror of os-prober as salsa is currently down.
2022-02-28 15:00:25 -07:00
Dan Bungert 1ebdc91c7c
Merge pull request #1192 from dbungert/lp-1962025-update-answers
refresh: cancel the task waiting on update
2022-02-28 14:28:54 -07:00
maces 7c7b6da7f6 fixing swap path + support partition size units
- The 20.04 autoinstaller expects a swap path of 'none'
- Added support for the working units for partition sizes
2022-02-28 13:00:13 -07:00
Dan Bungert c8a4b09376 refresh: cancel the task waiting on update
Per LP: #1962025, the update screen can get stuck in test automation.
Cancel the task waiting to see if there is an update, which makes sense
more broadly anyhow in that if a regular UI user has declined the
update then the check task is no longer helpful.
2022-02-28 10:30:29 -07:00
Olivier Gayot 0ca56056ca Use systemd-run --user when non-root
Instead of using systemd-cat in dry-run mode and systemd-run in normal
mode, we now use systemd-run all the time but pass the --user switch
when running as non-root.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-28 14:13:17 +01:00
Olivier Gayot 5108f4cb1e Use private mounts when running curtin in-target & apt-config commands
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-28 14:13:16 +01:00
Olivier Gayot 87c249d5d0 Add type annotations for command execution methods
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-28 14:05:56 +01:00
Olivier Gayot 689173ad22 Add option to run commands with private mounts
The LoggedCommandRunner now has the option to start a command with
private mounts enabled - see mount_namespaces(7).

To use this feature, we now rely on systemd-run instead of systemd-cat.
The main benefit is that it should allow us not to worry about mounts
refusing to be un-mounted after executing a curtin in-target command.

On the downside, systemd-run requires root privileges (unless --user is
available) so we can't use it in dry-run mode. For dry-run mode, we
still need to rely on systemd-cat.

Another downside is that the commands passed to systemd-run are run in a
clean environment. Therefore, we must explicitly set the environment
variables that we want to pass to the commands to execute.

I came up with a short list of environment variables that we need but we
might need to add more later.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-28 14:05:56 +01:00
Olivier Gayot fe6d0878fc Make sure the FS unmounted were previously mounted in dry-run mode
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-27 20:16:14 +01:00
Olivier Gayot 3c9e5ca98f Use body for parameters of POST /drivers
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-27 20:16:14 +01:00
Olivier Gayot 98860b10ca Fix unmount of overlay broken by merge
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-27 20:16:14 +01:00
Olivier Gayot 382f73150d Add unit-tests for ubuntu-drivers
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-27 20:16:14 +01:00
Olivier Gayot f50b5c0057 Make sure the drivers ctrler calls .configured until we have client ctrler
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-27 20:16:14 +01:00
Olivier Gayot de148289aa Move the calls to ubuntu-drivers out of the drivers controller
We now provide implementation for different interfaces to list and
install drivers using ubuntu-drivers. The implementations are outside
the drivers controller.

We have:
 * the normal interface that calls ubuntu-drivers in the root directory
   specified (i.e., in /target or an overlay).
 * a dry-run interface that calls the system's ubuntu-drivers for
   listing the drivers available (but does not install anything).
   The listing of drivers will fail if --recommended is not an available
   option in the system's ubuntu-drivers implementation.
 * a dry-run interface that returns an hard-coded list of drivers and
   does nothing on installation.
 * a dry-run interface that returns an empty list of drivers.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-27 20:16:14 +01:00