Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
add tests, disable automatically if containerd
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis committed Apr 7, 2021
1 parent 79897e9 commit feeccd0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/api/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) {

defaultNVIDIADevicePluginAddonsConfig := KubernetesAddon{
Name: common.NVIDIADevicePluginAddonName,
Enabled: to.BoolPtr(cs.Properties.IsNvidiaDevicePluginCapable() && !cs.Properties.IsAzureStackCloud()),
Enabled: to.BoolPtr(cs.Properties.IsNvidiaDevicePluginCapable() && !cs.Properties.IsAzureStackCloud() && !cs.Properties.OrchestratorProfile.KubernetesConfig.NeedsContainerd()),
Containers: []KubernetesContainerSpec{
{
Name: common.NVIDIADevicePluginAddonName,
Expand Down
28 changes: 28 additions & 0 deletions pkg/api/addons_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,34 @@ func TestSetAddonsConfig(t *testing.T) {
},
}, "1.15.4"),
},
{
name: "containerd w/ N series SKU",
cs: &ContainerService{
Properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.20.5",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBaseType: common.KubernetesImageBaseTypeMCR,
DNSServiceIP: DefaultKubernetesDNSServiceIP,
KubeletConfig: map[string]string{
"--cluster-domain": "cluster.local",
},
ClusterSubnet: DefaultKubernetesSubnet,
ProxyMode: KubeProxyModeIPTables,
NetworkPlugin: NetworkPluginAzure,
ContainerRuntime: Containerd,
},
},
AgentPoolProfiles: []*AgentPoolProfile{
{
VMSize: "Standard_NC6",
},
},
},
},
isUpgrade: false,
expectedAddons: getDefaultAddons("1.20.5", "", common.KubernetesImageBaseTypeMCR),
},
{
name: "container-monitoring addon enabled",
cs: &ContainerService{
Expand Down
12 changes: 12 additions & 0 deletions test/e2e/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1750,6 +1750,18 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
Describe("with a GPU-enabled agent pool", func() {
It("should be able to run a nvidia-gpu job", func() {
if eng.ExpandedDefinition.Properties.HasNSeriesSKU() {
if hasAddon, _ := eng.HasAddon("nvidia-device-plugin"); !hasAddon {
By("Installing nvidia gpu-operator helm chart")
commandArgsSlice := []string{"upgrade", "--install", "--wait", "gpu-operator", "--repo", "https://nvidia.github.io/gpu-operator", "gpu-operator"}
if eng.ExpandedDefinition.Properties.OrchestratorProfile.KubernetesConfig.NeedsContainerd() {
commandArgsSlice = append(commandArgsSlice, []string{"--set", "operator.defaultRuntime=containerd"}...)
}
cmd := exec.Command("helm", commandArgsSlice...)
out, err := cmd.CombinedOutput()
log.Printf("%s\n", out)
Expect(err).NotTo(HaveOccurred())
}
By("Running a CUDA vector job")
j, err := job.CreateJobFromFileWithRetry(filepath.Join(WorkloadDir, "cuda-vector-add.yaml"), "cuda-vector-add", "default", 3*time.Second, cfg.Timeout)
Expect(err).NotTo(HaveOccurred())
ready, err := j.WaitOnSucceeded(30*time.Second, cfg.Timeout)
Expand Down

0 comments on commit feeccd0

Please sign in to comment.