mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-17 14:58:16 +00:00
Merge pull request #11474 from Apokleos/remote-annotation
runtime-rs: Add GPU annotations for remote hypervisor
This commit is contained in:
@@ -41,7 +41,7 @@ remote_hypervisor_timeout = 600
|
||||
# Each member of the list is a regular expression, which is the base name
|
||||
# of the annotation, e.g. "path" for io.katacontainers.config.hypervisor.path"
|
||||
# Note: Remote hypervisor is only handling the following annotations
|
||||
enable_annotations = ["machine_type", "default_memory", "default_vcpus"]
|
||||
enable_annotations = ["machine_type", "default_memory", "default_vcpus", "default_gpus", "default_gpu_model"]
|
||||
|
||||
# Optional space-separated list of options to pass to the guest kernel.
|
||||
# For example, use `kernel_params = "vsyscall=emulate"` if you are having
|
||||
|
@@ -12,6 +12,7 @@ use async_trait::async_trait;
|
||||
use kata_types::{
|
||||
annotations::{
|
||||
cri_containerd::{SANDBOX_NAMESPACE_LABEL_KEY, SANDBOX_NAME_LABEL_KEY},
|
||||
KATA_ANNO_CFG_HYPERVISOR_DEFAULT_GPUS, KATA_ANNO_CFG_HYPERVISOR_DEFAULT_GPU_MODEL,
|
||||
KATA_ANNO_CFG_HYPERVISOR_DEFAULT_MEMORY, KATA_ANNO_CFG_HYPERVISOR_DEFAULT_VCPUS,
|
||||
KATA_ANNO_CFG_HYPERVISOR_IMAGE_PATH, KATA_ANNO_CFG_HYPERVISOR_MACHINE_TYPE,
|
||||
},
|
||||
@@ -124,6 +125,14 @@ impl RemoteInner {
|
||||
KATA_ANNO_CFG_HYPERVISOR_IMAGE_PATH.to_string(),
|
||||
config.boot_info.image.to_string(),
|
||||
);
|
||||
annotations.insert(
|
||||
KATA_ANNO_CFG_HYPERVISOR_DEFAULT_GPUS.to_string(),
|
||||
config.remote_info.default_gpus.to_string(),
|
||||
);
|
||||
annotations.insert(
|
||||
KATA_ANNO_CFG_HYPERVISOR_DEFAULT_GPU_MODEL.to_string(),
|
||||
config.remote_info.default_gpu_model.to_string(),
|
||||
);
|
||||
annotations
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user