Skip to content

Commit

Permalink
[CI] Fix release uploads (#466)
Browse files Browse the repository at this point in the history
### Summary:

Modify the release package uploader to avoid uploading duplicate packages

### Test Plan:

CI + test release to ensure that release packages are uploaded correctly
  • Loading branch information
VivekPanyam authored Dec 18, 2020
1 parent 7716042 commit 13452e6
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions build/upload_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,23 @@ def upload():
)

# For each OS: For each backend version: For each CPU/GPU:
upload_package("source/bazel-bin/neuropod/backends/tensorflow/neuropod_tensorflow_backend.tar.gz", release_id, "{}-tensorflow-{}-backend.tar.gz".format(platform, REQUESTED_TF_VERSION))
upload_package("source/bazel-bin/neuropod/backends/torchscript/neuropod_torchscript_backend.tar.gz", release_id, "{}-torchscript-{}-backend.tar.gz".format(platform, REQUESTED_TORCH_VERSION))

# The python package is the same across CPU/GPU and different versions of backends so we'll only upload once for mac and once for linux
# For each OS: For each python version
if not IS_GPU:
# Upload the pythonbridge backend
upload_package("source/bazel-bin/neuropod/backends/python_bridge/neuropod_pythonbridge_backend.tar.gz", release_id, "{}-python-{}-backend.tar.gz".format(platform, PYTHON_VERSION))

# Upload the wheels
for gpath in ["source/python/dist/neuropod-*.whl"]:
whl_path = glob.glob(gpath)[0]
fname = os.path.basename(whl_path)
upload_package(whl_path, release_id, fname, content_type="application/zip")
# Only upload these once
if REQUESTED_TORCH_VERSION != "1.6.0" and REQUESTED_TORCH_VERSION != "1.7.0":
upload_package("source/bazel-bin/neuropod/backends/tensorflow/neuropod_tensorflow_backend.tar.gz", release_id, "{}-tensorflow-{}-backend.tar.gz".format(platform, REQUESTED_TF_VERSION))

# The python package is the same across CPU/GPU and different versions of backends so we'll only upload once for mac and once for linux
# For each OS: For each python version
if not IS_GPU:
# Upload the pythonbridge backend
upload_package("source/bazel-bin/neuropod/backends/python_bridge/neuropod_pythonbridge_backend.tar.gz", release_id, "{}-python-{}-backend.tar.gz".format(platform, PYTHON_VERSION))

# Upload the wheels
for gpath in ["source/python/dist/neuropod-*.whl"]:
whl_path = glob.glob(gpath)[0]
fname = os.path.basename(whl_path)
upload_package(whl_path, release_id, fname, content_type="application/zip")

def get_release_id(tag_name):
# https://api.github.com/repos/uber/neuropod/releases/tags/{tag_name}
Expand Down

0 comments on commit 13452e6

Please sign in to comment.