mbaijal commented on a change in pull request #12791: [MXNET-1093] Add python3 
Docker images for each MXNet release
URL: https://github.com/apache/incubator-mxnet/pull/12791#discussion_r227580455
 
 

 ##########
 File path: docker/docker-python/build_python_dockerfile.sh
 ##########
 @@ -79,48 +76,82 @@ docker_account_logout(){
 }
 
 docker_push_image(){
-    docker push mxnet/python:${1}
+    image_tag="${1}"
+    docker push mxnet/python:${image_tag}
 }
 
+docker_generate_image_cpu(){
+    image_tag="${1}"
+    dockerfile="${2}"
+    python_version="${3}"
+    echo "Building docker image mxnet/python:${image_tag}"
+    docker build --build-arg version=${pip_tag} -t mxnet/python:${image_tag} 
-f ${dockerfile} .
+    docker_test_image_cpu ${image_tag} ${python_version}
+}
 
-# Build and Test dockerfiles - CPU
-docker_build_image "${mxnet_version}_cpu" "Dockerfile.mxnet.python.cpu"
-docker_test_image_cpu "${mxnet_version}_cpu"
-
-docker_build_image "${mxnet_version}_cpu_mkl" "Dockerfile.mxnet.python.cpu.mkl"
-docker_test_image_cpu "${mxnet_version}_cpu_mkl"
-
-docker_tag_image "${mxnet_version}_cpu" "latest"
-docker_test_image_cpu "latest"
-
-
-#Build and Test dockerfiles - GPU
-docker_build_image "${mxnet_version}_gpu_cu90" 
"Dockerfile.mxnet.python.gpu.cu90"
-docker_test_image_gpu "${mxnet_version}_gpu_cu90"
-
-docker_build_image "${mxnet_version}_gpu_cu90_mkl" 
"Dockerfile.mxnet.python.gpu.cu90.mkl"
-docker_test_image_gpu "${mxnet_version}_gpu_cu90_mkl"
-
-docker_tag_image "${mxnet_version}_gpu_cu90" "gpu"
-docker_test_image_gpu "gpu"
+docker_tag_image_cpu(){
+    original_tag="${1}"
+    image_tag="${2}"
+    python_version="${3}"
+    docker tag mxnet/python:${original_tag} mxnet/python:${image_tag}
+    docker_test_image_cpu ${image_tag} ${python_version}
+}
 
-docker_build_image "${mxnet_version}_gpu_cu80" 
"Dockerfile.mxnet.python.gpu.cu80"
-docker_test_image_gpu "${mxnet_version}_gpu_cu80"
+docker_generate_image_gpu(){
+    image_tag="${1}"
+    dockerfile="${2}"
+    python_version="${3}"
+    echo "Building docker image mxnet/python:${1}"
+    docker build --build-arg version=${pip_tag} -t mxnet/python:${image_tag} 
-f ${dockerfile} .
+    docker_test_image_gpu ${image_tag} ${python_version}
+}
 
-docker_build_image "${mxnet_version}_gpu_cu80_mkl" 
"Dockerfile.mxnet.python.gpu.cu80.mkl"
-docker_test_image_gpu "${mxnet_version}_gpu_cu80_mkl"
+docker_tag_image_gpu(){
+    original_tag="${1}"
+    image_tag="${2}"
+    python_version="${3}"
+    docker tag mxnet/python:${original_tag} mxnet/python:${image_tag}
+    docker_test_image_gpu ${image_tag} ${python_version}
+}
 
-docker_build_image "${mxnet_version}_gpu_cu92" 
"Dockerfile.mxnet.python.gpu.cu92"
-docker_test_image_gpu "${mxnet_version}_gpu_cu92"
 
-docker_build_image "${mxnet_version}_gpu_cu92_mkl" 
"Dockerfile.mxnet.python.gpu.cu92.mkl"
-docker_test_image_gpu "${mxnet_version}_gpu_cu92_mkl"
+# Build and Test dockerfiles - CPU
+docker_generate_image_cpu "${mxnet_version}_cpu" "Dockerfile.mxnet.python.cpu" 
"python" &
+docker_generate_image_cpu "${mxnet_version}_cpu_mkl" 
"Dockerfile.mxnet.python.cpu.mkl" "python" &
+docker_tag_image_cpu "${mxnet_version}_cpu" "latest" "python" &
 
+#Build and Test dockerfiles - GPU
+docker_generate_image_gpu "${mxnet_version}_gpu_cu90" 
"Dockerfile.mxnet.python.gpu.cu90" "python" &
 
 Review comment:
   I checked that by hardcoding an incorrect mxnet version in one of the 
dockerfiles. While a non-zero error message is printed the logs, the script 
does not exit and completes with "success". 
   I will fix this. 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to