(params: DockerResolverParameters)
| 253 | } |
| 254 | |
| 255 | export async function checkDockerSupportForGPU(params: DockerResolverParameters): Promise<Boolean> { |
| 256 | if (params.gpuAvailability === 'all') { |
| 257 | return true; |
| 258 | } |
| 259 | if (params.gpuAvailability === 'none') { |
| 260 | return false; |
| 261 | } |
| 262 | const result = await dockerCLI(params, 'info', '-f', '{{.Runtimes.nvidia}}'); |
| 263 | const runtimeFound = result.stdout.includes('nvidia-container-runtime'); |
| 264 | return runtimeFound; |
| 265 | } |
| 266 | |
| 267 | export function isBuildKitImagePolicyError(err: any): boolean { |
| 268 | const imagePolicyErrorString = 'could not resolve image due to policy'; // Seen in Buildkit 0.11.0 |
no test coverage detected