Skip to content

Commit

Permalink
Add more docker images tests
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
  • Loading branch information
flx42 committed May 5, 2022
1 parent e185863 commit 5a1ec63
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/docker_image.bats
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

load ./common

@test "Docker Hub ubuntu:12.04" {
run_srun --container-image=ubuntu:12.04 grep 'Ubuntu precise' /etc/os-release
}

@test "Docker Hub ubuntu:14.04" {
run_srun --container-image=ubuntu:14.04 grep 'Ubuntu 14.04' /etc/os-release
}

@test "Docker Hub ubuntu:16.04" {
run_srun --container-image=ubuntu:16.04 grep 'Ubuntu 16.04' /etc/os-release
}
Expand All @@ -10,6 +18,22 @@ load ./common
run_srun --container-image=ubuntu:18.04 grep 'Ubuntu 18.04' /etc/os-release
}

@test "Docker Hub ubuntu:20.04" {
run_srun --container-image=ubuntu:20.04 grep 'Ubuntu 20.04' /etc/os-release
}

@test "Docker Hub ubuntu:22.04" {
run_srun --container-image=ubuntu:22.04 grep 'Ubuntu 22.04' /etc/os-release
}

@test "Docker Hub centos:5" {
run_srun --container-image=centos:5 grep 'CentOS release 5.11 (Final)' /etc/redhat-release
}

@test "Docker Hub centos:6" {
run_srun --container-image=centos:6 grep 'CentOS release 6.10 (Final)' /etc/redhat-release
}

@test "Docker Hub centos:7" {
run_srun --container-image=centos:7 grep 'CentOS Linux release 7.' /etc/redhat-release
}
Expand All @@ -23,16 +47,31 @@ load ./common
[ "${lines[-1]}" == "1.5.0a0+3bbb36e" ]
}

@test "nvcr.io PyTorch 22.04" {
run_srun --container-image=nvcr.io#nvidia/pytorch:22.04-py3 sh -c 'echo $PYTORCH_VERSION'
[ "${lines[-1]}" == "1.12.0a0+bd13bc6" ]
}

@test "gcr.io TensorFlow 1.14" {
run_srun --no-container-mount-home --container-image=gcr.io#deeplearning-platform-release/tf-gpu.1-14 /entrypoint.sh python -c 'import tensorflow; print(tensorflow.__version__)'
[ "${lines[-1]}" == "1.14.0" ]
}

@test "gcr.io TensorFlow 2.8" {
run_srun --no-container-mount-home --container-image=gcr.io#deeplearning-platform-release/tf-gpu.2-8 /entrypoint.sh python -c 'import tensorflow; print(tensorflow.__version__)'
[ "${lines[-1]}" == "2.8.0" ]
}

@test "gitlab.com NVIDIA device plugin" {
run_srun --container-image=registry.gitlab.com#nvidia/kubernetes/device-plugin/k8s-device-plugin:1.0.0-beta4 md5sum /usr/bin/nvidia-device-plugin
[ "${lines[-1]}" == "7d9c8e3e005c4bd2161def017f10f719 /usr/bin/nvidia-device-plugin" ]
}

@test "nvcr.io NVIDIA device plugin" {
run_srun --container-image=nvcr.io#nvidia/k8s-device-plugin:v0.11.0 md5sum /usr/bin/nvidia-device-plugin
[ "${lines[-1]}" == "78d5dfab092f182246d7e1aff420b770 /usr/bin/nvidia-device-plugin" ]
}

@test "image download must be attempted once" {
run_srun_unchecked --ntasks=2 --container-image=thisimagedoesntexist true
[ "${status}" -ne 0 ]
Expand Down

0 comments on commit 5a1ec63

Please sign in to comment.