-
Notifications
You must be signed in to change notification settings - Fork 159
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
mirror: if the mirror test fails, suggest an offline install #1968
mirror: if the mirror test fails, suggest an offline install #1968
Conversation
The /mirror GET and POST endpoints now include a boolean field named "use_during_installation". * if set to True, the mirror information will be used during installation to fetch packages online. * if set to False, we will only fetch packages from the pool. In either case, the mirror information will still be used to build the etc/apt/ directory in the target system. Currently, the way use_during_installation is implemented is coupled with the force_offline property of the network model. This means that Ubuntu Pro and other stuff will be disabled too if we're skipping the use of the archive. NOTE: the default value for "use_during_installation" in the POST endpoint is `null` ; which means that we should not change the current value of force_offline. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
NOTE, when testing in a VM, I noticed another issue that is technically unrelated but prevents the user from going back to the mirror screen. The order of the screens is "... -> Mirror -> Refresh -> Storage -> ...". After moving from Mirror to Storage, hitting Back moves us the Refresh page again ; which finds nothing to do and therefore calls .done(), moving forward to Storage again. Will raise a launchpad bug for it. EDIT LP:#2060964 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose that we take the needed parts from this PR and add in the policy change from #1816 but do so across the board - OFFLINE_INSTALL as the fallback across the board. WDYT?
Honestly, I've never been a fan of
With that in mind, I'll still implement the change and we can discuss further. |
subiquity/ui/views/mirror.py
Outdated
|
||
log.debug("User input: {}".format(result.as_data())) | ||
if self.has_network and self.last_status in [ | ||
MirrorCheckStatus.RUNNING, | ||
MirrorCheckStatus.FAILED, | ||
None, | ||
]: | ||
async_helpers.run_bg_task(confirm_continue_anyway()) | ||
status_is_failed = bool(self.last_status == MirrorCheckStatus.FAILED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: bool()
is redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped the bool construct but kept the parenthesis for readability, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well... black does not like the parentheses so I guess that's why I used bool() in the first place. Will do status_is_failed = self.last_status == MirrorCheckStatus.FAILED
then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one (annoying) question but this looks good to me otherwise.
subiquity/ui/views/mirror.py
Outdated
" likely that the installation will fail." | ||
"The check of the mirror URL failed. If you decide to continue, only" | ||
" packages present on the installation media will be considered for" | ||
" installation." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be hard to do in a way that is short enough to be clear but should we say something about the consequences of this, i.e. missing security updates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of
- "The check of the mirror URL failed. You can continue, but it is very"
- " likely that the installation will fail."
+ "The check of the mirror URL failed. If you decide to continue, only"
+ " packages present on the installation media will be considered for"
+ " installation. Remember to install security updates after booting"
+ " your newly installed system."
@@ -227,17 +228,19 @@ async def confirm_continue_anyway() -> None: | |||
) | |||
|
|||
if confirmed: | |||
self.controller.done(result.url.value) | |||
skip_archive = True if continue_skip_archive else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The True/False/None tristate is a bit confusing but well. One thing at a time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that 🙃
In the mirror screen, if the test fails and the user decides to ignore the failure, we used to continue the installation normally ; which in most scenarios resulted in an error at a later stage of the installation. Instead, we now revert to an installation without network (i.e., only packages from the pool are considered for installation) if the user decides to ignore the failure. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
ca71e23
to
0bb4915
Compare
Client / TUI change
In the mirror screen, if the test fails and the user decides to ignore the failure, we used to continue the installation normally ; which in most scenarios resulted in an error at a later stage of the installation.
Instead, we now revert to an installation without network (i.e., only packages from the pool are considered for installation) if the user decides to ignore the failure.
Current design:
Proposed design:
Previously proposed design
Note that the behavior hasn't changed if the user decides to skip the test while it is running,
Backend change
The /mirror GET and POST endpoints now include a boolean field named
use_during_installation
.True
, the mirror information will be used during installation to fetch packages online.False
, we will only fetch packages from the pool.In either case, the mirror information will still be used to build the
etc/apt/
directory in the target system.Currently, the way use_during_installation is implemented is coupled with the force_offline property of the network model. This means that Ubuntu Pro and other stuff will be disabled too if we're skipping the use of the archive.
NOTE: the default value for "use_during_installation" in the POST endpoint is
null
; which means that we should not change the current value of force_offline.LP:#2059898 and similar reports