-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cloud-init blocking on WSL1 (#508)
`cloud-init status --wait` blocks forever if cloud-init won't ever start. Known cases where that may happen: 1. the cloud-init systemd units being masked or disabled by default in the rootfs (not our case) 1. systemd not enabled by default in the rootfs image (not our case either) 1. the distro instance being registered as a WSL 1 instance (we don't control that :) ) We're not considering that properly. With the patch bb72652, we check if both the cloud-init.service unit is enabled (which covers 1) as well as systemd not offline, which covers 2. and 3. The very same check was implemented in the new script that will replace this launch in the new WSL format via this PR: ubuntu/wsl-setup#17. I also added an end-to-end test case that sets WSL1 as the default setting globally and attempts to register the instance. Without that patch the test would timeout. See 472a2d8. UDENG-5629. --- CI had two issues blocking me: 1. `releases-info`, a Go binary used to select which rootfses to build the application packages from, had outdated considerations about what CPC publishes under https://cloud-images.ubuntu.com/wsl: - Jammy file naming conventions are now the same as Noble's. - The CPC publisher no longer strips the "ubuntu" suffix on both releases. Look at https://cloud-images.ubuntu.com/wsl/jammy/current/: ``` ... [ ] SHA256SUMS.gpg 2024-12-13 15:01 833 [ ] ubuntu-jammy-wsl-amd64-ubuntu.rootfs.tar.gz 2024-12-12 21:42 324M File system image and Kernel packed [ ] ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz 2024-12-12 21:42 324M File system image and Kernel packed [TXT] ubuntu-jammy-wsl-amd64-wsl.manifest 2024-12-12 21:42 17K Package manifest file [ ] ubuntu-jammy-wsl-arm64-ubuntu.rootfs.tar.gz 2024-12-12 21:45 308M File system image and Kernel packed [ ] ubuntu-jammy-wsl-arm64-ubuntu22.04lts.rootfs.tar.gz 2024-12-12 21:45 308M File system image and Kernel packed [TXT] ubuntu-jammy-wsl-arm64-wsl.manifest 2024-12-12 21:45 17K Package manifest file ... ``` The images contain a suffix "ubuntu22.04lts". Also, that naming convention used to be from 24.04 onwards. But as we can clearly see 22.04 and 24.04 are following the same naming convention (see https://cloud-images.ubuntu.com/wsl/noble/current/): ``` [ ] SHA256SUMS.gpg 2024-12-13 05:37 833 [ ] ubuntu-noble-wsl-amd64-ubuntu.rootfs.tar.gz 2024-12-12 20:21 347M File system image and Kernel packed [ ] ubuntu-noble-wsl-amd64-ubuntu24.04lts.rootfs.tar.gz 2024-12-12 20:21 347M File system image and Kernel packed [TXT] ubuntu-noble-wsl-amd64-wsl.manifest 2024-12-12 20:20 16K Package manifest file [ ] ubuntu-noble-wsl-arm64-ubuntu.rootfs.tar.gz 2024-12-12 20:23 332M File system image and Kernel packed [ ] ubuntu-noble-wsl-arm64-ubuntu24.04lts.rootfs.tar.gz 2024-12-12 20:23 332M File system image and Kernel packed [TXT] ubuntu-noble-wsl-arm64-wsl.manifest 2024-12-12 20:23 16K Package manifest file ``` 2. Every now and then the PowerShell script that downloads the rootfs and validate the checksums failed with a shallow stack trace of an attempt to index into a null array. That was not really helpful. After investing some time on this I could finally learn that we implemented the wrong regex pattern (two spaces instead of a space and a raw star/asterisk character).
- Loading branch information
Showing
10 changed files
with
73 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
go 1.22.0 | ||
go 1.23.0 | ||
|
||
toolchain go1.22.5 | ||
toolchain go1.23.2 | ||
|
||
use ./launchertester |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
e2e/launchertester/testdata/TestSetupWithCloudInit/do_not_block_on_wsl1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#cloud-config | ||
users: | ||
- name: nontestuser | ||
groups: sudo | ||
shell: /bin/bash | ||
sudo: ALL=(ALL) NOPASSWD:ALL | ||
- name: testuser | ||
groups: sudo | ||
shell: /bin/bash | ||
sudo: ALL=(ALL) NOPASSWD:ALL | ||
|
||
write_files: | ||
- path: /etc/wsl.conf | ||
append: true | ||
content: | | ||
[user] | ||
default=testuser | ||
|
||
runcmd: | ||
- touch /home/testuser/with_default_user.done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters