Skip to content

Commit

Permalink
Fix debug issue
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLike committed Mar 29, 2019
1 parent f693599 commit 5ca96a7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
12 changes: 7 additions & 5 deletions example/integrations/mpi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ RUN apt-get update --fix-missing \
&& apt-get install -y git \
&& apt-get install -y build-essential \
&& apt-get install -y ssh \
&& apt-get clean
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/wesleykendall/mpitutorial \
&& cd mpitutorial/tutorials/mpi-hello-world/code \
&& make \
&& cp mpitutorial/tutorials/mpi-hello-world/code/mpi_hello_world /home/ \
&& apt-get remove git \
&& apt-get remove build-essential \
CMD /etc/init.d/ssh start
&& cp mpi_hello_world /home/ \
&& apt-get autoremove -y git \
&& apt-get autoremove -y build-essential \
&& rm -rf "/mpitutorial"
CMD mkdir -p /var/run/sshd; /usr/sbin/sshd;
3 changes: 2 additions & 1 deletion example/integrations/mpi/mpi-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ spec:
- |
MPI_HOST=`cat /etc/volcano/mpiworker.host | tr "\n" ","`;
mkdir -p /var/run/sshd; /usr/sbin/sshd;
mpiexec --allow-run-as-root --host ${MPI_HOST} -np 2 mpi_hello_world > /home/re
mpiexec --allow-run-as-root --host ${MPI_HOST} -np 2 mpi_hello_world > /home/re;
#TODO: use volcano repo instead in the future.
image: tommylike/volcano-example-mpi:0.0.1
name: mpimaster
ports:
Expand Down
6 changes: 6 additions & 0 deletions hack/run-e2e-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export VK_BIN=${VK_ROOT}/_output/bin
export LOG_LEVEL=3
export SHOW_VOLCANO_LOGS=${SHOW_VOLCANO_LOGS:-1}
export CLEANUP_CLUSTER=${CLEANUP_CLUSTER:-1}
#TODO: Use volcano repo instead in the future
export MPI_EXAMPLE_IMAGE=${MPI_EXAMPLE_IMAGE:-"tommylike/volcano-example-mpi:0.0.1"}

if [[ "${CLUSTER_NAME}xxx" != "xxx" ]];then
export CLUSTER_CONTEXT="--name ${CLUSTER_NAME}"
Expand Down Expand Up @@ -52,10 +54,14 @@ function install-volcano {
chmod 700 get_helm.sh && ./get_helm.sh --version v2.13.0
helm init --service-account tiller --kubeconfig ${KUBECONFIG} --wait

echo "Pulling required docker images"
docker pull ${MPI_EXAMPLE_IMAGE}

echo "Loading docker images into kind cluster"
kind load docker-image ${IMAGE}-controllers:${TAG} ${CLUSTER_CONTEXT}
kind load docker-image ${IMAGE}-scheduler:${TAG} ${CLUSTER_CONTEXT}
kind load docker-image ${IMAGE}-admission:${TAG} ${CLUSTER_CONTEXT}
kind load docker-image ${MPI_EXAMPLE_IMAGE} ${CLUSTER_CONTEXT}

echo "Install volcano plugin into cluster...."
helm plugin install --kubeconfig ${KUBECONFIG} installer/chart/volcano/plugins/gen-admission-secret
Expand Down
5 changes: 3 additions & 2 deletions test/e2e/mpi.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ var _ = Describe("MPI E2E Test", func() {
min: 1,
rep: 1,
workingDir: "/home",
command: `sleep 3;
//Need sometime waiting for worker node ready
command: `sleep 5;
MPI_HOST=` + "`" + `cat /etc/volcano/mpiworker.host | tr "\n" ","` + "`" + `;
mkdir -p /var/run/sshd; /usr/sbin/sshd;
mpiexec --allow-run-as-root --host ${MPI_HOST} -np 2 mpi_hello_world > /home/re`,
Expand All @@ -73,4 +74,4 @@ mpiexec --allow-run-as-root --host ${MPI_HOST} -np 2 mpi_hello_world > /home/re`
Expect(err).NotTo(HaveOccurred())
})

})
})
9 changes: 6 additions & 3 deletions test/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ const (
masterPriority = "master-pri"
defaultNginxImage = "nginx:1.14"
defaultBusyBoxImage = "busybox:1.24"
defaultMPIImage = "tommylike/volcano-example-mpi:0.0.1"
//TODO: Use volcano repo instead in the future
defaultMPIImage = "tommylike/volcano-example-mpi:0.0.1"
)

func cpuResource(request string) v1.ResourceList {
Expand Down Expand Up @@ -556,6 +557,7 @@ func waitJobUnschedulable(ctx *context, job *vkv1.Job) error {
}

func createContainers(img, command, workingDir string, req v1.ResourceList, hostport int32) []v1.Container {
var imageRepo []string
container := v1.Container{
Image: img,
ImagePullPolicy: v1.PullIfNotPresent,
Expand All @@ -564,10 +566,11 @@ func createContainers(img, command, workingDir string, req v1.ResourceList, host
},
}
if strings.Index(img, ":") < 0 {
container.Name = img
imageRepo = strings.Split(img, "/")
} else {
container.Name = img[:strings.Index(img, ":")]
imageRepo = strings.Split(img[:strings.Index(img, ":")], "/")
}
container.Name = imageRepo[len(imageRepo)-1]

if len(command) > 0 {
container.Command = []string{"/bin/sh"}
Expand Down

0 comments on commit 5ca96a7

Please sign in to comment.