Compare commits

...

4 Commits

Author SHA1 Message Date
Evan Lezar
fa66e4cd56 Merge pull request #802 from elezar/bump-release-v1.17.2
Some checks failed
CodeQL / Analyze Go code with CodeQL (push) Failing after 12m54s
Golang / check (push) Failing after 2m12s
Golang / Unit test (push) Failing after 1m35s
Golang / Build (push) Failing after 1m36s
image / packages (${{github.event_name == 'pull_request'}}, centos7-aarch64) (push) Failing after 1m52s
image / packages (${{github.event_name == 'pull_request'}}, centos7-x86_64) (push) Failing after 1m52s
image / packages (${{github.event_name == 'pull_request'}}, centos8-ppc64le) (push) Failing after 1m38s
image / packages (${{github.event_name == 'pull_request'}}, ubuntu18.04-amd64) (push) Failing after 1m45s
image / packages (${{github.event_name == 'pull_request'}}, ubuntu18.04-arm64) (push) Failing after 1m44s
image / packages (${{github.event_name == 'pull_request'}}, ubuntu18.04-ppc64le) (push) Failing after 1m51s
image / image (packaging, ${{github.event_name == 'pull_request'}}) (push) Has been skipped
image / image (ubi8, ${{github.event_name == 'pull_request'}}) (push) Has been skipped
image / image (ubuntu20.04, ${{github.event_name == 'pull_request'}}) (push) Has been skipped
Bump release v1.17.2
2024-11-15 11:04:17 -07:00
Evan Lezar
aac7258b6f Bump version for v1.17.2 release
Signed-off-by: Evan Lezar <elezar@nvidia.com>
2024-11-15 11:02:13 -07:00
Evan Lezar
70ac1e2d28 Merge pull request #801 from elezar/fix-legacy-nvidia-imex-channels
Fix NVIDIA_IMEX_CHANNELS handling on legacy images
2024-11-15 11:01:44 -07:00
Evan Lezar
f774ceeedd Fix NVIDIA_IMEX_CHANNELS handling on legacy images
For legacy images (images with a CUDA_VERSION set but no CUDA_REQUIRES set), the
default behaviour for device envvars is to treat non-existence as all.

This change ensures that the NVIDIA_IMEX_CHANNELS envvar is not treated in the same
way, instead returning no devices if the envvar is not set.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2024-11-15 10:57:02 -07:00
4 changed files with 40 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
# NVIDIA Container Toolkit Changelog
## v1.17.2
- Fixed a bug where legacy images would set imex channels as `all`.
## v1.17.1
- Fixed a bug where specific symlinks existing in a container image could cause a container to fail to start.
- Fixed a bug on Tegra-based systems where a container would fail to start.

View File

@@ -292,7 +292,11 @@ func (i CUDA) CDIDevicesFromMounts() []string {
// ImexChannelsFromEnvVar returns the list of IMEX channels requested for the image.
func (i CUDA) ImexChannelsFromEnvVar() []string {
return i.DevicesFromEnvvars(EnvVarNvidiaImexChannels).List()
imexChannels := i.DevicesFromEnvvars(EnvVarNvidiaImexChannels).List()
if len(imexChannels) == 1 && imexChannels[0] == "all" {
return nil
}
return imexChannels
}
// ImexChannelsFromMounts returns the list of IMEX channels requested for the image.

View File

@@ -203,6 +203,37 @@ func TestGetVisibleDevicesFromMounts(t *testing.T) {
}
}
func TestImexChannelsFromEnvVar(t *testing.T) {
testCases := []struct {
description string
env []string
expected []string
}{
{
description: "no imex channels specified",
},
{
description: "imex channel specified",
env: []string{
"NVIDIA_IMEX_CHANNELS=3,4",
},
expected: []string{"3", "4"},
},
}
for _, tc := range testCases {
for id, baseEnvvars := range map[string][]string{"": nil, "legacy": {"CUDA_VERSION=1.2.3"}} {
t.Run(tc.description+id, func(t *testing.T) {
i, err := NewCUDAImageFromEnv(append(baseEnvvars, tc.env...))
require.NoError(t, err)
channels := i.ImexChannelsFromEnvVar()
require.EqualValues(t, tc.expected, channels)
})
}
}
}
func makeTestMounts(paths ...string) []specs.Mount {
var mounts []specs.Mount
for _, path := range paths {

View File

@@ -13,7 +13,7 @@
# limitations under the License.
LIB_NAME := nvidia-container-toolkit
LIB_VERSION := 1.17.1
LIB_VERSION := 1.17.2
LIB_TAG :=
# The package version is the combination of the library version and tag.