This is an automated email from the ASF dual-hosted git repository.
marcoabreu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new 8240d3a [CI] cleanup and script refinements (#11600)
8240d3a is described below
commit 8240d3a2711680b4025238d0375ad2233485cd12
Author: Pedro Larroy <[email protected]>
AuthorDate: Thu Jul 12 17:51:47 2018 +0200
[CI] cleanup and script refinements (#11600)
Add group inside container
Use env in shebang
Change into_container to interactive to match docker syntax
---
ci/README.md | 11 ++++-
ci/build.py | 68 ++++++++++++++++++---------
ci/docker/Dockerfile.build.ubuntu_base_cpu | 4 +-
ci/docker/Dockerfile.build.ubuntu_base_gpu | 4 +-
ci/docker/Dockerfile.build.ubuntu_blc | 1 +
ci/docker/Dockerfile.build.ubuntu_build_cuda | 1 +
ci/docker/Dockerfile.build.ubuntu_cpu | 1 +
ci/docker/Dockerfile.build.ubuntu_gpu | 1 +
ci/docker/Dockerfile.build.ubuntu_nightly_cpu | 2 +-
ci/docker/Dockerfile.build.ubuntu_nightly_gpu | 2 +-
ci/docker/Dockerfile.build.ubuntu_rat | 1 +
ci/docker/install/android_arm64_openblas.sh | 2 +-
ci/docker/install/android_armv7_openblas.sh | 2 +-
ci/docker/install/android_ndk.sh | 2 +-
ci/docker/install/arm64_openblas.sh | 4 +-
ci/docker/install/centos7_adduser.sh | 2 +-
ci/docker/install/centos7_ccache.sh | 2 +-
ci/docker/install/centos7_core.sh | 2 +-
ci/docker/install/centos7_python.sh | 2 +-
ci/docker/install/deb_ubuntu_ccache.sh | 2 +-
ci/docker/install/ubuntu_adduser.sh | 14 ++++--
ci/docker/install/ubuntu_clang.sh | 4 +-
ci/docker/install/ubuntu_clojure.sh | 2 +-
ci/docker/install/ubuntu_core.sh | 2 +-
ci/docker/install/ubuntu_docs.sh | 2 +-
ci/docker/install/ubuntu_emscripten.sh | 4 +-
ci/docker/install/ubuntu_mklml.sh | 2 +-
ci/docker/install/ubuntu_nightly_tests.sh | 2 +-
ci/docker/install/ubuntu_npm_blc.sh | 2 +-
ci/docker/install/ubuntu_nvidia.sh | 2 +-
ci/docker/install/ubuntu_perl.sh | 2 +-
ci/docker/install/ubuntu_python.sh | 2 +-
ci/docker/install/ubuntu_r.sh | 2 +-
ci/docker/install/ubuntu_rat.sh | 2 +-
ci/docker/install/ubuntu_runas_sudo.sh | 4 +-
ci/docker/install/ubuntu_scala.sh | 2 +-
ci/docker/install/ubuntu_tutorials.sh | 2 +-
ci/docker/install/ubuntu_tvm.sh | 2 +-
ci/test_docker_cache.py | 4 +-
39 files changed, 107 insertions(+), 67 deletions(-)
diff --git a/ci/README.md b/ci/README.md
index ca46434..548e9cb 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 69d3b10..1652505 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 main() -> int:
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 main() -> int:
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 @@ Examples:
./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 b6515c7..c3ad2e9 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 bb0aa1d..99b79f5 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 92bacd1..294740c 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 0262a10..9ed0cbb 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 e715dbe..58a8e9a 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 f010641..de38948 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 5d021d4..5e72a0a 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 0d16628..017bade 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 c77261c..234d2e4 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 87e0bf9..1c3014f 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 ff7eadb..55c0989 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 fb5640e..cb83aa6 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 3151a4b..88f2e98 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 7ed64c2..ba72c9b 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 846a407..4bf208d 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 1d7e120..577f9db 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 154e3b8..8521cde 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 c7cccbf..fe48aca 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 fd9a3f8..515a80f 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 08b95bce..39a5600 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 c1a6b7f..7a94ccc 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 65ad472..8a2ea30 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 45a6768..ee12196 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 459d145..e3d72ca 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 3689aad..4efa1f7 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 63f8c22..df56cf5 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 75ab544..30fcb5a 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 4c57404..7b16ed1 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 52bd010..4d868f7 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 da7c256..f087f07 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 097a651..55270ec 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 afaea52..94596ef 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 40ec60e..0151c81 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 8890356..bee0e6b 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 c8d238c..9a236bb 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 9ab359b..4f5cb42 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 3f471db..358d549 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()