fixed issue only 1 image running in GPU

This commit is contained in:
2021-06-15 15:02:23 +04:00
parent 1730a58e53
commit 02ca82084b
2 changed files with 10 additions and 1 deletions

View File

@@ -257,7 +257,7 @@ func (d *DockerVM)runContainer(dockerClient *client.Client) error{
for i := range d.Ports {
cmd.WriteString("-p " + fmt.Sprint(d.Ports[i]) + ":" + fmt.Sprint(d.Ports[i]) + " ")
}
cmd.WriteString("-v=/opt/data:/data p2p-ubuntu /start > /dev/null")
cmd.WriteString("-v=/opt/data:/data "+ d.TagName +" /start > /dev/null")
//"-v=/opt/data:/data p2p-ubuntu /start > /dev/null"
cmdStr := cmd.String()
_, err := exec.Command("/bin/sh", "-c", cmdStr).Output()

View File

@@ -21,6 +21,15 @@ func TestDocker(t *testing.T) {
}
func TestContainerHorovod(t *testing.T) {
// Testing by providing the horovod cpu image
_,err := BuildRunContainer(2,"false","cpuhorovod")
if err != nil {
t.Error(err)
}
}
func TestViewAllContainers(t *testing.T) {
_,err := ViewAllContainers()