From 68627cc0d01e5a0384c06aaa0ed33203d3c604cd Mon Sep 17 00:00:00 2001 From: Joe Evans Date: Fri, 17 Dec 2021 22:28:51 +0000 Subject: [PATCH 1/4] Change env variable used to detect whether it's a release build or not. RELEASE_BUILD is already setup in the CD pipeline. --- tools/pip/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pip/setup.py b/tools/pip/setup.py index bd18f1e6ddab..e9d7ee78d5ad 100644 --- a/tools/pip/setup.py +++ b/tools/pip/setup.py @@ -45,7 +45,7 @@ __version__ = libinfo['__version__'] # set by the CD pipeline -is_release = os.environ.get("IS_RELEASE", "").strip() +is_release = os.environ.get("RELEASE_BUILD", "").strip() # set by the travis build pipeline travis_tag = os.environ.get("TRAVIS_TAG", "").strip() From e6d17a79f941f85d18877ffeaab206c749755f63 Mon Sep 17 00:00:00 2001 From: Joe Evans Date: Fri, 17 Dec 2021 22:52:16 +0000 Subject: [PATCH 2/4] Refine how variable is compared to trigger release builds. --- tools/pip/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pip/setup.py b/tools/pip/setup.py index e9d7ee78d5ad..c50e4ce07694 100644 --- a/tools/pip/setup.py +++ b/tools/pip/setup.py @@ -45,7 +45,7 @@ __version__ = libinfo['__version__'] # set by the CD pipeline -is_release = os.environ.get("RELEASE_BUILD", "").strip() +is_release = (os.environ.get("RELEASE_BUILD", "false").strip().lower() != "false") # set by the travis build pipeline travis_tag = os.environ.get("TRAVIS_TAG", "").strip() From 9cecd5b91a057840beb6327fcb490b3631769040 Mon Sep 17 00:00:00 2001 From: Joe Evans Date: Fri, 17 Dec 2021 22:56:53 +0000 Subject: [PATCH 3/4] Check for 'true' exclusively, to prevent unwanted release builds. --- tools/pip/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pip/setup.py b/tools/pip/setup.py index c50e4ce07694..a8ab7b0322c9 100644 --- a/tools/pip/setup.py +++ b/tools/pip/setup.py @@ -45,7 +45,7 @@ __version__ = libinfo['__version__'] # set by the CD pipeline -is_release = (os.environ.get("RELEASE_BUILD", "false").strip().lower() != "false") +is_release = (os.environ.get("RELEASE_BUILD", "false").strip().lower() == "true") # set by the travis build pipeline travis_tag = os.environ.get("TRAVIS_TAG", "").strip() From ba100d7ae52eeddb9d6000dbe6477d47d4476fb5 Mon Sep 17 00:00:00 2001 From: Joe Evans Date: Sat, 18 Dec 2021 01:23:09 +0000 Subject: [PATCH 4/4] Make sure we pass any environment variables on the build.py command line to the docker run command. --- ci/build.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ci/build.py b/ci/build.py index 06a747515182..b7236dcc9beb 100755 --- a/ci/build.py +++ b/ci/build.py @@ -273,15 +273,10 @@ def container_run(platform: str, # mount mxnet/build for storing build '-v', "{}:/work/build".format(local_build_folder), '-v', "{}:/work/ccache".format(local_ccache_dir), - '-u', '{}:{}'.format(os.getuid(), os.getgid()), - '-e', 'CCACHE_MAXSIZE={}'.format(environment['CCACHE_MAXSIZE']), - # temp dir should be local and not shared - '-e', 'CCACHE_TEMPDIR={}'.format(environment['CCACHE_TEMPDIR']), - # this path is inside the container as /work/ccache is mounted - '-e', "CCACHE_DIR={}".format(environment['CCACHE_DIR']), - # a container-scoped log, useful for ccache verification. - '-e', "CCACHE_LOGFILE={}".format(environment['CCACHE_LOGFILE']), + '-u', '{}:{}'.format(os.getuid(), os.getgid()) ] + for e in environment.keys(): + docker_arg_list += ['-e', '{}={}'.format(e, environment[e])] docker_arg_list += [tag] docker_arg_list.extend(command)