mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Make NVProxy and TPUProxy annotations public.
PiperOrigin-RevId: 630500333
This commit is contained in:
committed by
gVisor bot
parent
640a42e63c
commit
18509eb02f
@@ -26,15 +26,15 @@ import (
|
||||
|
||||
const nvdEnvVar = "NVIDIA_VISIBLE_DEVICES"
|
||||
|
||||
// annotationNVProxy enables nvproxy.
|
||||
const annotationNVProxy = "dev.gvisor.internal.nvproxy"
|
||||
// AnnotationNVProxy enables nvproxy.
|
||||
const AnnotationNVProxy = "dev.gvisor.internal.nvproxy"
|
||||
|
||||
// NVProxyEnabled checks both the nvproxy annotation and conf.NVProxy to see if nvproxy is enabled.
|
||||
func NVProxyEnabled(spec *specs.Spec, conf *config.Config) bool {
|
||||
if conf.NVProxy {
|
||||
return true
|
||||
}
|
||||
val, ok := spec.Annotations[annotationNVProxy]
|
||||
val, ok := spec.Annotations[AnnotationNVProxy]
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -44,12 +44,16 @@ import (
|
||||
const (
|
||||
annotationFlagPrefix = "dev.gvisor.flag."
|
||||
annotationSeccomp = "dev.gvisor.internal.seccomp."
|
||||
annotationTPU = "dev.gvisor.internal.tpuproxy"
|
||||
annotationSeccompRuntimeDefault = "RuntimeDefault"
|
||||
|
||||
annotationContainerName = "io.kubernetes.cri.container-name"
|
||||
)
|
||||
|
||||
const (
|
||||
// AnnotationTPU is the annotation used to enable TPU proxy on a pod.
|
||||
AnnotationTPU = "dev.gvisor.internal.tpuproxy"
|
||||
)
|
||||
|
||||
// ExePath must point to runsc binary, which is normally the same binary. It's
|
||||
// changed in tests that aren't linked in the same binary.
|
||||
var ExePath = "/proc/self/exe"
|
||||
@@ -567,7 +571,7 @@ func TPUProxyIsEnabled(spec *specs.Spec, conf *config.Config) bool {
|
||||
if conf.TPUProxy {
|
||||
return true
|
||||
}
|
||||
val, ok := spec.Annotations[annotationTPU]
|
||||
val, ok := spec.Annotations[AnnotationTPU]
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user