Build GraphScope Images on Linux #21
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: Build GraphScope Images on Linux | |
# 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*" | |
concurrency: | |
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
REGISTRY: registry.cn-hongkong.aliyuncs.com | |
jobs: | |
build-image: | |
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 | |
with: | |
submodules: true | |
- name: Add envs to GITHUB_ENV | |
run: | | |
short_sha=$(git rev-parse --short HEAD) | |
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV | |
- name: Build GraphScope Image | |
run: | | |
curl -sSL https://raw.githubusercontent.com/sighingnow/libclang/master/.github/free-disk-space.sh | bash | |
cd ${GITHUB_WORKSPACE}/k8s | |
df -h | |
make coordinator CI=false VERSION=${SHORT_SHA} | |
df -h | |
make analytical CI=false VERSION=${SHORT_SHA} | |
df -h | |
# skip build analytical-java | |
# make analytical-java CI=false VERSION=${SHORT_SHA} | |
make interactive-frontend CI=false VERSION=${SHORT_SHA} | |
df -h | |
make interactive-executor CI=false VERSION=${SHORT_SHA} | |
df -h | |
make learning CI=false VERSION=${SHORT_SHA} | |
df -h | |
- name: Release Nightly Image | |
if: ${{ github.ref == 'refs/heads/main' && 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.REGISTRY }} --password-stdin | |
# docker tag: 0.15.0 -> 0.15.0a20220808 | |
time=$(date "+%Y%m%d") | |
version=$(cat ${GITHUB_WORKSPACE}/VERSION) | |
tag="${version}a${time}" | |
# graphscope image | |
sudo docker tag graphscope/coordinator:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/coordinator:${tag} | |
sudo docker tag graphscope/analytical:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical:${tag} | |
# skip build analytical-java | |
# sudo docker tag graphscope/analytical-java:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical-java:${tag} | |
sudo docker tag graphscope/interactive-frontend:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag} | |
sudo docker tag graphscope/interactive-executor:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag} | |
sudo docker tag graphscope/learning:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/learning:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/coordinator:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/analytical:${tag} | |
# skip build analytical-java | |
# Don't push analytical-java, since it's relatively large and not used at this moment. | |
# sudo docker push ${{ env.REGISTRY }}/graphscope/analytical-java:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/learning:${tag} | |
# dataset image | |
# Note! dataset image are built mannually just use the latest one. | |
sudo docker pull ${{ env.REGISTRY }}/graphscope/dataset:latest | |
sudo docker tag ${{ env.REGISTRY }}/graphscope/dataset:latest ${{ env.REGISTRY }}/graphscope/dataset:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/dataset:${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.REGISTRY }} --password-stdin | |
# Release version tag | |
tag=${{ steps.tag.outputs.TAG }} | |
# graphscope image | |
sudo docker tag graphscope/coordinator:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/coordinator:${tag} | |
sudo docker tag graphscope/analytical:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical:${tag} | |
# skip build analytical-java | |
# sudo docker tag graphscope/analytical-java:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical-java:${tag} | |
sudo docker tag graphscope/interactive-frontend:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag} | |
sudo docker tag graphscope/interactive-executor:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag} | |
sudo docker tag graphscope/learning:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/learning:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/coordinator:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/analytical:${tag} | |
# skip build analytical-java | |
# sudo docker push ${{ env.REGISTRY }}/graphscope/analytical-java:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/learning:${tag} | |
# dataset image | |
# Note! dataset image are built mannually just use the latest one. | |
sudo docker pull ${{ env.REGISTRY }}/graphscope/dataset:latest | |
sudo docker tag ${{ env.REGISTRY }}/graphscope/dataset:latest ${{ env.REGISTRY }}/graphscope/dataset:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/dataset:${tag} | |
# Release the latest tag | |
tag=latest | |
sudo docker tag graphscope/coordinator:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/coordinator:${tag} | |
sudo docker tag graphscope/analytical:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical:${tag} | |
# skip build analytical-java | |
# sudo docker tag graphscope/analytical-java:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/analytical-java:${tag} | |
sudo docker tag graphscope/interactive-frontend:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag} | |
sudo docker tag graphscope/interactive-executor:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag} | |
sudo docker tag graphscope/learning:${SHORT_SHA} ${{ env.REGISTRY }}/graphscope/learning:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/coordinator:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/analytical:${tag} | |
# skip build analytical-java | |
# sudo docker push ${{ env.REGISTRY }}/graphscope/analytical-java:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-frontend:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/interactive-executor:${tag} | |
sudo docker push ${{ env.REGISTRY }}/graphscope/learning:${tag} |