lima.yaml 67 lignes · 2136 octets
# Lima VM for the Mac Studio (Apple Silicon): Ubuntu 24.04 arm64, native
# virtualization (vz) with Rosetta so x86_64 binaries and containers also run.
#
#   brew install lima
#   limactl create --name=chipai flows/vm/lima.yaml
#   limactl start chipai
#   limactl shell chipai            # or: ssh -F ~/.lima/chipai/ssh.config lima-chipai
#
# Then add to ~/.ssh/config on the laptop (host "mac-vm") a ProxyJump through
# the Mac, see docs/01-mise-en-place.md.
vmType: "vz"
os: "Linux"
arch: "aarch64"
images:
  - location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img"
    arch: "aarch64"

cpus: 24
memory: "400GiB"
disk: "600GiB"

rosetta:
  enabled: true
  binfmt: true

mounts:
  - location: "~/chipai"          # repo clone and models on the Mac side
    writable: true
  - location: "/tmp/lima"
    writable: true

ssh:
  localPort: 60022
  forwardAgent: true

containerd:
  system: false
  user: false

provision:
  - mode: system
    script: |
      #!/bin/bash
      set -eux
      apt-get update
      apt-get install -y build-essential curl git unzip pkg-config libssl-dev \
        cmake clang lld python3 rsync
      # Docker CE (needed for iic-osic-tools and ORFS images)
      install -m 0755 -d /etc/apt/keyrings
      curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
      echo "deb [arch=arm64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu noble stable" \
        > /etc/apt/sources.list.d/docker.list
      apt-get update && apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin
      usermod -aG docker "${LIMA_CIDATA_USER:-ubuntu}" || true
  - mode: user
    script: |
      #!/bin/bash
      set -eux
      curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
      curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt-get install -y nodejs

probes:
  - script: |
      #!/bin/bash
      set -eux
      command -v docker && command -v rustc
    hint: "provisioning still running (docker or rust missing)"