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

Change cpuType default to null #2333

Merged
merged 1 commit into from
May 18, 2024
Merged
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
13 changes: 5 additions & 8 deletions examples/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,12 @@ containerd:
# Specify desired QEMU CPU type for each arch.
# You can see what options are available for host emulation with: `qemu-system-$(arch) -cpu help`.
# Setting of instructions is supported like this: "qemu64,+ssse3".
# 🟢 Builtin default: hard-coded arch map with type (see the output of `limactl info | jq .defaultTemplate.cpuType`)
cpuType:
# 🟢 Builtin default: "cortex-a72" (or "host" when running on aarch64 host)
aarch64: null
# 🟢 Builtin default: "cortex-a7" (or "host" when running on armv7l host)
armv7l: null
# 🟢 Builtin default: "qemu64" (or "host,-pdpe1gb" when running on x86_64 host)
x86_64: null
# 🟢 Builtin default: "rv64" (or "host" when running on riscv64 host)
riscv64: null
Copy link
Member

Choose a reason for hiding this comment

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

Why remove these lines?

Copy link
Contributor Author

@afbjorklund afbjorklund May 10, 2024

Choose a reason for hiding this comment

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

There is a problem with the json, when it is trying to marshal "null" into a string value...

After changing CPUType to map[Arch]*string, it is a problem to express as jsonschema.

Also, it means that we don't have to carry the list of architectures in the "empty" yaml?

Made some similar changes to ssh.localPort and Rosetta omitempty, but will post separately

Copy link
Contributor Author

Choose a reason for hiding this comment

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

 images: []
-cpuType:
-  aarch64: ""
-  armv7l: ""
-  riscv64: ""
-  x86_64: ""
-ssh:
-  localPort: 0
{
   "audio" : {},
   "caCerts" : {},
   "containerd" : {},
   "cpuType" : {
      "aarch64" : "",
      "armv7l" : "",
      "riscv64" : "",
      "x86_64" : ""
   },
   "firmware" : {},
   "hostResolver" : {},
   "images" : null,
   "rosetta" : {
      "binfmt" : null,
      "enabled" : null
   },
   "ssh" : {
      "localPort" : 0
   },
   "video" : {
      "vnc" : {}
   }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also the (text of the) lines are not removed, they are just translated into comments instead.

When uncommented, the default is reconstructed (could use "" or null for empty values)

 cpuType:
  aarch64: "cortex-a72" # (or "host" when running on aarch64 host)
  armv7l: "cortex-a7" # (or "host" when running on armv7l host)
  riscv64: "rv64" # (or "host" when running on riscv64 host)
  x86_64: "qemu64" # (or "host,-pdpe1gb" when running on x86_64 host)

# aarch64: "cortex-a72" # (or "host" when running on aarch64 host)
# armv7l: "cortex-a7" # (or "host" when running on armv7l host)
# riscv64: "rv64" # (or "host" when running on riscv64 host)
# x86_64: "qemu64" # (or "host,-pdpe1gb" when running on x86_64 host)

rosetta:
# Enable Rosetta for Linux (EXPERIMENTAL).
Expand Down
Loading