Skip to content

I want to try local #816

Open
Open
@itamiokanjiro

Description

@itamiokanjiro

https://github.com/itamiokanjiro/infra-local

Although the version I pulled is out of date, I have some questions.

What are the commonly used parameters for ReadyCmd and StartCmd?

curl -X POST http://192.168.1.110:3009/templates \
-H "Content-Type: application/json" \
-H "X-Supabase-Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTAyNDc3OTMsImlhdCI6MTc1MDI0NDE5Mywic3ViIjoiYzkxYjBiMjctMDE3Yi00MzA4LTg0YzAtMDczYTkzZTE1NTJiIn0.17AnFPrgj3LPQ2dM0l-lTjNfpL227zMZAoEbiSGI4ts" \
-H "X-Supabase-Team: 7b878a9d-3dde-48a1-8913-31888d69dd78" \
-H "Authorization: Bearer sk_e2b_e12df59cc6206a3923a49a477a5db34b9685a98a" \
-d '{
    "dockerfile": "Dockerfile",
    "ReadyCmd":"ReadyCmd",
    "StartCmd":"/bin/true",
    "envd_version":"0.1.1"
}'

The problem I encountered was that the exf4 generated by the project through local docker could not be started

  -> created rootfs ext4 file
  {"level":"info","timestamp":"2025-06-22T07:02:00.990421686+08:00","message":"[2025-06-22T07:02:00+08:00] Filesystem cleanup\n","service":"template-manager","internal":false,"pid":1410560,"logger":"template-manager","envID":"di502spv70vn40ke7ysc","buildID":"7df37656-7ddc-47f2-8979-21c40b285a4e"}
  ->> [stdout] tune2fs 1.46.5 (30-Dec-2021)
  -> statted rootfs file (size: 107515904)
  -> truncated rootfs file to size of build + defaultDiskSizeMB - []attribute.KeyValue{attribute.KeyValue{Key:"size", Value:attribute.Value{vtype:2, numeric:0x26689000, stringly:"", slice:interface {}(nil)}}}
  ->> [stderr] resize2fs 1.46.5 (30-Dec-2021)
  ->> [stdout] Resizing the filesystem on /tmp/build-templates/7df37656-7ddc-47f2-8979-21c40b285a4e/rootfs.ext4.build to 157321 (4k) blocks.
  The filesystem on /tmp/build-templates/7df37656-7ddc-47f2-8979-21c40b285a4e/rootfs.ext4.build is now 157321 (4k) blocks long.
  {"level":"info","timestamp":"2025-06-22T07:02:01.105676433+08:00","message":"[2025-06-22T07:02:01+08:00] Provisioning sandbox template\n","service":"template-manager","internal":false,"pid":1410560,"logger":"template-manager","envID":"di502spv70vn40ke7ysc","buildID":"7df37656-7ddc-47f2-8979-21c40b285a4e"}
  -> new network slot
  Attrs set: []attribute.KeyValue{attribute.KeyValue{Key:"sandbox.cmd", Value:attribute.Value{vtype:4, numeric:0x0, stringly:"mount --make-rprivate / &&\nmount -t tmpfs tmpfs /mnt/disks/fc-envs/v1/di502spv70vn40ke7ysc/builds/7df37656-7ddc-47f2-8979-21c40b285a4e -o X-mount.mkdir &&\nmount -t tmpfs tmpfs /fc-vm/vmlinux-6.1.102 -o X-mount.mkdir &&\nln -s /orchestrator/sandbox/rootfs-bm0t5g6f2k3a1paqsfzam-y82h8ypvf1ll6irg7big.link /mnt/disks/fc-envs/v1/di502spv70vn40ke7ysc/builds/7df37656-7ddc-47f2-8979-21c40b285a4e/rootfs.ext4 &&\nln -s /fc-kernels/vmlinux-6.1.102/vmlinux.bin /fc-vm/vmlinux-6.1.102/vmlinux.bin &&\nip netns exec ns-66 /fc-versions/v1.10.1_1fcdaec/firecracker --api-sock /tmp/fc-bm0t5g6f2k3a1paqsfzam-y82h8ypvf1ll6irg7big.sock", slice:interface {}(nil)}}}
  -> created fc client
  {"level":"info","timestamp":"2025-06-22T07:02:01.638739067+08:00","message":"2025-06-22T07:02:01.638197483 [anonymous-instance:main] Running Firecracker v1.10.1","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  {"level":"info","timestamp":"2025-06-22T07:02:01.663169334+08:00","message":"2025-06-22T07:02:01.662943092 [anonymous-instance:fc_api] The API server received a Put request on \"/boot-source\" with body \"{\\\"boot_args\\\":\\\"console=ttyS0 i8042.noaux i8042.nokbd init=usr/bin/init ip=169.254.0.21::169.254.0.22:255.255.255.252:instance:eth0:off:tap0 ipv6.autoconf=1 ipv6.disable=0 loglevel=5 panic=1 pci=off random.trust_cpu=on reboot=k\\\",\\\"kernel_image_path\\\":\\\"/fc-vm/vmlinux-6.1.102/vmlinux.bin\\\"}\\n\".","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  {"level":"info","timestamp":"2025-06-22T07:02:01.710198215+08:00","message":"2025-06-22T07:02:01.710048146 [anonymous-instance:fc_api] The request was executed successfully. Status code: 204 No Content.","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  -> set fc boot source config
  {"level":"info","timestamp":"2025-06-22T07:02:01.711165921+08:00","message":"2025-06-22T07:02:01.711038463 [anonymous-instance:fc_api] The API server received a Put request on \"/drives/rootfs\" with body \"{\\\"drive_id\\\":\\\"rootfs\\\",\\\"io_engine\\\":\\\"Async\\\",\\\"is_root_device\\\":true,\\\"path_on_host\\\":\\\"/mnt/disks/fc-envs/v1/di502spv70vn40ke7ysc/builds/7df37656-7ddc-47f2-8979-21c40b285a4e/rootfs.ext4\\\"}\\n\".","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  {"level":"info","timestamp":"2025-06-22T07:02:01.711335313+08:00","message":"2025-06-22T07:02:01.711301671 [anonymous-instance:main] [DevPreview] Async file IO is in development preview.","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  {"level":"info","timestamp":"2025-06-22T07:02:01.801725418+08:00","message":"2025-06-22T07:02:01.801248932 [anonymous-instance:fc_api] The request was executed successfully. Status code: 204 No Content.","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  -> set fc drivers config
  {"level":"info","timestamp":"2025-06-22T07:02:01.802757497+08:00","message":"2025-06-22T07:02:01.802663582 [anonymous-instance:fc_api] The API server received a Put request on \"/network-interfaces/eth0\" with body \"{\\\"guest_mac\\\":\\\"02:FC:00:00:00:05\\\",\\\"host_dev_name\\\":\\\"tap0\\\",\\\"iface_id\\\":\\\"eth0\\\"}\\n\".","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  {"level":"info","timestamp":"2025-06-22T07:02:01.803513093+08:00","message":"2025-06-22T07:02:01.803462393 [anonymous-instance:fc_api] The request was executed successfully. Status code: 204 No Content.","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  {"level":"info","timestamp":"2025-06-22T07:02:01.80447096+08:00","message":"2025-06-22T07:02:01.804427186 [anonymous-instance:fc_api] The API server received a Put request on \"/mmds/config\" with body \"{\\\"network_interfaces\\\":[\\\"eth0\\\"],\\\"version\\\":\\\"V2\\\"}\\n\".","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  {"level":"info","timestamp":"2025-06-22T07:02:01.804557911+08:00","message":"2025-06-22T07:02:01.804545146 [anonymous-instance:fc_api] The request was executed successfully. Status code: 204 No Content.","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  -> set fc network config
  {"level":"info","timestamp":"2025-06-22T07:02:01.805396446+08:00","message":"2025-06-22T07:02:01.805356461 [anonymous-instance:fc_api] The API server received a Put request on \"/machine-config\" with body \"{\\\"huge_pages\\\":\\\"2M\\\",\\\"mem_size_mib\\\":1024,\\\"smt\\\":true,\\\"track_dirty_pages\\\":false,\\\"vcpu_count\\\":2}\\n\".","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  {"level":"info","timestamp":"2025-06-22T07:02:01.807285441+08:00","message":"2025-06-22T07:02:01.807218303 [anonymous-instance:main] [DevPreview] Huge pages support is in development preview.","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  {"level":"info","timestamp":"2025-06-22T07:02:01.807328155+08:00","message":"2025-06-22T07:02:01.807265446 [anonymous-instance:fc_api] The request was executed successfully. Status code: 204 No Content.","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  -> set fc machine config

  {"level":"info","timestamp":"2025-06-22T07:02:01.807747863+08:00","message":"2025-06-22T07:02:01.807731492 [anonymous-instance:fc_api] The API server received a Put request on \"/actions\" with body \"{\\\"action_type\\\":\\\"InstanceStart\\\"}\\n\".","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
  {"level":"info","timestamp":"2025-06-22T07:02:01.87343754+08:00","message":"2025-06-22T07:02:01.873253135 [anonymous-instance:fc_api] Received Error. Status code: 400 Bad Request. Message: Start microvm error: Cannot load kernel due to invalid memory configuration or invalid kernel image: Kernel Loader: failed to load ELF kernel image: Kernel Loader: Unable to read kernel image","service":"template-manager","internal":true,"pid":1410560,"logger":"template-manager","sandbox.id":"bm0t5g6f2k3a1paqsfzam","template.id":"di502spv70vn40ke7ysc","team.id":"","instanceID":"bm0t5g6f2k3a1paqsfzam","envID":"di502spv70vn40ke7ysc"}
{"level":"info","timestamp":"2025-06-22T07:02:01.876262562+08:00","message":"[2025-06-22T07:02:01+08:00] ...\n","service":"template-manager","internal":false,"pid":1410560,"logger":"template-manager","envID":"di502spv70vn40ke7ysc","buildID":"7df37656-7ddc-47f2-8979-21c40b285a4e"}
{"level":"info","timestamp":"2025-06-22T07:02:01.876341943+08:00","message":"[2025-06-22T07:02:01+08:00] Postprocessing failed: error provisioning sandbox: error creating sandbox: failed to create FC: error starting fc: error starting fc: [PUT /actions][400] createSyncActionBadRequest  &{FaultMessage:Start microvm error: Cannot load kernel due to invalid memory configuration or invalid kernel image: Kernel Loader: failed to load ELF kernel image: Kernel Loader: Unable to read kernel image}\n","service":"template-manager","internal":false,"pid":1410560,"logger":"template-manager","envID":"di502spv70vn40ke7ysc","buildID":"7df37656-7ddc-47f2-8979-21c40b285a4e"}
{"level":"error","timestamp":"2025-06-22T07:02:09.876693519+08:00","message":"error while building template","service":"template-manager","internal":true,"pid":1410560,"debug_id":null,"error":"error provisioning sandbox: error creating sandbox: failed to create FC: error starting fc: error starting fc: [PUT /actions][400] createSyncActionBadRequest  &{FaultMessage:Start microvm error: Cannot load kernel due to invalid memory configuration or invalid kernel image: Kernel Loader: failed to load ELF kernel image: Kernel Loader: Unable to read kernel image}","stacktrace":"github.com/e2b-dev/infra/packages/shared/pkg/telemetry.ReportCriticalError\n\t/kok/todo-api/main4/packages/shared/pkg/telemetry/tracing.go:80\ngithub.com/e2b-dev/infra/packages/orchestrator/internal/template/server.(*ServerStore).reportBuildFailed\n\t/kok/todo-api/main4/packages/orchestrator/internal/template/server/create_template.go:107\ngithub.com/e2b-dev/infra/packages/orchestrator/internal/template/server.(*ServerStore).TemplateCreate.func1\n\t/kok/todo-api/main4/packages/orchestrator/internal/template/server/create_template.go:89"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions