From 1c2b7f024d35e9707d66f1d3f0c31b71ee56ebe1 Mon Sep 17 00:00:00 2001 From: Nianyu Shen Date: Thu, 17 Oct 2024 12:45:18 -0700 Subject: [PATCH] docs: add instructions for installing using lima (#31) * docs: add instructions for installing using lima --------- Signed-off-by: Nianyu Shen --- README.md | 7 ++----- examples/lima/README.md | 24 ++++++++++++++++++++++ examples/lima/lima.yaml | 40 ++++++++++++++++++++++++++++++++++++ examples/maas/README.md | 5 +++++ examples/{ => maas}/maas.yml | 0 5 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 examples/lima/README.md create mode 100644 examples/lima/lima.yaml create mode 100644 examples/maas/README.md rename examples/{ => maas}/maas.yml (100%) diff --git a/README.md b/README.md index 1f1a0c1..dee94ee 100644 --- a/README.md +++ b/README.md @@ -48,11 +48,8 @@ Refer to [Palette Agent Parameters Documentation](https://docs.spectrocloud.com/ Here are some examples of how to use the install script on different platforms. -### MAAS - -Use [maas.yml](examples/maas.yml) as cloudinit to provision your machine. - -> **Note:** You might need to modify the cloudinit with your own userdata. +- [MAAS](examples/maas/README.md) +- [Lima](examples/lima/README.md) ## Development diff --git a/examples/lima/README.md b/examples/lima/README.md new file mode 100644 index 0000000..4ac3941 --- /dev/null +++ b/examples/lima/README.md @@ -0,0 +1,24 @@ +# Deploying agent-mode on a Lima VM + +1. Ensure you have `lima` installed. If not, follow the instructions [here](https://lima-vm.io/docs/installation/) +2. Install `socket_vmnet`. Follow the instructions [here](https://lima-vm.io/docs/config/network/#socket_vmnet) +3. Download [lima.yaml](lima.yaml) and modify this line to your userdata path. It can be an URL or a file path. + +```bash +export USERDATA= +``` + +> **Note:** Check more about lima configuration [here](https://lima-vm.io/docs/config/) + +4. Create and start the VM + +```bash +limactl create --name spectro-agent-mode lima.yaml +limactl start spectro-agent-mode +``` + +5. That's it! You can now shell into the VM + +```bash +limactl shell spectro-agent-mode +``` diff --git a/examples/lima/lima.yaml b/examples/lima/lima.yaml new file mode 100644 index 0000000..26cfdc9 --- /dev/null +++ b/examples/lima/lima.yaml @@ -0,0 +1,40 @@ +# This template requires Lima v0.7.0 or later. +images: + # Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. + - location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240821/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:0e25ca6ee9f08ec5d4f9910054b66ae7163c6152e81a3e67689d89bd6e4dfa69" + - location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240821/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:5ecac6447be66a164626744a87a27fd4e6c6606dc683e0a233870af63df4276a" + # Fallback to the latest release image. + # Hint: run `limactl prune` to invalidate the cache + - location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + - location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +vmType: "vz" +memory: 8GiB +hostResolver: + enabled: false +dns: + - 1.1.1.1 + - 1.0.0.1 +networks: + - lima: bridged + interface: en0 + +mounts: + - location: "/tmp/lima" + writable: true + +provision: + - mode: system + script: | + #!/bin/sh + DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y conntrack jq zstd rsync curl systemd + export USERDATA= + curl -Ls https://github.com/spectrocloud/agent-mode/releases/latest/download/palette-agent-install.sh | bash diff --git a/examples/maas/README.md b/examples/maas/README.md new file mode 100644 index 0000000..cd67c08 --- /dev/null +++ b/examples/maas/README.md @@ -0,0 +1,5 @@ +# Deploying agent-mode on MAAS + +Use [maas.yml](maas.yml) as cloudinit to provision your machine. + +> **Note:** You might need to modify the cloudinit with your own userdata. diff --git a/examples/maas.yml b/examples/maas/maas.yml similarity index 100% rename from examples/maas.yml rename to examples/maas/maas.yml