避免 microVM 镜像复制占满 LXC page cache
test / python (pull_request) Successful in 9s
test / shell (pull_request) Failing after 18s

This commit is contained in:
2026-09-16 17:15:08 +00:00
parent 8578bee895
commit b25b1fbf62
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ runs-on: [self-hosted, vm]
- `controller`:接收 Gitea `workflow_job` webhook,将指定 label 的 queued job
发布到 NATS JetStream。
- `worker`:领取任务、限制并发,并通过 Pod 或 microVM backend 创建一次性环境。
- `microvm-runner-launch`:为每个任务复制 flat qcow2 root disk(支持时使用 reflink)、创建 NoCloud seed 和 TAP,运行
- `microvm-runner-launch`:为每个任务以 direct I/O 转换出 flat qcow2 root disk、创建 NoCloud seed 和 TAP,运行
Cloud Hypervisor,退出后完整清理。
- `guest-runner`:在 guest 中领取一次性 runner registration token,注册 ephemeral
runner,执行一个 job 后关机。
+3 -2
View File
@@ -45,8 +45,9 @@ test -r "$base_image"
test -r "$firmware"
install -d -m 0700 "$state_root/instances" "$vm_dir"
# Cloud Hypervisor cannot open qcow2 backing chains. Keep each disposable
# root disk flat; reflink-capable storage still makes this copy cheap.
cp --reflink=auto --sparse=always "$base_image" "$overlay"
# root disk flat and bypass the LXC page cache: caching both a 5 GiB copy and
# guest RAM can otherwise trigger the container memory limit.
qemu-img convert -q -T none -t none -f qcow2 -O qcow2 "$base_image" "$overlay"
cat >"$vm_dir/meta-data" <<EOF
instance-id: $instance_id