Commit Graph

5733 Commits

Author SHA1 Message Date
Michael Hudson-Doyle 18346e3f74
Merge pull request #1591 from mwhudson/install-same-disk
allow autoinstalls to use the disk the installer booted from
2023-03-15 15:16:39 +13:00
Dan Bungert 71a5788c43
Merge pull request #1593 from dbungert/SingleInstanceTask-wait
Single instance task wait
2023-03-13 19:59:32 -06:00
Dan Bungert 0a7d4a82a7 storage: use SingleInstanceTask improvements 2023-03-13 15:50:33 -06:00
Dan Bungert 98a2ff8647 async_helpers: simplify task done check
Another version of the task-created-yet problem is the non-blocking
check to see if it is done or not.  Add a wrapper here to simplify
calling code.
2023-03-13 15:50:33 -06:00
Dan Bungert 075b06ce70 async_helpers: make SingleInstanceTask.wait safer
SingleInstanceTask has distinct steps for creation of the object, and
starting the task.  If a different coroutine is waiting on the
SingleInstanceTask, it isn't safe to directly call
SingleInstanceTask.wait() as the task may or may not have been created
yet.

Existing code usage of SingleInstanceTask is in 4 categories, with
reguards to SingleInstanceTask.wait():
1) using SingleInstanceTask without using SingleInstanceTask.wait().
   This is unchanged.
2) using SingleInstanceTask.wait without a check on task is not None.
   This may be safe now, but is fragile in the face of innocent-looking
   refactors around the SingleInstanceTask.
3) using SingleInstanceTask.wait after confirming that the task is not
   None.  This is fine but a leaky abstraction.
4) directly waiting on the SingleInstanceTask.task.  Another leaky
   abstraction, but it's solving a cancellation problem.  Leaving this
   alone.

By enhancing SingleInstanceTask.wait(), cases 2 and 3 are improved.  The
code not checking the task today is made safer, and the code checking
the task today can be simplified.
2023-03-13 15:50:33 -06:00
Dan Bungert 88a1fbd4ba make: timeout on unit tests
We aren't close to hitting this timeout in unit tests that I can see,
but some of the asyncio tests I'm writing for now risk a hang and I
don't want to get CI stuck.
2023-03-10 15:59:17 -07:00
Dan Bungert 91fe266b34
Merge pull request #1592 from dbungert/ref-password
docs: update expectations for password
2023-03-10 08:20:50 -07:00
Dan Bungert fcf329e172 docs: update expectations for password 2023-03-10 07:58:37 -07:00
Michael Hudson-Doyle a95530ab14 oops 2023-03-10 14:35:55 +13:00
Michael Hudson-Doyle 7902233d8a hide the install media differently 2023-03-09 23:18:27 +13:00
Dan Bungert f24c76bc50
Merge pull request #1590 from dbungert/block-probing-timeouts
storage: lengthen and log probing time
2023-03-08 12:35:31 -07:00
Dan Bungert 79c38b086d
Merge pull request #1589 from dbungert/lp-2009151-manual-part-add-boot
storage/v2: endpoint for boot-plausible disks
2023-03-07 22:24:36 -07:00
Dan Bungert 9d78aed696 storage: lengthen and log probing time
A reasonably common type of bug report is hitting the block probing
timeout.  That timeout is at 15 seconds today.  Extend that to 90
seconds, and log the time it takes.

As a performance exercise, it would be good to know where that time is
being spent and why it takes 10x longer or more for some people.
2023-03-07 19:10:15 -07:00
Dan Bungert 8524f657b4 storage: s/get_guided_disks/potential_boot_disks/
This routine only answers the bootable question, it doesn't consider
other guided-required criteria such as sizing.
2023-03-07 16:07:57 -07:00
Dan Bungert 10e22a96d7 storage/v2: endpoint for boot-plausible disks 2023-03-07 15:41:47 -07:00
Carlos Nihelton 65e100eed9
Merge pull request #1581 from CarlosNihelton/ad-autoinstall-deeng-587
Active Directory - Partial autoinstall support #&1F979
2023-03-07 12:40:46 -03:00
Carlos Nihelton 3565027e02
Moves the AD autoinstall test to the API testing
Test looks much simpler now.
One small addition in the Server testing class needed to expose the
output_base dir so we can inspect the logs.
2023-03-07 08:37:38 -03:00
Dan Bungert cfeb3fe163
Merge pull request #1584 from ogayot/mirror-testing-apt-warning
apt: force downloads to be unsandboxed when running mirror testing
2023-03-06 12:00:11 -07:00
Carlos Nihelton 82cb7bd33e
Merge pull request #1585 from CarlosNihelton/ad-split-domain-check
Active Directory - Split the domain validation endpoint in two
2023-03-06 09:00:56 -03:00
Carlos Nihelton 2625c233b0
Updates the integration to set variant and update AD
I couldn't find a way to set the variant as desktop in the autoinstall
file or command line.
Thus some shell scripting hackery runs curl to set the variant.
Also, GET /active_directory must provide user and domain, thus updating
the password and curl'ing again configures the AD controller.
2023-03-05 15:03:43 -03:00
Carlos Nihelton eb08609238
Updates the autoinstall-ad example file to '-' 2023-03-03 20:21:39 -03:00
Dan Bungert 86e7fbbc22
Merge pull request #1579 from acres-com-au/add-autoinstall-luks
Support LUKS with 'lvm' autoinstall storage layout
2023-03-03 13:58:46 -07:00
Olivier Gayot 2d37baa0b6
Merge pull request #1575 from ogayot/retry-downloads
when installing packages, try the download operation up-to 3 times
2023-03-03 20:48:19 +01:00
Carlos Nihelton 121cf3a18a
AD integration test - package found if not none
Fix logic error.
2023-03-03 15:38:16 -03:00
Carlos Nihelton 28f6c29ca1
Favors dash instead of underscore in autoinstall
Most autoinstall things are using dash instead of underscore.
2023-03-03 15:11:54 -03:00
Olivier Gayot af9c567484 install: try to download package up to 3 times
When installing a package, try the package download up to three times
before giving up.

The install is only tried once.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-03-03 17:36:02 +01:00
Carlos Nihelton cbb5755324
Split the domain validation endpoint in two
Ref https://github.com/canonical/ubuntu-desktop-installer/pull/1522#discussion_r1124397775

GUI could face performance issues in calling the validation on each char
the user type.
Separating the endpoints prevent such issue to ever happen.
2023-03-03 10:14:41 -03:00
Olivier Gayot 02b2febd0a apt: force downloads to be unsandboxed when running mirror testing
When apt is run as root, APT tries to drop privileges by setuid-ing to
the APT::Sandbox::User user (i.e., _apt by default). This does not work
for us when doing mirror testing because the default sandbox user does
not have access to the overlay. Therefore, APT produces a warning and
reverts to unsandboxed downloads.

Let's force apt to use unsandboxed downloads by setting root as the
sandbox user. This has the same result but avoids showing a warning in
the APT output during mirror testing.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-03-03 11:30:56 +01:00
Olivier Gayot f28b9bff32
Merge pull request #1583 from ogayot/mirror-testing-apt-options
Fix how we pass an alternative apt configuration file for mirror testing
2023-03-03 09:20:12 +01:00
Ryan Mounce f847293fac Disable debug logs that would leak LUKS password 2023-03-03 09:48:54 +10:30
Olivier Gayot 308e1d7ce3 mirror: specify only the etc directory for mirror testing
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-03-02 19:38:27 +01:00
Olivier Gayot 03a19a764e mirror: pass an alternative config file to apt through the environment
Sadly, passing an alternative config file to apt using -o CLI options
does not work because apt:

1) Reads the configuration file first
2) Reads CLI options (and override specified settings) second

Therefore, the default configuration file is always read, instead of the
one we supply.

To specify an alternative configuration file, the recommendation from
the apt maintainer is to supply an APT_CONFIG variable, hinting apt to
read said file instead of the default.

We now generate a temporary file, write the directives we need to it
using the python apt library, and then execute apt-get with a path to
this temporary file set in APT_CONFIG.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-03-02 19:37:58 +01:00
Olivier Gayot 13309781fa install: when installing package, download first and then install
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-03-02 16:05:26 +01:00
Olivier Gayot 2bf79ddee9 curtin: bump version so we can install a package in two steps
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-03-02 16:05:25 +01:00
Carlos Nihelton 2cede5aadd
No need for partial serialize/deserialize 2023-03-02 10:03:11 -03:00
Carlos Nihelton e40c147f5e
Adds active_directory to the autoinstall reference 2023-03-02 10:03:02 -03:00
Carlos Nihelton 68b6805677
Simpler AD integration test 2023-03-02 09:50:03 -03:00
Carlos Nihelton 7062e6ad3b
Consistent naming - part 2 - longer model name
sticking with "active_directory" for clarity.
2023-03-02 09:49:24 -03:00
Carlos Nihelton 2057dcd64a
Consistent naming - part 1 - AdModel
No other class starts with both capitals 'AD'.
2023-03-02 09:39:53 -03:00
Olivier Gayot 0bf1d65ccb
Merge pull request #1582 from ogayot/curthooks-fix
snapcraft: bump curtin rev to fix curthooks always running apt-config
2023-03-02 10:26:38 +01:00
Olivier Gayot a96ffafc7f snapcraft: bump curtin rev to fix curthooks always running apt-config
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-03-02 09:25:13 +01:00
Ryan Mounce a968b48523 Support LUKS with 'lvm' autoinstall storage layout
Resolves: https://bugs.launchpad.net/subiquity/+bug/1913986
2023-03-02 09:39:55 +10:30
Carlos Nihelton 03af76d431
AD integration testing
Currently only checks if the AD model causes packages to be installed
if the autoinstall contains AD data.
2023-03-01 15:23:30 -03:00
Carlos Nihelton b74ccb8d5d
Implements autoinstall for AD 2023-03-01 14:57:32 -03:00
Carlos Nihelton 65aabe527f
Merge pull request #1572 from CarlosNihelton/ad-result-deeng-577
Active Directory - Implement the actual join
2023-03-01 13:11:25 -03:00
Dan Bungert 359a5caa7d
Merge pull request #1578 from dbungert/lp-2008271-validate-kbd-layout
keyboard: validate layout and variant
2023-03-01 07:04:57 -07:00
Carlos Nihelton 33597e3c7d
Exception safe context manager
Without the try/finally the cleanup could be skipped by an exception
being raised.
2023-03-01 10:37:00 -03:00
Carlos Nihelton babf0255b9
Add the AD model into the POSTINSTALL_MODEL_NAMES
AD is by nature an optional feature.
Yet, we need to make its model part of the POSTINSTALL_MODEL_NAMES set.
That would turn this into a required controller.
Thus, explicitly mark AD as configured
For as long as TUI doesn't have a matching controller.
2023-03-01 10:36:20 -03:00
Olivier Gayot 11f66b9129
Merge pull request #1565 from ogayot/debconf-selections-in-apt-config
debconf-selections: pass to curtin's apt-config rather than curthooks
2023-03-01 13:01:45 +01:00
Olivier Gayot 4d4fe7ae8d
Merge pull request #1577 from ogayot/crash-adding-disk-to-vg
filesystem: don't offer tiny partitions / disks as potential PVs
2023-03-01 12:25:23 +01:00