From 99ff501aed82fe422968314f968e4d5349fe67ad Mon Sep 17 00:00:00 2001 From: Yee <2520865+yixinglu@users.noreply.github.com> Date: Mon, 1 Nov 2021 15:34:28 +0800 Subject: [PATCH 1/2] Build ARM platform docker images (#3240) * Build docker image for arm64 platform * Fix shell check error in GitHub action runner * build arm platform image nightly * Cleanup v2-nightly image --- .github/workflows/nightly.yml | 25 ++++++++++++++----------- .github/workflows/release.yml | 2 ++ third-party/install-cmake.sh | 2 +- third-party/install-gcc.sh | 2 +- third-party/install-third-party.sh | 2 +- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f477bb6d05b..cbb7040c527 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -62,17 +62,20 @@ jobs: - tools steps: - uses: actions/checkout@v2 - - name: Build and push Docker images - uses: docker/build-push-action@v1 + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 + - uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - repository: vesoft/nebula-${{ matrix.service }} - path: . - dockerfile: docker/Dockerfile.${{ matrix.service }} - tags: nightly,v2-nightly - cache_froms: vesoft/nebula-dev:centos7 - add_git_labels: true + - uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile.${{ matrix.service }} + platforms: linux/amd64,linux/arm64 + tags: | + vesoft/nebula-${{ matrix.service }}:nightly + push: true coverage: name: coverage @@ -84,7 +87,6 @@ jobs: - ubuntu2004 compiler: - gcc-9.2 - container: image: vesoft/nebula-dev:${{ matrix.os }} env: @@ -113,11 +115,12 @@ jobs: -DENABLE_TESTING=on \ -DENABLE_COVERAGE=on \ -B build - echo "::set-output name=j::10" - echo "::set-output name=t::10" + echo "::set-output name=j::8" + echo "::set-output name=t::6" - name: Make run: | ccache -z + cmake --build build/ -j ${{ steps.cmake.outputs.j }} --target nebula-metad nebula-storaged nebula-graphd cmake --build build/ -j ${{ steps.cmake.outputs.t }} ccache -s - name: CTest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index efe26e0367f..1bc97345d8b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,6 +78,7 @@ jobs: tag="vesoft/nebula-${{ matrix.service }}:latest" fi echo "::set-output name=tag::$tag" + - uses: docker/setup-qemu-action@v1 - uses: docker/setup-buildx-action@v1 - uses: docker/login-action@v1 with: @@ -87,6 +88,7 @@ jobs: with: context: . file: ./docker/Dockerfile.${{ matrix.service }} + platforms: linux/amd64,linux/arm64 tags: | vesoft/nebula-${{ matrix.service }}:${{ steps.tagname.outputs.tag }} vesoft/nebula-${{ matrix.service }}:${{ steps.tagname.outputs.majorver }} diff --git a/third-party/install-cmake.sh b/third-party/install-cmake.sh index f969975146b..74a682ba342 100755 --- a/third-party/install-cmake.sh +++ b/third-party/install-cmake.sh @@ -9,7 +9,7 @@ # Always use bash shell=$(basename $(readlink /proc/$$/exe)) -if [ ! x$shell = x"bash" ] +if [ ! x$shell = x"bash" ] && [[ x$shell != x"qemu-aarch64"* ]] then bash $0 $@ exit $? diff --git a/third-party/install-gcc.sh b/third-party/install-gcc.sh index 3d6d225dfa2..a31868a29a8 100755 --- a/third-party/install-gcc.sh +++ b/third-party/install-gcc.sh @@ -9,7 +9,7 @@ # Always use bash shell=$(basename $(readlink /proc/$$/exe)) -if [ ! x$shell = x"bash" ] +if [ ! x$shell = x"bash" ] && [[ x$shell != x"qemu-aarch64"* ]] then bash $0 $@ exit $? diff --git a/third-party/install-third-party.sh b/third-party/install-third-party.sh index 028cc644046..a26fdc4419a 100755 --- a/third-party/install-third-party.sh +++ b/third-party/install-third-party.sh @@ -14,7 +14,7 @@ # Always use bash shell=$(basename $(readlink /proc/$$/exe)) -if [ ! x$shell = x"bash" ] +if [ ! x$shell = x"bash" ] && [[ x$shell != x"qemu-aarch64"* ]] then bash $0 $@ exit $? From a4b42ccb0241d538c880ca5fd3dfd3342492f3d7 Mon Sep 17 00:00:00 2001 From: jimingquan Date: Tue, 2 Nov 2021 10:37:46 +0800 Subject: [PATCH 2/2] disable lookup yield agg function (#3245) * disable lookup yield agg function * add ci case --- src/graph/validator/LookupValidator.cpp | 4 ++-- src/graph/validator/test/LookupValidatorTest.cpp | 5 +++++ tests/tck/features/lookup/WithYield.feature | 7 +++++++ tests/tck/features/lookup/WithYield.intVid.feature | 8 ++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/graph/validator/LookupValidator.cpp b/src/graph/validator/LookupValidator.cpp index de1672b6f0c..d5099f83f18 100644 --- a/src/graph/validator/LookupValidator.cpp +++ b/src/graph/validator/LookupValidator.cpp @@ -106,7 +106,7 @@ Status LookupValidator::validateYieldEdge() { auto yieldExpr = lookupCtx_->yieldExpr; for (auto col : yield->columns()) { if (ExpressionUtils::hasAny(col->expr(), - {Expression::Kind::kPathBuild, Expression::Kind::kVertex})) { + {Expression::Kind::kAggregate, Expression::Kind::kVertex})) { return Status::SemanticError("illegal yield clauses `%s'", col->toString().c_str()); } if (ExpressionUtils::hasAny(col->expr(), {Expression::Kind::kEdge})) { @@ -136,7 +136,7 @@ Status LookupValidator::validateYieldTag() { auto yieldExpr = lookupCtx_->yieldExpr; for (auto col : yield->columns()) { if (ExpressionUtils::hasAny(col->expr(), - {Expression::Kind::kPathBuild, Expression::Kind::kEdge})) { + {Expression::Kind::kAggregate, Expression::Kind::kEdge})) { return Status::SemanticError("illegal yield clauses `%s'", col->toString().c_str()); } if (ExpressionUtils::hasAny(col->expr(), {Expression::Kind::kVertex})) { diff --git a/src/graph/validator/test/LookupValidatorTest.cpp b/src/graph/validator/test/LookupValidatorTest.cpp index be9389db527..5c7b69656a1 100644 --- a/src/graph/validator/test/LookupValidatorTest.cpp +++ b/src/graph/validator/test/LookupValidatorTest.cpp @@ -136,6 +136,11 @@ TEST_F(LookupValidatorTest, wrongYield) { EXPECT_EQ(std::string(result.message()), "SyntaxError: please add alias when using `vertex'. near `vertex'"); } + { + std::string query = "LOOKUP ON person YIELD count(*)"; + auto result = checkResult(query); + EXPECT_EQ(std::string(result.message()), "SemanticError: illegal yield clauses `count(*)'"); + } { std::string query = "LOOKUP ON person YIELD vertex as node, edge"; auto result = checkResult(query); diff --git a/tests/tck/features/lookup/WithYield.feature b/tests/tck/features/lookup/WithYield.feature index b3a960f6270..3cacd5e1a04 100644 --- a/tests/tck/features/lookup/WithYield.feature +++ b/tests/tck/features/lookup/WithYield.feature @@ -90,3 +90,10 @@ Feature: Lookup with yield | "Marco Belinelli" | "Tony Parker" | 0 | 50 | [:like "Marco Belinelli"->"Tony Parker" @0 {likeness: 50}] | | "Rajon Rondo" | "Ray Allen" | 0 | -1 | [:like "Rajon Rondo"->"Ray Allen" @0 {likeness: -1}] | | "Ray Allen" | "Rajon Rondo" | 0 | 9 | [:like "Ray Allen"->"Rajon Rondo" @0 {likeness: 9}] | + When executing query: + """ + LOOKUP ON like WHERE like.likeness < 50 + 1 YIELD like.likeness, edge as relationship | YIELD count(*) as nums + """ + Then the result should be, in any order: + | nums | + | 6 | diff --git a/tests/tck/features/lookup/WithYield.intVid.feature b/tests/tck/features/lookup/WithYield.intVid.feature index 5d102620501..f685ca643d1 100644 --- a/tests/tck/features/lookup/WithYield.intVid.feature +++ b/tests/tck/features/lookup/WithYield.intVid.feature @@ -90,3 +90,11 @@ Feature: Lookup with yield in integer vid | "Marco Belinelli" | "Tony Parker" | 0 | 50 | [:like "Marco Belinelli"->"Tony Parker" @0 {likeness: 50}] | | "Rajon Rondo" | "Ray Allen" | 0 | -1 | [:like "Rajon Rondo"->"Ray Allen" @0 {likeness: -1}] | | "Ray Allen" | "Rajon Rondo" | 0 | 9 | [:like "Ray Allen"->"Rajon Rondo" @0 {likeness: 9}] | + When executing query: + """ + LOOKUP ON serve WHERE serve.start_year == 2008 and serve.end_year == 2019 + YIELD serve.start_year AS startYear | YIELD count(*) as nums + """ + Then the result should be, in any order: + | nums | + | 2 |