marcoabreu closed pull request #11600: [CI] cleanup and script refinements
URL: https://github.com/apache/incubator-mxnet/pull/11600
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ci/README.md b/ci/README.md
index ca46434a30f..548e9cb9b04 100644
--- a/ci/README.md
+++ b/ci/README.md
@@ -26,7 +26,7 @@ service docker restart
 usermod -a -G docker $SUDO_USER
 ```
 
-For detailed instructions go to the docker documentation.
+For detailed instructions go to the [docker installation 
instructions](https://docs.docker.com/engine/installation/linux/ubuntu/#install-using-the-repository).
 
 
 ## build.py
@@ -49,7 +49,14 @@ To build for armv7 for example:
 ./build.py -p armv7
 ```
 
-The artifacts are located in the build/ directory in the project root. In case
+
+To work inside a container with a shell you can do:
+
+```
+./build.py -p ubuntu_cpu -i
+```
+
+When building, the artifacts are located in the build/ directory in the 
project root. In case
 `build.py -a` is invoked, the artifacts are located in build.<platform>/
 
 ## Add a platform
diff --git a/ci/build.py b/ci/build.py
index 69d3b1059d1..1652505cf5f 100755
--- a/ci/build.py
+++ b/ci/build.py
@@ -78,9 +78,22 @@ def build_docker(platform: str, docker_binary: str, 
registry: str) -> None:
 
     tag = get_docker_tag(platform=platform, registry=registry)
     logging.info("Building container tagged '%s' with %s", tag, docker_binary)
+    #
+    # We add a user with the same group as the executing non-root user so 
files created in the
+    # container match permissions of the local user. Same for the group.
+    #
+    # These variables are used in the docker files to create user and group 
with these ids.
+    # see: docker/install/ubuntu_adduser.sh
+    #
+    # cache-from is needed so we use the cached images tagged from the remote 
via
+    # docker pull see: docker_cache.load_docker_cache
+    #
+    # This doesn't work with multi head docker files.
+    # 
     cmd = [docker_binary, "build",
            "-f", get_dockerfile(platform),
            "--build-arg", "USER_ID={}".format(os.getuid()),
+           "--build-arg", "GROUP_ID={}".format(os.getgid()),
            "--cache-from", tag,
            "-t", tag,
            "docker"]
@@ -149,7 +162,7 @@ def container_run(platform: str,
                   local_ccache_dir: str,
                   command: List[str],
                   dry_run: bool = False,
-                  into_container: bool = False) -> str:
+                  interactive: bool = False) -> str:
     tag = get_docker_tag(platform=platform, registry=docker_registry)
     mx_root = get_mxnet_root()
     local_build_folder = buildir()
@@ -169,23 +182,27 @@ def container_run(platform: str,
                '-e', "CCACHE_LOGFILE=/tmp/ccache.log",  # a container-scoped 
log, useful for ccache verification.
                tag]
     runlist.extend(command)
-    cmd = ' '.join(runlist)
-    if not dry_run and not into_container:
+    cmd = '\\\n\t'.join(runlist)
+    ret = 0
+    if not dry_run and not interactive:
         logging.info("Running %s in container %s", command, tag)
-        logging.info("Executing: %s", cmd)
+        logging.info("Executing:\n%s\n", cmd)
         ret = call(runlist)
 
-    into_cmd = deepcopy(runlist)
-    idx = into_cmd.index('-u') + 2
-    into_cmd[idx:idx] = ['-ti', '--entrypoint', '/bin/bash']
-    docker_run_cmd = ' '.join(into_cmd)
-    if not dry_run and into_container:
-        check_call(into_cmd)
-
-    if not dry_run and ret != 0:
-        logging.error("Running of command in container failed (%s): %s", ret, 
cmd)
-        logging.error("You can try to get into the container by using the 
following command: %s", docker_run_cmd)
-
+    docker_run_cmd = ' '.join(runlist)
+    if not dry_run and interactive:
+        into_cmd = deepcopy(runlist)
+        # -ti can't be after the tag, as is interpreted as a command so hook 
it up after the -u argument
+        idx = into_cmd.index('-u') + 2
+        into_cmd[idx:idx] = ['-ti']
+        cmd = '\\\n\t'.join(into_cmd)
+        logging.info("Executing:\n%s\n", cmd)
+        docker_run_cmd = ' '.join(into_cmd)
+        ret = call(into_cmd)
+
+    if not dry_run and not interactive and ret != 0:
+        logging.error("Running of command in container failed (%s):\n%s\n", 
ret, cmd)
+        logging.error("You can get into the container by adding the -i option")
         raise subprocess.CalledProcessError(ret, cmd)
 
     return docker_run_cmd
@@ -249,7 +266,7 @@ def script_name() -> str:
                         help="print docker run command for manual inspection",
                         action='store_true')
 
-    parser.add_argument("-i", "--into-container",
+    parser.add_argument("-i", "--interactive",
                         help="go in a shell inside the container",
                         action='store_true')
 
@@ -292,19 +309,24 @@ def use_cache():
 
         if command:
             container_run(platform=platform, docker_binary=docker_binary, 
shared_memory_size=shared_memory_size,
-                          command=command, 
docker_registry=args.docker_registry, local_ccache_dir=args.ccache_dir)
+                          command=command, 
docker_registry=args.docker_registry,
+                          local_ccache_dir=args.ccache_dir, 
interactive=args.interactive)
         elif args.print_docker_run:
             print(container_run(platform=platform, 
docker_binary=docker_binary, shared_memory_size=shared_memory_size,
                                 command=[], dry_run=True, 
docker_registry=args.docker_registry, local_ccache_dir=args.ccache_dir))
-        elif args.into_container:
+        elif args.interactive:
             container_run(platform=platform, docker_binary=docker_binary, 
shared_memory_size=shared_memory_size,
-                          command=[], dry_run=False, into_container=True, 
docker_registry=args.docker_registry,
-                          local_ccache_dir=args.ccache_dir)
+                          command=command, 
docker_registry=args.docker_registry,
+                          local_ccache_dir=args.ccache_dir, 
interactive=args.interactive)
+
         else:
+            # With no commands, execute a build function for the target 
platform
+            assert not args.interactive, "when running with -i must provide a 
command"
             cmd = ["/work/mxnet/ci/docker/runtime_functions.sh", 
"build_{}".format(platform)]
             logging.info("No command specified, trying default build: %s", ' 
'.join(cmd))
             container_run(platform=platform, docker_binary=docker_binary, 
shared_memory_size=shared_memory_size,
-                          command=cmd, docker_registry=args.docker_registry, 
local_ccache_dir=args.ccache_dir)
+                          command=cmd, docker_registry=args.docker_registry,
+                          local_ccache_dir=args.ccache_dir)
 
     elif args.all:
         platforms = get_platforms()
@@ -343,9 +365,9 @@ def use_cache():
 
 ./build.py -p armv7 --print-docker-run
 
-    Will print a docker run command to get inside the container in an 
interactive shell
+    Will print a docker run command to get inside the container in a shell
 
-./build.py -p armv7 --into-container
+./build.py -p armv7 --interactive
 
     Will execute a shell into the container
 
diff --git a/ci/docker/Dockerfile.build.ubuntu_base_cpu 
b/ci/docker/Dockerfile.build.ubuntu_base_cpu
index b6515c73850..c3ad2e90fb8 100755
--- a/ci/docker/Dockerfile.build.ubuntu_base_cpu
+++ b/ci/docker/Dockerfile.build.ubuntu_base_cpu
@@ -25,8 +25,8 @@ WORKDIR /work/deps
 
 RUN apt-get update && apt-get -y install sudo
 
-ARG USER_ID=os.getuid()
-
+ARG USER_ID=0
+ARG GROUP_ID=0
 COPY install/ubuntu_adduser.sh /work/
 RUN /work/ubuntu_adduser.sh
 
diff --git a/ci/docker/Dockerfile.build.ubuntu_base_gpu 
b/ci/docker/Dockerfile.build.ubuntu_base_gpu
index bb0aa1de14c..99b79f513be 100755
--- a/ci/docker/Dockerfile.build.ubuntu_base_gpu
+++ b/ci/docker/Dockerfile.build.ubuntu_base_gpu
@@ -25,8 +25,8 @@ WORKDIR /work/deps
 
 RUN apt-get update && apt-get -y install sudo
 
-ARG USER_ID=os.getuid()
-
+ARG USER_ID=0
+ARG GROUP_ID=0
 COPY install/ubuntu_adduser.sh /work/
 RUN /work/ubuntu_adduser.sh
 
diff --git a/ci/docker/Dockerfile.build.ubuntu_blc 
b/ci/docker/Dockerfile.build.ubuntu_blc
index 92bacd1b9fd..294740ce139 100755
--- a/ci/docker/Dockerfile.build.ubuntu_blc
+++ b/ci/docker/Dockerfile.build.ubuntu_blc
@@ -30,6 +30,7 @@ COPY install/ubuntu_npm_blc.sh /work/
 RUN /work/ubuntu_npm_blc.sh
 
 ARG USER_ID=0
+ARG GROUP_ID=0
 COPY install/ubuntu_adduser.sh /work/
 RUN /work/ubuntu_adduser.sh
 
diff --git a/ci/docker/Dockerfile.build.ubuntu_build_cuda 
b/ci/docker/Dockerfile.build.ubuntu_build_cuda
index 0262a100fa7..9ed0cbbe3e5 100755
--- a/ci/docker/Dockerfile.build.ubuntu_build_cuda
+++ b/ci/docker/Dockerfile.build.ubuntu_build_cuda
@@ -51,6 +51,7 @@ RUN /work/ubuntu_nvidia.sh
 
 # Keep this at the end since this command is not cachable
 ARG USER_ID=0
+ARG GROUP_ID=0
 COPY install/ubuntu_adduser.sh /work/
 RUN /work/ubuntu_adduser.sh
 
diff --git a/ci/docker/Dockerfile.build.ubuntu_cpu 
b/ci/docker/Dockerfile.build.ubuntu_cpu
index e715dbe39d1..58a8e9a50d7 100755
--- a/ci/docker/Dockerfile.build.ubuntu_cpu
+++ b/ci/docker/Dockerfile.build.ubuntu_cpu
@@ -61,6 +61,7 @@ COPY install/ubuntu_docs.sh /work/
 RUN /work/ubuntu_docs.sh
 
 ARG USER_ID=0
+ARG GROUP_ID=0
 COPY install/ubuntu_adduser.sh /work/
 RUN /work/ubuntu_adduser.sh
 
diff --git a/ci/docker/Dockerfile.build.ubuntu_gpu 
b/ci/docker/Dockerfile.build.ubuntu_gpu
index f010641d484..de38948e623 100755
--- a/ci/docker/Dockerfile.build.ubuntu_gpu
+++ b/ci/docker/Dockerfile.build.ubuntu_gpu
@@ -67,6 +67,7 @@ COPY install/ubuntu_tutorials.sh /work/
 RUN /work/ubuntu_tutorials.sh
 
 ARG USER_ID=0
+ARG GROUP_ID=0
 COPY install/ubuntu_adduser.sh /work/
 RUN /work/ubuntu_adduser.sh
 
diff --git a/ci/docker/Dockerfile.build.ubuntu_nightly_cpu 
b/ci/docker/Dockerfile.build.ubuntu_nightly_cpu
index 5d021d463df..5e72a0a309b 100755
--- a/ci/docker/Dockerfile.build.ubuntu_nightly_cpu
+++ b/ci/docker/Dockerfile.build.ubuntu_nightly_cpu
@@ -64,7 +64,7 @@ COPY install/ubuntu_emscripten.sh /work/
 RUN /work/ubuntu_emscripten.sh
 
 ARG USER_ID=0
-
+ARG GROUP_ID=0
 COPY install/ubuntu_adduser.sh /work/
 RUN /work/ubuntu_adduser.sh
 
diff --git a/ci/docker/Dockerfile.build.ubuntu_nightly_gpu 
b/ci/docker/Dockerfile.build.ubuntu_nightly_gpu
index 0d166283819..017bade1775 100755
--- a/ci/docker/Dockerfile.build.ubuntu_nightly_gpu
+++ b/ci/docker/Dockerfile.build.ubuntu_nightly_gpu
@@ -70,7 +70,7 @@ COPY install/ubuntu_nightly_tests.sh /work/
 RUN /work/ubuntu_nightly_tests.sh
 
 ARG USER_ID=0
-
+ARG GROUP_ID=0
 COPY install/ubuntu_adduser.sh /work/
 RUN /work/ubuntu_adduser.sh
 
diff --git a/ci/docker/Dockerfile.build.ubuntu_rat 
b/ci/docker/Dockerfile.build.ubuntu_rat
index c77261c2624..234d2e42e94 100755
--- a/ci/docker/Dockerfile.build.ubuntu_rat
+++ b/ci/docker/Dockerfile.build.ubuntu_rat
@@ -26,6 +26,7 @@ COPY install/ubuntu_rat.sh /work/
 RUN /work/ubuntu_rat.sh
 
 ARG USER_ID=0
+ARG GROUP_ID=0
 COPY install/ubuntu_adduser.sh /work/
 RUN /work/ubuntu_adduser.sh
 
diff --git a/ci/docker/install/android_arm64_openblas.sh 
b/ci/docker/install/android_arm64_openblas.sh
index 87e0bf9e8ed..1c3014f6cca 100755
--- a/ci/docker/install/android_arm64_openblas.sh
+++ b/ci/docker/install/android_arm64_openblas.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/android_armv7_openblas.sh 
b/ci/docker/install/android_armv7_openblas.sh
index ff7eadba0cb..55c09890965 100755
--- a/ci/docker/install/android_armv7_openblas.sh
+++ b/ci/docker/install/android_armv7_openblas.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/android_ndk.sh b/ci/docker/install/android_ndk.sh
index fb5640eefbf..cb83aa65639 100755
--- a/ci/docker/install/android_ndk.sh
+++ b/ci/docker/install/android_ndk.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/arm64_openblas.sh 
b/ci/docker/install/arm64_openblas.sh
index 3151a4b5c2a..88f2e98cd65 100755
--- a/ci/docker/install/arm64_openblas.sh
+++ b/ci/docker/install/arm64_openblas.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -32,4 +32,4 @@ make install
 ln -s /opt/OpenBLAS/lib/libopenblas.so /usr/lib/libopenblas.so
 ln -s /opt/OpenBLAS/lib/libopenblas.a /usr/lib/libopenblas.a
 ln -s /opt/OpenBLAS/lib/libopenblas.a /usr/lib/liblapack.a
-popd
\ No newline at end of file
+popd
diff --git a/ci/docker/install/centos7_adduser.sh 
b/ci/docker/install/centos7_adduser.sh
index 7ed64c2dbd3..ba72c9b9228 100755
--- a/ci/docker/install/centos7_adduser.sh
+++ b/ci/docker/install/centos7_adduser.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/centos7_ccache.sh 
b/ci/docker/install/centos7_ccache.sh
index 846a407001b..4bf208d231a 100755
--- a/ci/docker/install/centos7_ccache.sh
+++ b/ci/docker/install/centos7_ccache.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/centos7_core.sh 
b/ci/docker/install/centos7_core.sh
index 1d7e120d6ae..577f9dba743 100755
--- a/ci/docker/install/centos7_core.sh
+++ b/ci/docker/install/centos7_core.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/centos7_python.sh 
b/ci/docker/install/centos7_python.sh
index 154e3b8e4f5..8521cde1acc 100755
--- a/ci/docker/install/centos7_python.sh
+++ b/ci/docker/install/centos7_python.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/deb_ubuntu_ccache.sh 
b/ci/docker/install/deb_ubuntu_ccache.sh
index c7cccbf480f..fe48aca616f 100755
--- a/ci/docker/install/deb_ubuntu_ccache.sh
+++ b/ci/docker/install/deb_ubuntu_ccache.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_adduser.sh 
b/ci/docker/install/ubuntu_adduser.sh
index fd9a3f8d450..515a80f63b0 100755
--- a/ci/docker/install/ubuntu_adduser.sh
+++ b/ci/docker/install/ubuntu_adduser.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -27,11 +27,17 @@ set -ex
 if [[ "$USER_ID" -gt 0 ]]
 then
     # -no-log-init required due to https://github.com/moby/moby/issues/5419
-    useradd -m --no-log-init --uid $USER_ID --system jenkins_slave 
+    if [[ -n "$GROUP_ID" ]] && [[ "$GROUP_ID" -gt 0 ]]
+    then
+        groupadd --gid $GROUP_ID --system jenkins_slave
+        useradd -m --no-log-init --uid $USER_ID --gid $GROUP_ID --system 
jenkins_slave
+    else
+        useradd -m --no-log-init --uid $USER_ID --system jenkins_slave
+    fi
     usermod -aG sudo jenkins_slave
 
-    # By default, docker creates all WORK_DIRs with root owner    
-    mkdir /work/mxnet    
+    # By default, docker creates all WORK_DIRs with root owner
+    mkdir /work/mxnet
     mkdir /work/build
     chown -R jenkins_slave /work/
 fi
diff --git a/ci/docker/install/ubuntu_clang.sh 
b/ci/docker/install/ubuntu_clang.sh
index 08b95bceddc..39a5600ce9d 100755
--- a/ci/docker/install/ubuntu_clang.sh
+++ b/ci/docker/install/ubuntu_clang.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -28,4 +28,4 @@ wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key 
add - && \
     apt-get update && \
     apt-get install -y clang-3.9 clang-5.0 && \
     clang-3.9 --version && \
-    clang-5.0 --version
\ No newline at end of file
+    clang-5.0 --version
diff --git a/ci/docker/install/ubuntu_clojure.sh 
b/ci/docker/install/ubuntu_clojure.sh
index c1a6b7f06d9..7a94cccae94 100755
--- a/ci/docker/install/ubuntu_clojure.sh
+++ b/ci/docker/install/ubuntu_clojure.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_core.sh b/ci/docker/install/ubuntu_core.sh
index 65ad4726597..8a2ea30cd5c 100755
--- a/ci/docker/install/ubuntu_core.sh
+++ b/ci/docker/install/ubuntu_core.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_docs.sh b/ci/docker/install/ubuntu_docs.sh
index 45a6768becb..ee121962ee0 100755
--- a/ci/docker/install/ubuntu_docs.sh
+++ b/ci/docker/install/ubuntu_docs.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_emscripten.sh 
b/ci/docker/install/ubuntu_emscripten.sh
index 459d145af94..e3d72caf0ee 100755
--- a/ci/docker/install/ubuntu_emscripten.sh
+++ b/ci/docker/install/ubuntu_emscripten.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -37,4 +37,4 @@ cmake .. -DCMAKE_BUILD_TYPE=Release 
-DLLVM_TARGETS_TO_BUILD="X86;JSBackend" \
 -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF 
-DCLANG_INCLUDE_EXAMPLES=OFF \
 -DCLANG_INCLUDE_TESTS=OFF && make -j$(nproc)
 
-chmod -R 777 /work/deps/emscripten-fastcomp/
\ No newline at end of file
+chmod -R 777 /work/deps/emscripten-fastcomp/
diff --git a/ci/docker/install/ubuntu_mklml.sh 
b/ci/docker/install/ubuntu_mklml.sh
index 3689aad65cf..4efa1f77e92 100755
--- a/ci/docker/install/ubuntu_mklml.sh
+++ b/ci/docker/install/ubuntu_mklml.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_nightly_tests.sh 
b/ci/docker/install/ubuntu_nightly_tests.sh
index 63f8c22edfe..df56cf5a980 100755
--- a/ci/docker/install/ubuntu_nightly_tests.sh
+++ b/ci/docker/install/ubuntu_nightly_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_npm_blc.sh 
b/ci/docker/install/ubuntu_npm_blc.sh
index 75ab5441345..30fcb5a1bb5 100755
--- a/ci/docker/install/ubuntu_npm_blc.sh
+++ b/ci/docker/install/ubuntu_npm_blc.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_nvidia.sh 
b/ci/docker/install/ubuntu_nvidia.sh
index 4c57404ff63..7b16ed16f48 100755
--- a/ci/docker/install/ubuntu_nvidia.sh
+++ b/ci/docker/install/ubuntu_nvidia.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_perl.sh b/ci/docker/install/ubuntu_perl.sh
index 52bd010ee0b..4d868f7d5d1 100755
--- a/ci/docker/install/ubuntu_perl.sh
+++ b/ci/docker/install/ubuntu_perl.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_python.sh 
b/ci/docker/install/ubuntu_python.sh
index da7c25697b6..f087f07091e 100755
--- a/ci/docker/install/ubuntu_python.sh
+++ b/ci/docker/install/ubuntu_python.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_r.sh b/ci/docker/install/ubuntu_r.sh
index 097a651b2bf..55270ec3fae 100755
--- a/ci/docker/install/ubuntu_r.sh
+++ b/ci/docker/install/ubuntu_r.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_rat.sh b/ci/docker/install/ubuntu_rat.sh
index afaea52bbb9..94596ef011f 100755
--- a/ci/docker/install/ubuntu_rat.sh
+++ b/ci/docker/install/ubuntu_rat.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_runas_sudo.sh 
b/ci/docker/install/ubuntu_runas_sudo.sh
index 40ec60e2b5d..0151c811e37 100755
--- a/ci/docker/install/ubuntu_runas_sudo.sh
+++ b/ci/docker/install/ubuntu_runas_sudo.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -22,4 +22,4 @@
 
 set -ex
 
-echo "jenkins_slave  ALL=(ALL)       NOPASSWD: ALL" >> /etc/sudoers
\ No newline at end of file
+echo "jenkins_slave  ALL=(ALL)       NOPASSWD: ALL" >> /etc/sudoers
diff --git a/ci/docker/install/ubuntu_scala.sh 
b/ci/docker/install/ubuntu_scala.sh
index 8890356da66..bee0e6bbae6 100755
--- a/ci/docker/install/ubuntu_scala.sh
+++ b/ci/docker/install/ubuntu_scala.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_tutorials.sh 
b/ci/docker/install/ubuntu_tutorials.sh
index c8d238cbc5b..9a236bbf4cc 100755
--- a/ci/docker/install/ubuntu_tutorials.sh
+++ b/ci/docker/install/ubuntu_tutorials.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
diff --git a/ci/docker/install/ubuntu_tvm.sh b/ci/docker/install/ubuntu_tvm.sh
index 9ab359b7207..4f5cb4251ad 100755
--- a/ci/docker/install/ubuntu_tvm.sh
+++ b/ci/docker/install/ubuntu_tvm.sh
@@ -41,4 +41,4 @@ cd -
 
 cd topi/python
 python setup.py install
-cd -
\ No newline at end of file
+cd -
diff --git a/ci/test_docker_cache.py b/ci/test_docker_cache.py
index 3f471db5e7a..358d54985ac 100644
--- a/ci/test_docker_cache.py
+++ b/ci/test_docker_cache.py
@@ -251,5 +251,5 @@ def _assert_docker_build(lambda_func, 
expected_cache_hit_count: int, expected_ca
 
 
 if __name__ == '__main__':
-    import nose2
-    nose2.main()
+    import nose
+    nose.main()


 

----------------------------------------------------------------
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