Commit Graph

3800 Commits

Author SHA1 Message Date
Michael Hudson-Doyle d75af226a5 make subiquity.common.filesystem into a package 2021-05-31 22:59:59 +12:00
Marcus Tomlinson d444177932
Create socket directory from dirname not basename (#961) 2021-05-26 14:57:28 -06:00
Dan Bungert f27c424c8d
Open the permissions on the socket (#959)
* Open the permissions on the socket

Installer clients can be non-root.
Installer clients run in an environment where root is just a
password-less sudo away.

* Same permissions on the other socket also
2021-05-25 18:04:36 -06:00
Dan Bungert 657f27ebf9
Rearrange makefile targets (#960)
Skip a recursive make step and simplify a bit.
Add dryrun-server.
Also an unrelated whitespace fix.
2021-05-25 16:59:22 -06:00
Michael Hudson-Doyle 63fc286644
Merge pull request #958 from mwhudson/lp-1929129
do not crash in server start up if cloud-init is not running
2021-05-21 10:21:21 +12:00
Michael Hudson-Doyle 77576714ff do not crash in server start up if cloud-init is not running
such as desktop (for now) and bionic (oops)
2021-05-21 09:52:56 +12:00
Dan Bungert f1c7c17c19
Don't redundantly remove from the overlay list (#957)
There are two places that remove from this list, and the current arm64
crash is running into a scenario where we try to remove from the
overlays list only to find that it's not actually there.
So don't remove if it's already gone.
2021-05-19 20:18:56 -06:00
Dan Bungert 4f9de12556
Split unit / integration tests a bit (#956)
Unit tests should be quick and run frequently.
Integration tests can be longer and run less often.
Split them up.
2021-05-17 07:31:29 -06:00
Michael Hudson-Doyle 3cbcddb651
Merge pull request #954 from mwhudson/no-apport-hooks-in-dry-run-mode
do not run most apport hooks in dry-run mode
2021-05-14 04:31:14 +12:00
Michael Hudson-Doyle 77343cb160 do not run most apport hooks in dry-run mode
they are slow and can hang in CI
2021-05-14 04:27:25 +12:00
Michael Hudson-Doyle 0de5aec333
Merge pull request #950 from mwhudson/shell-on-autoinstall-fail
offer to run a shell after an autoinstall fails
2021-05-13 10:26:15 +12:00
Dan Bungert d04b6a9a3e
dryrun: use the simple machine config (#952)
`make dryrun` will now use the simple sample machine config instead of
probing local hardware.   That local probe only seems to be viable
anyhow if we're running as root, and that's vulnerable to real problems
if dryrun is less than 100% insulated from making real machine changes.
2021-05-12 16:23:58 -06:00
Michael Hudson-Doyle fcc542d436
Merge pull request #953 from mwhudson/traceback-in-response
include the traceback in the response when a server method fails
2021-05-13 07:00:01 +12:00
Michael Hudson-Doyle 7a6a984578 add a bit in DESIGN.md about how errors work in the API 2021-05-13 06:17:33 +12:00
Michael Hudson-Doyle f339620a50 include the traceback in the response when a server method fails
example:

$ curl  --unix-socket .subiquity/socket a/dry_run/crash
Traceback (most recent call last):
  File "/home/mwhudson/src/subiquity/subiquity/common/api/server.py", line 122, in handler
    result = await implementation(**args)
  File "/home/mwhudson/src/subiquity/subiquity/server/dryrun.py", line 24, in crash_GET
    1/0
ZeroDivisionError: division by zero
2021-05-13 05:44:47 +12:00
Michael Hudson-Doyle 03d6118e82
Merge pull request #951 from mwhudson/lp-1927103
decide whether to let curtin create a swapfile when rendering config
2021-05-13 05:38:22 +12:00
Michael Hudson-Doyle 0ecccecee6 decide whether to let curtin create a swapfile when rendering config
https://bugs.launchpad.net/subiquity/+bug/1927103 reports a regression
where a subiquity-installed system has a swapfile even if a swap
partition has been explicitly configured.

The reason this broke is that previously subiquity tracked whether a
swap file should be allowed or not by keeping track of whether a swap
partition was mounted in add_mount / remove_mount. But since the
client/server split, those methods aren't called in the server process
any more.

Just get rid of all the cleverness and call _should_add_swapfile when
rendering the curtin config.
2021-05-11 11:02:33 +12:00
Michael Hudson-Doyle 75c71b9d85 offer to run a shell after an autoinstall fails
otherwise, especially on a serial console, there is not really any way
to debug what is going on.

also, when non-interactive defer setting the applicationstate to ERROR
until the information in the error report has been collected and the
error-commands have run.
2021-05-10 14:30:39 +12:00
Michael Hudson-Doyle 541b483fb9
Merge pull request #947 from mwhudson/lp-1926616
mark the locale model as configured at start up
2021-05-09 22:41:58 +12:00
Dimitri John Ledkov dabd3198be
Merge pull request #948 from mwhudson/no-trusted=yes
verify signatures on the cdrom pool again
2021-05-05 09:51:57 +01:00
Michael Hudson-Doyle 32641489bd verify signatures on the cdrom pool again
It's not safe in the netboot case.
2021-05-05 09:51:30 +12:00
Michael Hudson-Doyle 1da1ead19c add a integation test for non-rich mode 2021-05-04 12:44:41 +12:00
Michael Hudson-Doyle 447e192fee mark the locale model as configured at start up
The subiquity client does not ask about language in non-rich mode on a
serial port, and that's OK. But we still need the install to complete :)

There are other ways to fix this I guess -- we could not wait on the
locale model to get configured, for example, or explicitly select a
C.UTF-8 locale when "Continue in basic mode" is selected, or probably
some other things. But this works and seems OK.
2021-05-04 12:22:38 +12:00
Michael Hudson-Doyle f91d84eb26
Merge pull request #946 from mwhudson/trust-cdrom
set trusted=yes,check-date=no for cdrom pool during installation
2021-05-04 10:40:27 +12:00
Michael Hudson-Doyle d617445190
Merge pull request #945 from mwhudson/lp-1926132
fix crash on network apply failure
2021-05-04 10:39:42 +12:00
Michael Hudson-Doyle 3a0c04500f
Merge pull request #944 from mwhudson/fix-logging-unconfigured-models
fix logging unconfigured models
2021-05-04 10:39:26 +12:00
Michael Hudson-Doyle f0a230ceff
Merge pull request #943 from mwhudson/lp-1898583
have console-conf-write-login-details exit with code 2 when no IPs found
2021-05-04 10:38:04 +12:00
Michael Hudson-Doyle 29676d8c22 set trusted=yes,check-date=no for cdrom pool during installation
The pool is loaded off the same media as the installer and the
filesystem being installed so there's no real loss of security doing
this and it makes it easier for people to master custom ISOs with extra
packages in the pool and systems with inaccurate clocks (that cannot
reach ntp.ubuntu.com).
2021-05-03 13:25:30 +12:00
Michael Hudson-Doyle d31a150f06 fix crash on network apply failure
https://bugs.launchpad.net/subiquity/+bug/1926132
2021-05-03 11:40:49 +12:00
Michael Hudson-Doyle 7465e2ccb2 fix logging unconfigured models
debugging Launchpad bug 1926616 would have been much easier if this was
working!
2021-05-03 11:18:09 +12:00
Michael Hudson-Doyle 6a9d100b64 have console-conf-write-login-details exit with code 2 when no IPs found
Also make the log files resulting from console-conf-write-login-details
execution a bit easier to spot.
2021-05-03 11:04:03 +12:00
Dan Bungert 2719c57c1b
locale - let it check interactive-sections again (#937)
* locale - let it check interactive-sections again

* Turn Serial into a whole new screen

When in serial, first offer the rich/basic choice (or SSH button),
and only show the current welcome screen if we choose rich mode.
Add a back button on Welcome if we are on serial.

LP: #1919251
2021-04-21 10:11:27 -06:00
Dan Bungert 046949f087
Drop the confirm_ssh_keys call if UI not as expected (#941)
* Drop the confirm_ssh_keys call if UI not as expected

There is a larger problem here of the UI body changing underneath of us,
but this is at least a baby step in the right direction.
Also this matches existing client/controllers/ssh.py behavior.
At least log the event when it happens.
LP: #1925048

* lint
2021-04-19 17:21:12 -06:00
Michael Hudson-Doyle 4b5fd536aa
Merge pull request #940 from mwhudson/lp-1925068
avoid situation where overlays can be shown twice
2021-04-20 11:17:00 +12:00
Michael Hudson-Doyle 5e02aae312
Merge pull request #939 from mwhudson/lp-1925063
make sure freshly allocated action ids are really unique
2021-04-20 11:16:21 +12:00
Michael Hudson-Doyle 4de7f39c52 avoid situation where overlays can be shown twice
https://bugs.launchpad.net/subiquity/+bug/1925068 reports a crash that
fails with the "self.global_overlays.remove(overlay)" in
remove_global_overlay failing because the overlay is not in the list. I
don't know how it happened but staring at the code I did guess one way
this could happen: if you have two non-interactive screens in a row
where the requests both take long enough to trip the 0.1s threshold to
show the progress screen, app.ui.set_body will get called twice with the
same view. Each call will layer all global overlays over the view, so
doing it twice will show the views twice.

This all makes me thing that the way global overlays are shown is a bit
wrong -- they should be "outside" the controller-supplied view! -- but,
well, it's easy enough to make sure that calling set_body twice with the
same view doesn't cause this particular problem.
2021-04-20 10:18:38 +12:00
Michael Hudson-Doyle eacae45fb5 make sure freshly allocated action ids are really unique
Because the server and any clients can create action objects now,
per-process global counters are not going to cut it.

For https://bugs.launchpad.net/subiquity/+bug/1925063.
2021-04-20 09:32:17 +12:00
Michael Hudson-Doyle 7a6ba1f119
Merge pull request #938 from mwhudson/curtin-update
update curtin
2021-04-16 09:38:55 +12:00
Michael Hudson-Doyle 4965f1000d update curtin 2021-04-16 09:12:00 +12:00
Michael Hudson-Doyle 32ed9d146c
Merge pull request #936 from dbungert/keyerror-updates
fix keyerror: updates
2021-04-13 11:54:36 +12:00
Dan Bungert 4609f8b86b
guided_GET: allow caller to specify min size (#935)
Caller to guided_GET can now specify a minimum size disk that is
acceptable for guided partitioning.  The unit is bytes.
The default value if this is unspecified is 6GiB.

Note that this default value is wholly inadequate for Desktop, which by
my measurements needs at least 8GiB to get the install completed if you
tell it to install everything, even though later it settles to a lower
installed size of 6.6GiB.
2021-04-12 17:38:40 -06:00
Dan Bungert 8e6728e3c9 fix keyerror: updates 2021-04-12 17:22:39 -06:00
Michael Hudson-Doyle 6268ad1e6d
Merge pull request #934 from mwhudson/pubsub
replace use of urwid signals in server and fix some proxy bugs
2021-04-13 10:19:51 +12:00
Michael Hudson-Doyle ce65cac174
Merge pull request #933 from mwhudson/dead-code
remove some dead code
2021-04-13 09:49:49 +12:00
Michael Hudson-Doyle 346785dcb7 wait for proxy configuration to complete when autoinstalling
This should fix the remaining part of
https://bugs.launchpad.net/subiquity/+bug/1879678.
2021-04-13 09:41:43 +12:00
Michael Hudson-Doyle f81d39f8a0 set http{,s}_proxy in server environment when proxy is set
This used be done before the client server split, oops. It probably only
affects geoip lookups though.
2021-04-13 09:41:43 +12:00
Michael Hudson-Doyle bc2ae6199a asyncify pubsub a bit 2021-04-13 09:41:43 +12:00
Michael Hudson-Doyle dab04bcb3a simple replacement for urwid signals wrapper as used in server
I think this removes all use of urwid from the server code.
2021-04-13 09:41:43 +12:00
Michael Hudson-Doyle ddf9baf19c remove emission of signal that nothing listens to any more 2021-04-12 22:53:37 +12:00
Michael Hudson-Doyle 98eb11c3b1 remove source command line line and SubiquityModel argument
nothing has used this value for some considerable time.
2021-04-12 22:52:56 +12:00