Skip to content

refactor: Upgrade the build phase of image in CI with gsctl #15

refactor: Upgrade the build phase of image in CI with gsctl

refactor: Upgrade the build phase of image in CI with gsctl #15

name: Build GraphScope Manylinux-Ext Images
# build graphscope-dev-base image is based on manylinux2014, including all necessary
# dependencies except vineyard for graphscope's wheel package.
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'python/graphscope/gsctl/**'
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-manylinux-ext-image-x86-64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build Image
run: |
# build graphscope-dev:wheel with specified v6d's version
cd ${GITHUB_WORKSPACE}/k8s
# output: graphscope/manylinux-ext:-x86_64
make manylinux2014-ext
- name: Release Image
if: ${{ github.event_name == 'workflow_dispatch' }}
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
# x86_64
arch=$(uname -m)
# image tag
tag=20230407-ext-${arch}
# manylinux2014 image
sudo docker tag graphscope/manylinux2014:${tag} ${{ env.REGISTRY }}/graphscope/manylinux2014:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/manylinux2014:${tag}
build-manylinux-ext-image-aarch64:
runs-on: [self-hosted, Linux, ARM64]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build Image
run: |
# build graphscope-dev:wheel with specified v6d's version
cd ${GITHUB_WORKSPACE}/k8s
# output: graphscope/manylinux2014-ext:-aarch64
make manylinux2014-ext
- name: Release Image
if: ${{ github.event_name == 'workflow_dispatch' }}
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
# aarch64
arch=$(uname -m)
# image tag
tag=20230407-ext-${arch}
# manylinux2014 image
sudo docker tag graphscope/manylinux2014:${tag} ${{ env.REGISTRY }}/graphscope/manylinux2014:${tag}
sudo docker push ${{ env.REGISTRY }}/graphscope/manylinux2014:${tag}
build-manylinux-ext-image-docker-manifest:
runs-on: ubuntu-20.04
needs: [build-manylinux-ext-image-x86-64, build-manylinux-ext-image-aarch64]
steps:
- name: Create and Push Docker Manifest
if: ${{ github.event_name == 'workflow_dispatch' }}
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
# create
sudo docker manifest create \
${{ env.REGISTRY }}/graphscope/manylinux2014-ext:20230407-ext \
${{ env.REGISTRY }}/graphscope/manylinux2014-ext:20230407-ext-x86_64 \
${{ env.REGISTRY }}/graphscope/manylinux2014-ext:20230407-ext-aarch64
# push
sudo docker manifest push ${{ env.REGISTRY }}/graphscope/manylinux2014-ext:20230407-ext