Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[deploy] assert sufficient space is available at PyPI in deploy #13118

Merged
merged 1 commit into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions hail/scripts/assert_pypi_has_room.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import os

wheel_size = os.path.getsize(os.environ["WHEEL"])
pypi_used_storage = int(os.environ["PYPI_USED_STORAGE"])

print(f'Wheel size: {wheel_size / 1024 / 1024:.0f}MiB. PyPI used storage: {pypi_used_storage / 1024 / 1024:.0f}MiB.')

if wheel_size + pypi_used_storage > 10 * 1024 * 1024 * 1024:
print('Insufficient space available at PyPI.')
exit(1)
print('Sufficient space is available at PyPI.')
5 changes: 5 additions & 0 deletions hail/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -ex

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

retry() {
"$@" ||
(sleep 2 && "$@") ||
Expand Down Expand Up @@ -59,6 +61,9 @@ then
exit 1
fi

export PYPI_USED_STORAGE=$(curl https://pypi.org/pypi/hail/json | jq '[.releases[][].size ]| add')
python3 $SCRIPT_DIR/assert_pypi_has_room.py

# push git tag
git tag $HAIL_PIP_VERSION -m "Hail version $HAIL_PIP_VERSION."
git push origin $HAIL_PIP_VERSION
Expand Down