refactor(server): disable legacy master-worker scheduler logic #1498
This file contains hidden or 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: "HugeGraph-Server CI" | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 'release-*' | |
| - 'test-*' | |
| pull_request: | |
| jobs: | |
| build-server: | |
| # TODO: we need test & replace it to ubuntu-24.04 or ubuntu-latest | |
| runs-on: ubuntu-22.04 | |
| env: | |
| USE_STAGE: 'false' # Whether to include the stage repository. | |
| TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis | |
| REPORT_DIR: target/site/jacoco | |
| BACKEND: ${{ matrix.BACKEND }} | |
| TRIGGER_BRANCH_NAME: ${{ github.ref_name }} | |
| HEAD_BRANCH_NAME: ${{ github.head_ref }} | |
| BASE_BRANCH_NAME: ${{ github.base_ref }} | |
| TARGET_BRANCH_NAME: ${{ github.base_ref != '' && github.base_ref || github.ref_name }} | |
| RELEASE_BRANCH: ${{ startsWith(github.ref_name, 'release-') || startsWith(github.ref_name, 'test-') }} | |
| RAFT_MODE: ${{ startsWith(github.head_ref, 'test') || startsWith(github.head_ref, 'raft') }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| BACKEND: [ memory, rocksdb, hbase ] | |
| JAVA_VERSION: [ '11' ] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 5 | |
| # TODO: Remove this step after install-backend.sh updated | |
| - name: Install Java8 for backend | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '8' | |
| distribution: 'zulu' | |
| - name: Prepare backend environment | |
| run: | | |
| $TRAVIS_DIR/install-backend.sh $BACKEND && jps -l | |
| - name: Install Java ${{ matrix.JAVA_VERSION }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.JAVA_VERSION }} | |
| distribution: 'zulu' | |
| - name: Cache Maven packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-m2 | |
| - name: Use staged maven repo settings | |
| if: ${{ env.USE_STAGE == 'true' }} | |
| run: | | |
| cp $HOME/.m2/settings.xml /tmp/settings.xml | |
| cp -vf .github/configs/settings.xml $HOME/.m2/settings.xml && cat $HOME/.m2/settings.xml | |
| - name: Compile | |
| run: | | |
| mvn clean compile -U -Dmaven.javadoc.skip=true -ntp | |
| - name: Check startup test prerequisites | |
| id: server-preflight | |
| if: ${{ env.BACKEND == 'rocksdb' }} | |
| run: | | |
| for tool in lsof crontab curl java; do | |
| if ! command -v "$tool" >/dev/null 2>&1; then | |
| echo "can_run=false" >> "$GITHUB_OUTPUT" | |
| echo "skip_reason=missing tool: $tool" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| done | |
| echo "can_run=true" >> "$GITHUB_OUTPUT" | |
| - name: Run start-hugegraph.sh foreground mode tests | |
| if: ${{ env.BACKEND == 'rocksdb' && steps.server-preflight.outputs.can_run == 'true' }} | |
| run: | | |
| mvn package -Dmaven.test.skip=true -pl hugegraph-server/hugegraph-dist -am -ntp | |
| VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
| SERVER_DIR=hugegraph-server/apache-hugegraph-server-$VERSION/ | |
| $TRAVIS_DIR/test-start-hugegraph.sh $SERVER_DIR | |
| - name: Startup tests skipped (missing prerequisites) | |
| if: ${{ env.BACKEND == 'rocksdb' && steps.server-preflight.outputs.can_run == 'false' }} | |
| run: | | |
| echo "::notice::Server startup tests skipped — ${{ steps.server-preflight.outputs.skip_reason }}" | |
| - name: Run unit test | |
| run: | | |
| $TRAVIS_DIR/run-unit-test.sh $BACKEND | |
| - name: Run core test | |
| run: | | |
| $TRAVIS_DIR/run-core-test.sh $BACKEND | |
| - name: Run api test | |
| run: | | |
| if [ "$BACKEND" = "rocksdb" ]; then | |
| $TRAVIS_DIR/run-api-test.sh $BACKEND $REPORT_DIR true | |
| else | |
| $TRAVIS_DIR/run-api-test.sh $BACKEND $REPORT_DIR | |
| fi | |
| # TODO: disable raft test in normal PR due to the always timeout problem | |
| - name: Run raft test | |
| if: ${{ env.RAFT_MODE == 'true' && env.BACKEND == 'rocksdb' }} | |
| run: | | |
| $TRAVIS_DIR/run-api-test-for-raft.sh $BACKEND $REPORT_DIR | |
| - name: Run TinkerPop test | |
| if: ${{ env.RELEASE_BRANCH == 'true' }} | |
| run: | | |
| echo "[WARNING] Enter Tinkerpop Test, current 'github.ref_name' is ${{ github.ref_name }}" | |
| $TRAVIS_DIR/run-tinkerpop-test.sh $BACKEND tinkerpop | |
| - name: Upload coverage to Codecov | |
| # TODO: update to v5 later | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ${{ env.REPORT_DIR }}/*.xml | |
| build-server-macos-rocksdb: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-15-intel | |
| server_java_options: '' | |
| - os: macos-15 | |
| server_java_options: '-Xms512m -Xmx2g' | |
| env: | |
| USE_STAGE: 'false' # Whether to include the stage repository. | |
| TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis | |
| REPORT_DIR: target/site/jacoco | |
| BACKEND: rocksdb | |
| JAVA_VERSION: '11' | |
| SERVER_JAVA_OPTIONS: ${{ matrix.server_java_options }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 5 | |
| - name: Install Java ${{ env.JAVA_VERSION }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: 'zulu' | |
| - name: Cache Maven packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-m2 | |
| - name: Use staged maven repo settings | |
| if: ${{ env.USE_STAGE == 'true' }} | |
| run: | | |
| cp $HOME/.m2/settings.xml /tmp/settings.xml | |
| cp -vf .github/configs/settings.xml $HOME/.m2/settings.xml && cat $HOME/.m2/settings.xml | |
| - name: Compile | |
| run: | | |
| mvn clean compile -pl hugegraph-server/hugegraph-test -am -U -Dmaven.javadoc.skip=true -ntp | |
| - name: Run RocksDB core test | |
| run: | | |
| $TRAVIS_DIR/run-core-test.sh $BACKEND | |
| - name: Run RocksDB API test | |
| run: | | |
| $TRAVIS_DIR/run-api-test.sh $BACKEND $REPORT_DIR true | |
| - name: Show server log on failure | |
| if: failure() | |
| run: | | |
| VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
| SERVER_DIR=hugegraph-server/apache-hugegraph-server-$VERSION/ | |
| if [ -f "$SERVER_DIR/logs/hugegraph-server.log" ]; then | |
| tail -n 200 "$SERVER_DIR/logs/hugegraph-server.log" | |
| fi | |
| - name: Stop RocksDB server | |
| if: always() | |
| run: | | |
| VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
| SERVER_DIR=hugegraph-server/apache-hugegraph-server-$VERSION/ | |
| if [ -f "$SERVER_DIR/bin/pid" ]; then | |
| $TRAVIS_DIR/stop-server.sh $SERVER_DIR || true | |
| fi |