MCPcopy Create free account
hub / github.com/NVIDIA/gpu-operator / validate

Method validate

cmd/nvidia-validator/main.go:1132–1158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1130}
1131
1132func (t *Toolkit) validate() error {
1133 // delete status file is already present
1134 err := deleteStatusFile(outputDirFlag + "/" + toolkitStatusFile)
1135 if err != nil {
1136 return err
1137 }
1138
1139 // invoke nvidia-smi command to check if container run with toolkit injected files
1140 command := "nvidia-smi"
1141 args := []string{}
1142 if withWaitFlag {
1143 err = runCommandWithWait(command, args, sleepIntervalSecondsFlag, false)
1144 } else {
1145 err = runCommand(command, args, false)
1146 }
1147 if err != nil {
1148 fmt.Println("toolkit is not ready")
1149 return err
1150 }
1151
1152 // create toolkit status file
1153 err = createStatusFile(outputDirFlag + "/" + toolkitStatusFile)
1154 if err != nil {
1155 return err
1156 }
1157 return nil
1158}
1159
1160func (p *Plugin) validate() error {
1161 // delete status file is already present

Callers 1

validateComponentFunction · 0.95

Calls 4

deleteStatusFileFunction · 0.85
runCommandWithWaitFunction · 0.85
runCommandFunction · 0.85
createStatusFileFunction · 0.85

Tested by

no test coverage detected