Repository navigation
Conversation
…ntainers For more info, please refer to clearcontainers#164 Signed-off-by: Zhi Yong Wu <zhiyong.wu@ucloud.cn>
| threads := h.unconstrained_threads() | ||
| memory := h.unconstrained_memory() | ||
| slots := h.unconstrained_slots() | ||
| max_memory := h.unconstrained_max_memory() |
There was a problem hiding this comment.
don't use underscores in Go names; var max_memory should be maxMemory
| return h.Unconstrained_slots | ||
| } | ||
|
|
||
| func (h hypervisor) unconstrained_max_memory() uint32 { |
There was a problem hiding this comment.
don't use underscores in Go names; func unconstrained_max_memory should be unconstrainedMaxMemory
| return h.Unconstrained_memory | ||
| } | ||
|
|
||
| func (h hypervisor) unconstrained_slots() uint8 { |
There was a problem hiding this comment.
don't use underscores in Go names; func unconstrained_slots should be unconstrainedSlots
| return h.Unconstrained_threads | ||
| } | ||
|
|
||
| func (h hypervisor) unconstrained_memory() uint32 { |
There was a problem hiding this comment.
don't use underscores in Go names; func unconstrained_memory should be unconstrainedMemory
| return h.Unconstrained_cores | ||
| } | ||
|
|
||
| func (h hypervisor) unconstrained_threads() uint32 { |
There was a problem hiding this comment.
don't use underscores in Go names; func unconstrained_threads should be unconstrainedThreads
| Image string | ||
|
|
||
| Unconstrained_sockets uint32 | ||
| Unconstrained_cores uint32 |
There was a problem hiding this comment.
don't use underscores in Go names; struct field Unconstrained_cores should be UnconstrainedCores
| Kernel string | ||
| Image string | ||
|
|
||
| Unconstrained_sockets uint32 |
There was a problem hiding this comment.
don't use underscores in Go names; struct field Unconstrained_sockets should be UnconstrainedSockets
| defaultUnconstrained_threads = 1 | ||
| defaultUnconstrained_memory = 256 | ||
| defaultUnconstrained_slots = 2 | ||
| defaultUnconstrained_max_memory = 512 |
There was a problem hiding this comment.
don't use underscores in Go names; const defaultUnconstrained_max_memory should be defaultUnconstrainedMaxMemory
| defaultUnconstrained_cores = 2 | ||
| defaultUnconstrained_threads = 1 | ||
| defaultUnconstrained_memory = 256 | ||
| defaultUnconstrained_slots = 2 |
There was a problem hiding this comment.
don't use underscores in Go names; const defaultUnconstrained_slots should be defaultUnconstrainedSlots
| defaultUnconstrained_sockets = 1 | ||
| defaultUnconstrained_cores = 2 | ||
| defaultUnconstrained_threads = 1 | ||
| defaultUnconstrained_memory = 256 |
There was a problem hiding this comment.
don't use underscores in Go names; const defaultUnconstrained_memory should be defaultUnconstrainedMemory
|
Hi @wuzhy - thanks for submitting this - it is much appreciated and looks promising! There are few (mostly minor) things to do though:
The last issue is the changes to virtcontainers. Since we vendor that package, we cannot change the contents of the I'm going to add some comments to the virtcontainers files you've changed though to help get those changes upstreamed. |
| } | ||
|
|
||
| if conf.Unconstrained_sockets == 0 { | ||
| return false, fmt.Errorf("Missing cpu sockets") |
There was a problem hiding this comment.
I think it might be preferable to not require the specification of sockets, cores and threads and have virtcontainers default to sensible values itself.
| // VCPUs is the number of available virtual CPUs. | ||
| VCPUs uint | ||
|
|
||
| Unconstrained_sockets uint32 |
There was a problem hiding this comment.
These variables should be documented.
| // Memory is the amount of available memory in MiB. | ||
| Memory uint | ||
|
|
||
| Unconstrained_memory uint32 |
There was a problem hiding this comment.
These should also be documented (including specifying the units they refer to).
| // ImagePath is the guest image host path. | ||
| ImagePath string | ||
|
|
||
| Unconstrained_sockets uint32 |
There was a problem hiding this comment.
These variables should be documented (also it would be worth explaining what "unconstrained" means briefly).
| func (q *qemu) setMemoryResources(podConfig PodConfig) ciaoQemu.Memory { | ||
| mem := defaultMemSize | ||
| memMax := defaultMemMax | ||
| mem := fmt.Sprintf("%dM", q.config.Unconstrained_memory) |
There was a problem hiding this comment.
It looks like we've changed from GB to MB here?
|
Hi @wuzhy - are you still planning to update this PR? If we can help, please let us know. |
|
Hi @jodh-intel . I'm working on it. If you don't mind I'll create a separate pull request |
|
Hi @grahamwhaley. Yes, #297 supersedes this PR. Sure, please do. Thank you! |
|
I wonder, if a user/ops really should have access to these low level settings: |
|
Hi @wuzhy - I'm going to assume that the features currently provided by the runtime are sufficient so that we can close this PR. If I'm wrong, please let us know so we can re-open this. |
…ntainers
For more info, please refer to
#164
Signed-off-by: Zhi Yong Wu zhiyong.wu@ucloud.cn