@@ -29,24 +29,21 @@ import (
2929)
3030
3131const (
32- nvidiaHelmChartRepoURL string = "https://helm.ngc.nvidia.com/nvidia"
33- nvidiaGPUOperatorNamespace string = "default"
34- nvidiaGPUOperatorHelmReleaseName string = "nvidia-gpu-operator"
35- nvidiaGPUOperatorHelmChartName string = "gpu-operator"
32+ nvidiaGPUOperatorNamespace string = "default"
3633)
3734
38- // GPUOperatorSpecInput is the input for InstallGPUOperator.
39- type GPUOperatorSpecInput struct {
35+ // EnsureGPUOperatorInput is the input for InstallGPUOperator.
36+ type EnsureGPUOperatorInput struct {
4037 BootstrapClusterProxy framework.ClusterProxy
4138 Namespace * corev1.Namespace
4239 ClusterName string
4340}
4441
45- // InstallGPUOperator installs the official nvidia/gpu-operator helm chart.
46- func InstallGPUOperator (ctx context.Context , inputGetter func () GPUOperatorSpecInput ) {
42+ // EnsureGPUOperator installs the official nvidia/gpu-operator helm chart.
43+ func EnsureGPUOperator (ctx context.Context , inputGetter func () EnsureGPUOperatorInput ) {
4744 var (
4845 specName = "nvidia-gpu-operator"
49- input GPUOperatorSpecInput
46+ input EnsureGPUOperatorInput
5047 )
5148
5249 Expect (ctx ).NotTo (BeNil (), "ctx is required for %s spec" , specName )
@@ -56,12 +53,12 @@ func InstallGPUOperator(ctx context.Context, inputGetter func() GPUOperatorSpecI
5653 Expect (input .Namespace ).NotTo (BeNil (), "Invalid argument. input.Namespace can't be nil when calling %s spec" , specName )
5754 Expect (input .ClusterName ).NotTo (BeEmpty (), "Invalid argument. input.ClusterName can't be empty when calling %s spec" , specName )
5855 clusterProxy := input .BootstrapClusterProxy .GetWorkloadCluster (ctx , input .Namespace .Name , input .ClusterName )
59- InstallNvidiaGPUOperatorChart (ctx , clusterProxy )
60- }
6156
62- // InstallNvidiaGPUOperatorChart installs the official nvidia/gpu-operator helm chart
63- func InstallNvidiaGPUOperatorChart (ctx context.Context , clusterProxy framework.ClusterProxy ) {
64- By ("Installing nvidia/gpu-operator via helm" )
65- values := & HelmOptions {}
66- InstallHelmChart (ctx , clusterProxy , nvidiaGPUOperatorNamespace , nvidiaHelmChartRepoURL , nvidiaGPUOperatorHelmChartName , nvidiaGPUOperatorHelmReleaseName , values , "" )
57+ By ("Ensuring GPU Operator is installed via CAAPH" )
58+
59+ By ("Waiting for Ready gpu-operator deployment pods" )
60+ for _ , d := range []string {"gpu-operator" } {
61+ waitInput := GetWaitForDeploymentsAvailableInput (ctx , clusterProxy , d , nvidiaGPUOperatorNamespace , specName )
62+ WaitForDeploymentsAvailable (ctx , waitInput , e2eConfig .GetIntervals (specName , "wait-deployment" )... )
63+ }
6764}
0 commit comments