You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/04/02 15:35:04 UTC

[GitHub] [tvm] areusch commented on a change in pull request #7776: [CI] docker images build script cmd line args optional

areusch commented on a change in pull request #7776:
URL: https://github.com/apache/tvm/pull/7776#discussion_r606284421



##########
File path: docker/README.md
##########
@@ -76,14 +77,39 @@ You can also start an interactive session by typing
 ./docker/build.sh image_name -it bash
 ```
 
+The built docker images are prefixed by ``tvm.``, for example the command
+
+````bash
+./docker/build.sh image_name 
+````
+
+produced the image ``tvm.ci_cpu`` that is displayed in the list of docker images

Review comment:
       minor nit: produces

##########
File path: docker/build.sh
##########
@@ -164,25 +164,29 @@ if [[ $? != "0" ]]; then
     exit 1
 fi
 
-# Run the command inside the container.
-echo "Running '${COMMAND[@]}' inside ${DOCKER_IMG_SPEC}..."
-
-# By default we cleanup - remove the container once it finish running (--rm)
-# and share the PID namespace (--pid=host) so the process inside does not have
-# pid 1 and SIGKILL is propagated to the process inside (jenkins can kill it).
-echo ${DOCKER_BINARY}
-${DOCKER_BINARY} run --rm --pid=host \
-    -v ${WORKSPACE}:/workspace \
-    -w /workspace \
-    -e "CI_BUILD_HOME=/workspace" \
-    -e "CI_BUILD_USER=$(id -u -n)" \
-    -e "CI_BUILD_UID=$(id -u)" \
-    -e "CI_BUILD_GROUP=$(id -g -n)" \
-    -e "CI_BUILD_GID=$(id -g)" \
-    -e "CI_PYTEST_ADD_OPTIONS=$CI_PYTEST_ADD_OPTIONS" \
-    -e "CI_IMAGE_NAME=${DOCKER_IMAGE_NAME}" \
-    ${CUDA_ENV}\
-    ${CI_DOCKER_EXTRA_PARAMS[@]} \
-    ${DOCKER_IMG_SPEC} \
-    bash --login docker/with_the_same_user \
-    ${COMMAND[@]}
+if [[ -n ${COMMAND} ]]; then
+
+    # Run the command inside the container.
+    echo "Running '${COMMAND[@]}' inside ${DOCKER_IMG_SPEC}..."
+
+    # By default we cleanup - remove the container once it finish running (--rm)
+    # and share the PID namespace (--pid=host) so the process inside does not have
+    # pid 1 and SIGKILL is propagated to the process inside (jenkins can kill it).
+    echo ${DOCKER_BINARY}

Review comment:
       delete

##########
File path: docker/build.sh
##########
@@ -18,11 +18,11 @@
 # under the License.
 
 #
-# Execute command within a docker container
+# Build a docker container and optionally execute command within a it
 #
 # Usage: build.sh <CONTAINER_TYPE> [--tag <DOCKER_IMAGE_TAG>]
 #                [--dockerfile <DOCKERFILE_PATH>] [-it]
-#                [--net=host] [--cache-from <IMAGE_NAME>] <COMMAND>
+#                [--net=host] [--cache-from <IMAGE_NAME>] <COMMAND (optional)>

Review comment:
       could you enclose command in `[]` to mark it optional, like the other options here? `[<COMMAND>]`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org