Skip to content

Commit

Permalink
Allow run as root for Intel MPI
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y committed Jan 1, 2025
1 parent bce83b6 commit a0eebcd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/e2e/mpi_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ var _ = ginkgo.Describe("MPIJob", func() {
Image: intelMPIImage,
ImagePullPolicy: corev1.PullIfNotPresent, // use locally built image.
Command: []string{}, // uses entrypoint.
Args: []string{
"/usr/sbin/sshd",
"-De",
},
//Args: []string{
// "/usr/sbin/sshd",
// "-De",
//},
ReadinessProbe: &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
TCPSocket: &corev1.TCPSocketAction{
Expand All @@ -245,6 +245,8 @@ var _ = ginkgo.Describe("MPIJob", func() {

ginkgo.When("running as root", func() {
ginkgo.It("should succeed", func() {
launcherContainer := &mpiJob.Spec.MPIReplicaSpecs[kubeflow.MPIReplicaTypeLauncher].Template.Spec.Containers[0]
launcherContainer.Command = append(launcherContainer.Command, "--allow-run-as-root")
mpiJob := createJobAndWaitForCompletion(mpiJob)
expectConditionToBeTrue(mpiJob, kubeflow.JobSucceeded)
})
Expand All @@ -261,7 +263,8 @@ var _ = ginkgo.Describe("MPIJob", func() {
workerContainer.SecurityContext = &corev1.SecurityContext{
RunAsUser: ptr.To[int64](1000),
}
workerContainer.Args = append(workerContainer.Args, "-f", "/home/mpiuser/.sshd_config")
//workerContainer.Args = append(workerContainer.Args, "-f", "/home/mpiuser/.sshd_config")
workerContainer.Args = append(workerContainer.Args, "/usr/sbin/sshd", "-De", "-f", "/home/mpiuser/.sshd_config")
})

ginkgo.It("should succeed", func() {
Expand Down

0 comments on commit a0eebcd

Please sign in to comment.