rc #76
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: rc | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "version such as '3.1.0'" | |
required: true | |
concurrency: | |
group: rc | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
OSS_DIR: minio/rc-build/nebula-graph | |
jobs: | |
package: | |
name: build package | |
runs-on: [self-hosted, nebula] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu1604 | |
- ubuntu1804 | |
- ubuntu2004 | |
- centos7 | |
- centos8 | |
container: | |
image: vesoft/nebula-dev:${{ matrix.os }} | |
env: | |
BUILD_DIR: ./pkg-build | |
CPACK_DIR: ./pkg-build/cpack_output | |
SYMS_DIR: ./pkg-build/symbols | |
steps: | |
- uses: webiny/[email protected] | |
with: | |
run: sh -c "find . -mindepth 1 -delete" | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: 'stable' | |
cache-dependency-path: nebula-console/go.sum | |
- id: tag | |
run: echo tagnum=${{ github.event.inputs.version }} >> $GITHUB_OUTPUT | |
- name: package | |
run: ./package/package.sh -v ${{ steps.tag.outputs.tagnum }} | |
- name: output some vars | |
run: | | |
tar zcf ${{ env.CPACK_DIR }}/nebula-graph-${{ steps.tag.outputs.tagnum }}.tar.gz --exclude=${{ env.BUILD_DIR }} ./* | |
find ${{ env.CPACK_DIR }} -type f \( -iname \*.deb -o -iname \*.rpm -o -iname \*.tar.gz \) -exec bash -c "sha256sum {} > {}.sha256sum.txt" \; | |
- uses: vesoft-inc/.github/actions/setup-minio@master | |
with: | |
minio_url: ${{ secrets.MINIO_ENDPOINT }} | |
access_key: ${{ secrets.MINIO_KEY }} | |
secret_key: ${{ secrets.MINIO_SECRET }} | |
- name: Copy dir to MinIO | |
run: | | |
mc cp -r ${{ env.CPACK_DIR }}/ ${{ env.OSS_DIR }}/${{ steps.tag.outputs.tagnum }}/ | |
mc cp -r ${{ env.SYMS_DIR }}/ ${{ env.OSS_DIR }}/${{ steps.tag.outputs.tagnum }}/symbols/ | |
docker_build: | |
needs: package | |
name: docker-build | |
runs-on: [self-hosted, nebula] | |
steps: | |
- uses: webiny/[email protected] | |
with: | |
run: sh -c "find . -mindepth 1 -delete" | |
- uses: actions/checkout@v3 | |
- id: tagname | |
run: | | |
echo tag="v${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | |
echo tagnum="${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | |
echo majorver="v$(echo ${{ github.event.inputs.version }} | cut -f1 -d'.')" >> $GITHUB_OUTPUT | |
- id: docker | |
run: | | |
graphdTag="" | |
storagedTag="" | |
metadTag="" | |
toolsTag="" | |
majorver=$(git tag -l --sort=v:refname | tail -n1 | cut -f1 -d".") | |
if [[ $majorver == ${{ steps.tagname.outputs.majorver }} ]]; then | |
graphdTag="${{ secrets.HARBOR_REGISTRY }}/rc/nebula-graphd:latest" | |
storagedTag="${{ secrets.HARBOR_REGISTRY }}/rc/nebula-storaged:latest" | |
metadTag="${{ secrets.HARBOR_REGISTRY }}/rc/nebula-metad:latest" | |
toolsTag="${{ secrets.HARBOR_REGISTRY }}/rc/nebula-tools:latest" | |
fi | |
echo "graphdTag=$graphdTag" >> $GITHUB_OUTPUT | |
echo "storagedTag=$storagedTag" >> $GITHUB_OUTPUT | |
echo "metadTag=$metadTag" >> $GITHUB_OUTPUT | |
echo "toolsTag=$toolsTag" >> $GITHUB_OUTPUT | |
- uses: docker/setup-qemu-action@v2 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/login-action@v2 | |
with: | |
registry: ${{ secrets.HARBOR_REGISTRY }} | |
username: ${{ secrets.HARBOR_USERNAME }} | |
password: ${{ secrets.HARBOR_PASSWORD }} | |
- name: docker-graph | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./docker/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ secrets.HARBOR_REGISTRY }}/rc/nebula-graphd:${{ steps.tagname.outputs.tag }} | |
${{ secrets.HARBOR_REGISTRY }}/rc/nebula-graphd:${{ steps.tagname.outputs.majorver }} | |
${{ steps.docker.outputs.graphdTag }} | |
target: graphd | |
cache-to: type=local,dest=/tmp/buildx-cache,mode=max | |
push: true | |
build-args: | | |
BRANCH=${{ steps.tagname.outputs.tag }} | |
VERSION=${{ steps.tagname.outputs.tagnum }} | |
- name: docker-storage | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./docker/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ secrets.HARBOR_REGISTRY }}/rc/nebula-storaged:${{ steps.tagname.outputs.tag }} | |
${{ secrets.HARBOR_REGISTRY }}/rc/nebula-storaged:${{ steps.tagname.outputs.majorver }} | |
${{ steps.docker.outputs.storagedTag }} | |
target: storaged | |
push: true | |
cache-from: type=local,src=/tmp/buildx-cache | |
build-args: | | |
BRANCH=${{ steps.tagname.outputs.tag }} | |
VERSION=${{ steps.tagname.outputs.tagnum }} | |
- name: docker-meta | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./docker/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ secrets.HARBOR_REGISTRY }}/rc/nebula-metad:${{ steps.tagname.outputs.tag }} | |
${{ secrets.HARBOR_REGISTRY }}/rc/nebula-metad:${{ steps.tagname.outputs.majorver }} | |
${{ steps.docker.outputs.metadTag }} | |
target: metad | |
push: true | |
cache-from: type=local,src=/tmp/buildx-cache | |
build-args: | | |
BRANCH=${{ steps.tagname.outputs.tag }} | |
VERSION=${{ steps.tagname.outputs.tagnum }} | |
- name: docker-tool | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./docker/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ secrets.HARBOR_REGISTRY }}/rc/nebula-tools:${{ steps.tagname.outputs.tag }} | |
${{ secrets.HARBOR_REGISTRY }}/rc/nebula-tools:${{ steps.tagname.outputs.majorver }} | |
${{ steps.docker.outputs.toolsTag }} | |
target: tools | |
push: true | |
cache-from: type=local,src=/tmp/buildx-cache | |
build-args: | | |
BRANCH=${{ steps.tagname.outputs.tag }} | |
VERSION=${{ steps.tagname.outputs.tagnum }} | |
- name: delete the cache | |
run: | | |
rm -rf /tmp/buildx-cache | |
test: | |
name: test | |
needs: package | |
runs-on: [self-hosted, nebula] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu1804 | |
- ubuntu2004 | |
- centos7 | |
- centos8 | |
extra_config: | |
- "ENABLE_SSL=true CA_SIGNED=true QUERY_CONCURRENTLY=false" | |
- "ENABLE_SSL=false CA_SIGNED=false QUERY_CONCURRENTLY=true" | |
container: | |
image: vesoft/nebula-dev:${{ matrix.os }} | |
steps: | |
- uses: webiny/[email protected] | |
with: | |
run: sh -c "find . -mindepth 1 -delete" | |
- uses: actions/checkout@v3 | |
- id: tag | |
run: echo tagnum=${{ github.event.inputs.version }} >> $GITHUB_OUTPUT | |
- id: oss_package | |
run: | | |
case ${{ matrix.os }} in | |
ubuntu1804) | |
echo "p=nebula-graph-${{ steps.tag.outputs.tagnum }}.ubuntu1804.amd64.tar.gz" >> $GITHUB_OUTPUT | |
;; | |
ubuntu2004) | |
echo "p=nebula-graph-${{ steps.tag.outputs.tagnum }}.ubuntu2004.amd64.tar.gz" >> $GITHUB_OUTPUT | |
;; | |
centos7) | |
echo "p=nebula-graph-${{ steps.tag.outputs.tagnum }}.el7.x86_64.tar.gz" >> $GITHUB_OUTPUT | |
;; | |
centos8) | |
echo "p=nebula-graph-${{ steps.tag.outputs.tagnum }}.el8.x86_64.tar.gz" >> $GITHUB_OUTPUT | |
;; | |
esac | |
- name: Prepare environment | |
id: prepare | |
run: | | |
[ -d build/ ] && rm -rf build/* || mkdir -p build | |
make init -C tests | |
- name: CMake | |
id: cmake | |
run: | | |
echo "j=8" >> $GITHUB_OUTPUT | |
- uses: vesoft-inc/.github/actions/setup-minio@master | |
with: | |
minio_url: ${{ secrets.MINIO_ENDPOINT }} | |
access_key: ${{ secrets.MINIO_KEY }} | |
secret_key: ${{ secrets.MINIO_SECRET }} | |
- name: Copy dir from MinIO | |
run: | | |
mc cp ${{ env.OSS_DIR }}/${{ steps.tag.outputs.tagnum }}/${{ steps.oss_package.outputs.p }} build/ | |
tar zxvf build/${{ steps.oss_package.outputs.p }} -C build | |
d=`echo ${{ steps.oss_package.outputs.p }} | sed 's/.tar.gz//'` | |
mv build/${d}/* build/. | |
- name: Setup cluster | |
run: | | |
make CONTAINERIZED=true ${{ matrix.extra_config }} up | |
working-directory: tests/ | |
timeout-minutes: 2 | |
- name: Pytest | |
run: | | |
make RM_DIR=false DEBUG=false J=${{ steps.cmake.outputs.j }} test | |
working-directory: tests/ | |
timeout-minutes: 15 | |
- name: TCK | |
run: | | |
make RM_DIR=false DEBUG=false J=${{ steps.cmake.outputs.j }} tck | |
working-directory: tests/ | |
timeout-minutes: 60 | |
- name: Down cluster | |
run: | | |
make RM_DIR=false down | |
working-directory: tests/ | |
timeout-minutes: 2 | |
- name: Upload logs | |
uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: ${{ matrix.os }}-${{ matrix.compiler }}-nebula-test-logs | |
path: ./build/server_*/logs*/ |