Skip to content

Commit

Permalink
Set useCogBaseImage to false in base-image (#1892)
Browse files Browse the repository at this point in the history
* We never want to useCogBaseImage when generating
base images.
  • Loading branch information
8W9aG authored Aug 21, 2024
1 parent 8c50fea commit 2394064
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/dockerfile/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ func (g *BaseImageGenerator) GenerateDockerfile() (string, error) {
if err != nil {
return "", err
}
useCogBaseImage := false
generator.useCogBaseImage = &useCogBaseImage

dockerfile, err := generator.generateInitialSteps()
if err != nil {
Expand Down
13 changes: 13 additions & 0 deletions pkg/dockerfile/base_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dockerfile

import (
"strings"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -28,3 +29,15 @@ func TestBaseImageName(t *testing.T) {
require.Equal(t, tt.expected, actual)
}
}

func TestGenerateDockerfile(t *testing.T) {
generator, err := NewBaseImageGenerator(
"12.1",
"3.8",
"2.1.0",
)
require.NoError(t, err)
dockerfile, err := generator.GenerateDockerfile()
require.NoError(t, err)
require.True(t, strings.Contains(dockerfile, "FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04"))
}

0 comments on commit 2394064

Please sign in to comment.