Skip to content
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

templates: replace alpine with alpine-image #2704

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ jobs:
- experimental/net-user-v2.yaml
- experimental/9p.yaml
- docker.yaml
- ../hack/test-templates/alpine-9p-writable.yaml
- ../hack/test-templates/alpine-iso-9p-writable.yaml # Covers alpine-iso.yaml
- ../hack/test-templates/test-misc.yaml
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Distro:
- [`almalinux-8`](./almalinux-8.yaml): AlmaLinux 8
- [`almalinux-9`](./almalinux-9.yaml), `almalinux.yaml`: AlmaLinux 9
- [`alpine`](./alpine.yaml): ☆Alpine Linux
- [`alpine-iso`](./alpine-iso.yaml): ☆Alpine Linux (ISO9660 image). Compatible with the `alpine` template used in Lima prior to v1.0.
- [`archlinux`](./archlinux.yaml): ⭐Arch Linux
- [`centos-stream-9`](./centos-stream-9.yaml), `centos-stream.yaml`: CentOS Stream 9
- [`debian-11`](./debian-11.yaml): Debian GNU/Linux 11(bullseye)
Expand Down
17 changes: 0 additions & 17 deletions examples/alpine-image.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions examples/alpine-iso.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This template requires Lima v0.7.0 or later.
# Using the Alpine 3.20 aarch64 image with vmType=vz requires macOS Ventura 13.3 or later.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably delete this comment now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I was confused; I thought we required 13.3 for VZ on aarch64 for all images, but it looks like it is Alpine specific, so the comment should stay.


images:
- location: "https://github.com/lima-vm/alpine-lima/releases/download/v0.2.39/alpine-lima-std-3.20.0-x86_64.iso"
arch: "x86_64"
digest: "sha512:df013ba0666460c9e303e996e46e061e613ce546124a9de60060041874c702444ac7a90e67f1aed4756b85cc89d40c5ea4375dea62c98b9536ceb44f18874b67"
- location: "https://github.com/lima-vm/alpine-lima/releases/download/v0.2.39/alpine-lima-std-3.20.0-aarch64.iso"
arch: "aarch64"
digest: "sha512:7ff023e354bbf78eaf44f32a5417bec3ca2af853691e4c64ee4aa819674acd22720897ce9f23e3e959679a72e8300a31f5c6aa12be1c3d8ae7eff3c25b8b5e36"

mounts:
- location: "~"
- location: "/tmp/lima"
writable: true

# The built-in containerd installer does not support Alpine currently.
# Hint: use the "rd" ISO instead of the "std" ISO to enable containerd: https://github.com/lima-vm/alpine-lima/releases/
containerd:
system: false
user: false
12 changes: 4 additions & 8 deletions examples/alpine.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# This template requires Lima v0.7.0 or later.
# Using the Alpine 3.20 aarch64 image with vmType=vz requires macOS Ventura 13.3 or later.

images:
- location: "https://github.com/lima-vm/alpine-lima/releases/download/v0.2.39/alpine-lima-std-3.20.0-x86_64.iso"
- location: "https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/cloud/nocloud_alpine-3.20.2-x86_64-uefi-cloudinit-r0.qcow2"
arch: "x86_64"
digest: "sha512:df013ba0666460c9e303e996e46e061e613ce546124a9de60060041874c702444ac7a90e67f1aed4756b85cc89d40c5ea4375dea62c98b9536ceb44f18874b67"
- location: "https://github.com/lima-vm/alpine-lima/releases/download/v0.2.39/alpine-lima-std-3.20.0-aarch64.iso"
digest: "sha512:5828254c27c948824c4c6d4fb88c4d96ee9b5b58ae455036b1571bb037a5b5de124e1d55f00386b9e711cef7771146278bd5eb1036a2f8db6fa34611393ebec1"
- location: "https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/cloud/nocloud_alpine-3.20.2-aarch64-uefi-cloudinit-r0.qcow2"
arch: "aarch64"
digest: "sha512:7ff023e354bbf78eaf44f32a5417bec3ca2af853691e4c64ee4aa819674acd22720897ce9f23e3e959679a72e8300a31f5c6aa12be1c3d8ae7eff3c25b8b5e36"
digest: "sha512:76eeef3cb1b38b3a0c2e745d8108558645220355cd870cba3a88198bcd0036485a0a683d8469f8405251918e972d24c461d418a30112e92efe44b460e4cba7ba"

mounts:
- location: "~"
- location: "/tmp/lima"
writable: true

# The built-in containerd installer does not support Alpine currently.
# Hint: use the "rd" ISO instead of the "std" ISO to enable containerd: https://github.com/lima-vm/alpine-lima/releases/
containerd:
system: false
user: false
2 changes: 1 addition & 1 deletion hack/calculate-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export LIMA_HOME
# ubuntu-24.04 templates/experimental/net-user-v2.yaml
# ubuntu-24.04 templates/experimental/9p.yaml
# ubuntu-24.04 templates/docker.yaml
# ubuntu-24.04 templates/../hack/test-templates/alpine-9p-writable.yaml
# ubuntu-24.04 templates/../hack/test-templates/alpine-iso-9p-writable.yaml
# ubuntu-24.04 templates/../hack/test-templates/test-misc.yaml
# macos-12 templates/vmnet.yaml
# macos-12 https://raw.githubusercontent.com/lima-vm/lima/v0.15.1/examples/ubuntu-lts.yaml
Expand Down
6 changes: 3 additions & 3 deletions hack/test-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ case "$NAME" in
WARNING "Alpine does not support systemd"
CHECKS["systemd"]=
CHECKS["container-engine"]=
[ "$NAME" = "alpine-9p-writable" ] && CHECKS["mount-path-with-spaces"]="1"
[ "$NAME" = "alpine-iso-9p-writable" ] && CHECKS["mount-path-with-spaces"]="1"
;;
"k3s")
ERROR "File \"$FILE\" is not testable with this script"
Expand Down Expand Up @@ -269,7 +269,7 @@ if [[ -n ${CHECKS["port-forwards"]} ]]; then
fi
"${scriptdir}/test-port-forwarding.pl" "${NAME}"

if [[ -n ${CHECKS["container-engine"]} || ${NAME} == "alpine" ]]; then
if [[ -n ${CHECKS["container-engine"]} || ${NAME} == "alpine"* ]]; then
INFO "Testing that \"${CONTAINER_ENGINE} run\" binds to 0.0.0.0 by default and is forwarded to the host"
if [ "$(uname)" = "Darwin" ]; then
# macOS runners seem to use `localhost` as the hostname, so the perl lookup just returns `127.0.0.1`
Expand All @@ -279,7 +279,7 @@ if [[ -n ${CHECKS["port-forwards"]} ]]; then
fi
if [ -n "${hostip}" ]; then
sudo=""
if [ "${NAME}" = "alpine" ]; then
if [[ ${NAME} == "alpine"* ]]; then
arch=$(limactl info | jq -r .defaultTemplate.arch)
nerdctl=$(limactl info | jq -r ".defaultTemplate.containerd.archives[] | select(.arch==\"$arch\").location")
curl -Lso nerdctl-full.tgz "${nerdctl}"
Expand Down
2 changes: 2 additions & 0 deletions pkg/cidata/cidata.TEMPLATE.d/boot/10-alpine-prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ usermod -p '*' "${LIMA_CIDATA_USER}"

# Alpine disables TCP forwarding, which is needed by the lima-guestagent
sed -i 's/AllowTcpForwarding no/AllowTcpForwarding yes/g' /etc/ssh/sshd_config
# Enable PAM so as to load /etc/environment via pam_env
sed -i 's/#UsePAM no/UsePAM yes/g' /etc/ssh/sshd_config
rc-service --ifstarted sshd reload

# mount /sys/fs/cgroup
Expand Down
Loading