Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5622787
Use GH-Actions artifacts to release python wheels
Jun 17, 2020
162e581
fixup! Use GH-Actions artifacts to release python wheels
Jul 2, 2020
7a7f18d
fixup! fixup! Use GH-Actions artifacts to release python wheels
Jul 2, 2020
ae071a5
fixup! fixup! fixup! Use GH-Actions artifacts to release python wheels
Jul 2, 2020
49dfb8c
fixup! fixup! fixup! fixup! Use GH-Actions artifacts to release pytho…
Jul 7, 2020
f2b5f0e
fixup! fixup! fixup! fixup! fixup! Use GH-Actions artifacts to releas…
Jul 7, 2020
bdb08b0
Update FMT strings
Jul 8, 2020
ad77697
fixup! Update FMT strings
Jul 8, 2020
e19df43
Downloading files in streaming mode
Jul 13, 2020
1c27e5e
fixup! Downloading files in streaming mode
Jul 13, 2020
0348b1f
Support only push trigger events
Jul 13, 2020
025e247
Change GCS upload message
Jul 13, 2020
9f687e5
More explicit check of workflow run status and conclusion
Jul 13, 2020
dca7f84
Refactor to do not use global vars, ask for gh-token
Jul 14, 2020
a1d3e00
fixup! Refactor to do not use global vars, ask for gh-token
Jul 15, 2020
5332c54
Add checksum verification of downloaded artifacts
Jul 15, 2020
ba36b98
fixup! Add checksum verification of downloaded artifacts
Jul 15, 2020
94adbc8
Improve sh by following shellchecks
Jul 15, 2020
4d30bfe
Remove remove unnecessary git push
Jul 21, 2020
512a2ad
Move echo inside loop
Jul 21, 2020
60c50be
Fix typo
Jul 21, 2020
62f6946
Fix shadowing variable in context
Jul 21, 2020
44ecec4
Improve docstrings
Jul 21, 2020
9a02b04
Fix info about GCS location
Jul 21, 2020
7ab4468
Refactor fetching GitHub actions artifacts in sh
Jul 21, 2020
9670b6d
Refactor cleaning directory at the end of python staging in sh
Jul 21, 2020
4edf8f0
fixup! Fix info about GCS location
Jul 22, 2020
84dbfb0
Build and download only ZIP source dist
Jul 22, 2020
49e8084
Refactor downloading artifacts
Jul 22, 2020
a67033e
fixup! Build and download only ZIP source dist
Jul 22, 2020
a8fed68
Improve handling temporary files
Jul 25, 2020
54766ce
Use absolute path for artifacts directory
Jul 25, 2020
fe4f834
Move pre-requirements to the top
Jul 25, 2020
6abb237
Improve description
Jul 25, 2020
54e6139
Ask for clearing dir confirmation if dir exists
Jul 25, 2020
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: 5 additions & 6 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@ jobs:
run: python -m pip install wheel
- name: Build source
working-directory: ./sdks/python
run: python setup.py sdist --formats=gztar,zip
run: python setup.py sdist --formats=zip
- name: Add checksums
working-directory: ./sdks/python/dist
run: |
for file in *.zip *.tar.gz; do
sha512sum $file > ${file}.sha512
done
file=$(ls | grep .zip | head -n 1)
sha512sum $file > ${file}.sha512
- name: Unzip source
working-directory: ./sdks/python
run: unzip dist/$(ls dist | grep .zip | head -n 1)
Expand All @@ -73,7 +72,7 @@ jobs:
- name: Upload compressed sources as artifacts
uses: actions/upload-artifact@v2
with:
name: source_gztar_zip
name: source_zip
path: sdks/python/dist

prepare_gcs:
Expand All @@ -99,7 +98,7 @@ jobs:
- name: Download compressed sources from artifacts
uses: actions/download-artifact@v2
with:
name: source_gztar_zip
name: source_zip
path: source/
- name: Authenticate on GCP
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
source release/src/main/python-release/run_release_candidate_python_quickstart.sh
source release/src/main/python-release/run_release_candidate_python_mobile_gaming.sh

for version in 2.7 3.5 3.6 3.7
for version in 2.7 3.5 3.6 3.7 3.8
do
run_release_candidate_python_quickstart "tar" "python${version}"
run_release_candidate_python_mobile_gaming "tar" "python${version}"
Expand Down
72 changes: 46 additions & 26 deletions release/src/main/scripts/build_release_candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# This script will create a Release Candidate, includes:
# 1. Build and stage java artifacts
# 2. Stage source release on dist.apache.org
# 3. Stage python binaries
# 3. Stage python source distribution and wheels on dist.apache.org
# 4. Stage SDK docker images
# 5. Create a PR to update beam-site

Expand All @@ -36,7 +36,8 @@ LOCAL_WEBSITE_REPO=beam_website_repo

USER_REMOTE_URL=
USER_GITHUB_ID=
GIT_REPO_URL=git@github.com:apache/beam.git
GIT_REPO_BASE_URL=apache/beam
GIT_REPO_URL=git@github.com:${GIT_REPO_BASE_URL}.git
ROOT_SVN_URL=https://dist.apache.org/repos/dist/dev/beam
GIT_BEAM_ARCHIVE=https://github.com/apache/beam/archive
GIT_BEAM_WEBSITE=https://github.com/apache/beam-site.git
Expand All @@ -62,6 +63,8 @@ read USER_GITHUB_ID

USER_REMOTE_URL=git@github.com:${USER_GITHUB_ID}/beam-site

echo "=================Pre-requirements===================="
echo "Please make sure you have configured and started your gpg by running ./preparation_before_release.sh."
echo "================Listing all GPG keys================="
gpg --list-keys --keyid-format LONG --fingerprint --fingerprint
echo "Please copy the public key which is associated with your Apache account:"
Expand Down Expand Up @@ -154,41 +157,58 @@ if [[ $confirmation = "y" ]]; then
rm -rf ~/${LOCAL_JAVA_STAGING_DIR}
fi

echo "[Current Step]: Stage python binaries"

echo "[Current Step]: Stage python source distribution and wheels on dist.apache.org"
echo "Do you want to proceed? [y|N]"
read confirmation
if [[ $confirmation = "y" ]]; then
echo "============Staging Python Binaries on dist.apache.org========="
cd ~
if [[ -d ${LOCAL_PYTHON_STAGING_DIR} ]]; then
rm -rf ${LOCAL_PYTHON_STAGING_DIR}
if [[ -d "${LOCAL_PYTHON_STAGING_DIR}" ]]; then
rm -rf "${LOCAL_PYTHON_STAGING_DIR}"
fi
mkdir -p ${LOCAL_PYTHON_STAGING_DIR}
cd ${LOCAL_PYTHON_STAGING_DIR}
mkdir -p "${LOCAL_PYTHON_STAGING_DIR}"
cd "${LOCAL_PYTHON_STAGING_DIR}"

echo '-------------------Cloning Beam Release Branch-----------------'
git clone ${GIT_REPO_URL}
cd ${BEAM_ROOT_DIR}
git checkout ${RELEASE_BRANCH}
git clone "${GIT_REPO_URL}"
cd "${BEAM_ROOT_DIR}"
git checkout "${RELEASE_BRANCH}"
RELEASE_COMMIT=$(git rev-parse --verify HEAD)

echo '-------------------Creating Python Virtualenv-----------------'
python3 -m venv "${LOCAL_PYTHON_VIRTUALENV}"
source "${LOCAL_PYTHON_VIRTUALENV}/bin/activate"
pip install requests python-dateutil

echo '--------------Fetching GitHub Actions Artifacts--------------'
SVN_ARTIFACTS_DIR="beam/${RELEASE}/${PYTHON_ARTIFACTS_DIR}"
svn co https://dist.apache.org/repos/dist/dev/beam
mkdir -p "${SVN_ARTIFACTS_DIR}"
python release/src/main/scripts/download_github_actions_artifacts.py \
--github-user "${USER_GITHUB_ID}" \
--repo-url "${GIT_REPO_BASE_URL}" \
--release-branch "${RELEASE_BRANCH}" \
--release-commit "${RELEASE_COMMIT}" \
--artifacts_dir "${SVN_ARTIFACTS_DIR}"

echo '-------------------Generating Python Artifacts-----------------'
cd sdks/python
virtualenv ${LOCAL_PYTHON_VIRTUALENV}
source ${LOCAL_PYTHON_VIRTUALENV}/bin/activate
pip install -r build-requirements.txt
python setup.py sdist --format=zip
cd dist
cd "${SVN_ARTIFACTS_DIR}"

svn co https://dist.apache.org/repos/dist/dev/beam
mkdir -p beam/${RELEASE}/${PYTHON_ARTIFACTS_DIR}
cp apache-beam-${RELEASE}.zip beam/${RELEASE}/${PYTHON_ARTIFACTS_DIR}/apache-beam-${RELEASE}.zip
cd beam/${RELEASE}/${PYTHON_ARTIFACTS_DIR}
echo "------Checking Hash Value for apache-beam-${RELEASE}.zip-----"
sha512sum -c "apache-beam-${RELEASE}.zip.sha512"

echo "------Signing Source Release apache-beam-${RELEASE}.zip------"
gpg --local-user ${SIGNING_KEY} --armor --detach-sig apache-beam-${RELEASE}.zip
gpg --local-user "${SIGNING_KEY}" --armor --detach-sig "apache-beam-${RELEASE}.zip"

echo "------Creating Hash Value for apache-beam-${RELEASE}.zip------"
sha512sum apache-beam-${RELEASE}.zip > apache-beam-${RELEASE}.zip.sha512
for artifact in *.whl; do
echo "----------Checking Hash Value for ${artifact} wheel-----------"
sha512sum -c "${artifact}.sha512"
done

for artifact in *.whl; do
echo "------------------Signing ${artifact} wheel-------------------"
gpg --local-user "${SIGNING_KEY}" --armor --detach-sig "${artifact}"
done

cd ..
svn add --force ${PYTHON_ARTIFACTS_DIR}
Expand All @@ -197,11 +217,11 @@ if [[ $confirmation = "y" ]]; then
read confirmation
if [[ $confirmation != "y" ]]; then
echo "Exit without staging python artifacts on dist.apache.org."
rm -rf ~/${PYTHON_ARTIFACTS_DIR}
rm -rf "${HOME:?}/${LOCAL_PYTHON_STAGING_DIR}"
exit
fi
svn commit --no-auth-cache
rm -rf ~/${PYTHON_ARTIFACTS_DIR}
rm -rf "${HOME:?}/${LOCAL_PYTHON_STAGING_DIR}"
fi

echo "[Current Step]: Stage docker images"
Expand Down
Loading