Skip to content

Commit

Permalink
[v1.9.x] Fix CD for pypi wheel version (apache#20782)
Browse files Browse the repository at this point in the history
* Change env variable used to detect whether it's a release build or not. RELEASE_BUILD is already setup in the CD pipeline.

* Refine how variable is compared to trigger release builds.

* Check for 'true' exclusively, to prevent unwanted release builds.

* Make sure we pass any environment variables on the build.py command line to the docker run command.
  • Loading branch information
josephevans committed Dec 20, 2021
1 parent 60cab18 commit 957be04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions ci/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion tools/pip/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", "false").strip().lower() == "true")

# set by the travis build pipeline
travis_tag = os.environ.get("TRAVIS_TAG", "").strip()
Expand Down

0 comments on commit 957be04

Please sign in to comment.