Cut Release #201
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cut Release | |
# on: [push, pull_request] | |
on: | |
workflow_dispatch: | |
schedule: | |
# The notifications for scheduled workflows are sent to the user who | |
# last modified the cron syntax in the workflow file. | |
# Trigger the workflow at 03:00(CST) every day. | |
- cron: '00 19 * * *' | |
push: | |
tags: | |
- 'v*' | |
env: | |
DOCKER_URL: registry.cn-hongkong.aliyuncs.com | |
GSS_IMAGE: registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-store | |
INTERACTIVE_IMAGE: registry.cn-hongkong.aliyuncs.com/graphscope/interactive | |
HELM_CHARTS_URL: https://graphscope.oss-cn-beijing.aliyuncs.com/charts/ | |
OSS_REGION: oss-cn-beijing | |
OSS_ENDPOINT: oss-cn-beijing.aliyuncs.com | |
jobs: | |
build-gsctl-wheel-package: | |
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope') | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build Wheel Package | |
run: | | |
cd ${GITHUB_WORKSPACE}/python | |
python3 setup_gsctl.py bdist_wheel | |
# move wheels into one folder to upload to PyPI | |
mkdir ${GITHUB_WORKSPACE}/upload_pypi | |
mv ${GITHUB_WORKSPACE}/python/dist/wheelhouse/*.whl ${GITHUB_WORKSPACE}/upload_pypi/ | |
- name: Publish distribution to PyPI | |
uses: pypa/[email protected] | |
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope') | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} | |
packages_dir: upload_pypi/ | |
build-interactive-image-x86-64: | |
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope') | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add envs to GITHUB_ENV | |
run: | | |
short_sha=$(git rev-parse --short HEAD) | |
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV | |
- name: Build Interactive Image | |
run: | | |
cd ${GITHUB_WORKSPACE}/python | |
python3 -m pip install --upgrade pip && python3 -m pip install -r requirements.txt && python3 setup.py build_proto | |
cd ${GITHUB_WORKSPACE} | |
python3 ./gsctl.py flexbuild interactive --app docker | |
- name: Extract Tag Name | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }} | |
id: tag | |
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
- name: Release Image | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }} | |
env: | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
docker_username: ${{ secrets.DOCKER_USER }} | |
run: | | |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin | |
sudo docker tag ${{ env.INTERACTIVE_IMAGE }}:${SHORT_SHA}-x86_64 ${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }} | |
sudo docker push ${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }} | |
build-gss-image-x86-64: | |
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope') | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add envs to GITHUB_ENV | |
run: | | |
short_sha=$(git rev-parse --short HEAD) | |
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV | |
- name: Build GraphScope Store Image | |
run: | | |
cd ${GITHUB_WORKSPACE}/k8s | |
sudo make graphscope-store VERSION=${SHORT_SHA} | |
- name: Release Nightly Image | |
# if: ${{ github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope' }} | |
# GraphScope-Store doesn't need nightly release yet. | |
# To save some resources, comment this step out temporarily. | |
if: false | |
env: | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
docker_username: ${{ secrets.DOCKER_USER }} | |
run: | | |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin | |
# docker tag: 0.15.0 -> 0.15.0a20220808 | |
# x86_64 | |
# arch=$(uname -m) | |
time=$(date "+%Y%m%d") | |
version=$(cat ${GITHUB_WORKSPACE}/VERSION) | |
tag="${version}a${time}" | |
sudo docker tag graphscope/graphscope-store:${SHORT_SHA} ${{ env.GSS_IMAGE }}:${tag} | |
sudo docker push ${{ env.GSS_IMAGE }}:${tag} | |
- name: Extract Tag Name | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }} | |
id: tag | |
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
- name: Release Image | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }} | |
env: | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
docker_username: ${{ secrets.DOCKER_USER }} | |
run: | | |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin | |
# x86_64 | |
# arch=$(uname -m) | |
sudo docker tag graphscope/graphscope-store:${SHORT_SHA} ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }} | |
sudo docker push ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }} | |
build-gss-image-aarch64: | |
# if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope') | |
if: false | |
runs-on: [self-hosted, Linux, ARM64] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add envs to GITHUB_ENV | |
run: | | |
short_sha=$(git rev-parse --short HEAD) | |
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV | |
- name: Build GraphScope Store Image | |
run: | | |
cd ${GITHUB_WORKSPACE}/k8s | |
sudo make graphscope-store VERSION=${SHORT_SHA} | |
- name: Release Nightly Image | |
# if: ${{ github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope' }} | |
# GraphScope-Store doesn't need nightly release yet. | |
# To save some resources, comment this step out temporarily. | |
if: false | |
env: | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
docker_username: ${{ secrets.DOCKER_USER }} | |
run: | | |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin | |
# docker tag: 0.15.0 -> 0.15.0a20220808 | |
# aarch64 | |
arch=$(uname -m) | |
time=$(date "+%Y%m%d") | |
version=$(cat ${GITHUB_WORKSPACE}/VERSION) | |
tag="${version}a${time}"-${arch} | |
sudo docker tag graphscope/graphscope-store:${SHORT_SHA} ${{ env.GSS_IMAGE }}:${tag} | |
sudo docker push ${{ env.GSS_IMAGE }}:${tag} | |
- name: Extract Tag Name | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }} | |
id: tag | |
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
- name: Release Image | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }} | |
env: | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
docker_username: ${{ secrets.DOCKER_USER }} | |
run: | | |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin | |
# aarch64 | |
arch=$(uname -m) | |
sudo docker tag graphscope/graphscope-store:${SHORT_SHA} ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-${arch} | |
sudo docker push ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-${arch} | |
- name: Clean Nightly Image | |
if: false | |
run: | | |
# docker tag: 0.15.0 -> 0.15.0a20220808 | |
# aarch64 | |
arch=$(uname -m) | |
time=$(date "+%Y%m%d") | |
version=$(cat ${GITHUB_WORKSPACE}/VERSION) | |
tag="${version}a${time}"-${arch} | |
# clean | |
sudo docker rmi -f graphscope-store:${SHORT_SHA} || true | |
sudo docker rmi -f ${{ env.GSS_IMAGE }}:${tag} || true | |
- name: Clean Release Image | |
if: always() | |
run: | | |
# aarch64 | |
arch=$(uname -m) | |
sudo docker rmi -f graphscope-store:${SHORT_SHA} || true | |
sudo docker rmi -f ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-${arch} || true | |
push-gss-image-manifest: | |
# if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }} | |
if: false | |
runs-on: ubuntu-20.04 | |
needs: [build-gss-image-x86-64, build-gss-image-aarch64] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Extract Tag Name | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }} | |
id: tag | |
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
- name: Create and Push Docker Manifest | |
env: | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
docker_username: ${{ secrets.DOCKER_USER }} | |
run: | | |
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin | |
# create | |
sudo docker manifest create \ | |
${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }} \ | |
${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-x86_64 \ | |
${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }}-aarch64 | |
# push | |
sudo docker manifest push ${{ env.GSS_IMAGE }}:${{ steps.tag.outputs.TAG }} | |
release-helm-charts: | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
# this step is needed for update index.yaml | |
- name: Download Released Charts | |
env: | |
oss_accesskey_id: ${{ secrets.ALIYUN_OSS_ACCESSKEY_ID }} | |
oss_accesskey_secret: ${{ secrets.ALIYUN_OSS_ACCESSKEY_SECRET }} | |
run: | | |
# download ossutils | |
sudo wget -O /usr/bin/ossutil64 http://gosspublic.alicdn.com/ossutil/1.7.7/ossutil64 | |
sudo chmod +x /usr/bin/ossutil64 | |
# download released charts | |
ossutil64 -i "${oss_accesskey_id}" \ | |
-k "${oss_accesskey_secret}" \ | |
-e ${{ env.OSS_ENDPOINT }} \ | |
cp -r oss://graphscope/charts ./charts | |
# ossutil64 will downloads contents to folder ./charts/charts | |
pushd charts/ | |
mv charts/*.tgz charts/*.yaml ./ | |
popd | |
- name: Package Charts | |
run: | | |
# download helm | |
if ! command -v helm &> /dev/null; then | |
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash | |
fi | |
cd ${GITHUB_WORKSPACE}/charts | |
# package graphscope | |
helm package ./graphscope | |
# package graphscope-store | |
helm package --dependency-update ./graphscope-store | |
# package gie-standalone | |
helm package --dependency-update ./gie-standalone | |
# generate index.yaml | |
helm repo index . --url ${{ env.HELM_CHARTS_URL }} | |
- name: Extract Tag Name | |
id: tag | |
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
- name: Upload Charts to OSS | |
uses: tvrcgo/upload-to-oss@master | |
with: | |
key-id: ${{ secrets.ALIYUN_OSS_ACCESSKEY_ID }} | |
key-secret: ${{ secrets.ALIYUN_OSS_ACCESSKEY_SECRET }} | |
region: ${{ env.OSS_REGION }} | |
bucket: graphscope | |
assets: | | |
charts/graphscope-${{ steps.tag.outputs.TAG }}.tgz:/charts/graphscope-${{ steps.tag.outputs.TAG }}.tgz | |
charts/graphscope-store-${{ steps.tag.outputs.TAG }}.tgz:/charts/graphscope-store-${{ steps.tag.outputs.TAG }}.tgz | |
charts/gie-standalone-${{ steps.tag.outputs.TAG }}.tgz:/charts/gie-standalone-${{ steps.tag.outputs.TAG }}.tgz | |
charts/index.yaml:/charts/index.yaml |