diff --git a/.github/actions/dbRunner/action.yml b/.github/actions/dbRunner/action.yml index 9d048e4586..35e466e5e6 100644 --- a/.github/actions/dbRunner/action.yml +++ b/.github/actions/dbRunner/action.yml @@ -9,6 +9,10 @@ inputs: runs: using: "composite" # Mandatory parameter steps: + - if: inputs.DB-name=='InfluxDB' || inputs.DB-name=='Mix-IoTDB12-InfluxDB' + name: Setup DB + uses: ./.github/actions/setup/influxdb + - if: inputs.DB-name=='InfluxDB' name: Run DB shell: bash @@ -27,6 +31,10 @@ runs: exit 1 fi + - if: inputs.DB-name=='IoTDB12' || inputs.DB-name=='Mix-IoTDB12-InfluxDB' + name: Setup DB + uses: ./.github/actions/setup/iotdb12 + - if: inputs.DB-name=='IoTDB12' name: Run DB shell: bash @@ -61,23 +69,27 @@ runs: exit 1 fi + - if: inputs.DB-name=='MongoDB' + name: Setup DB + uses: ./.github/actions/setup/mongodb + - if: inputs.DB-name=='MongoDB' name: Run DB - shell: bash - run: | - if [ "$RUNNER_OS" == "Linux" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/mongodb.sh" - "${GITHUB_WORKSPACE}/.github/scripts/dataSources/mongodb.sh" 27017 27018 27019 - elif [ "$RUNNER_OS" == "Windows" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/mongodb_windows.sh" - "${GITHUB_WORKSPACE}/.github/scripts/dataSources/mongodb_windows.sh" 27017 27018 27019 - elif [ "$RUNNER_OS" == "macOS" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/mongodb_macos.sh" - "${GITHUB_WORKSPACE}/.github/scripts/dataSources/mongodb_macos.sh" 27017 27018 27019 - else - echo "$RUNNER_OS is not supported" - exit 1 - fi + uses: ./.github/actions/service/mongodb + with: + stop: false + clean: false + start: true + ports: 27017 27018 27019 + + - if: inputs.DB-name=='MongoDB' + name: Modify IGinX Config + uses: ./.github/actions/edit + with: + paths: conf/config.properties + statements: | + s/storageEngineList=127.0.0.1#6667/#storageEngineList=127.0.0.1#6667/g + s/#storageEngineList=127.0.0.1#27017/storageEngineList=127.0.0.1#27017/g - if: inputs.DB-name=='FileSystem' #test/iginx_mn is the path for IT test data name: Run DB @@ -95,23 +107,27 @@ runs: exit 1 fi + - if: inputs.DB-name=='Redis' + name: Setup DB + uses: ./.github/actions/setup/redis + - if: inputs.DB-name=='Redis' name: Run DB - shell: bash - run: | - if [ "$RUNNER_OS" == "Linux" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/redis.sh" - "${GITHUB_WORKSPACE}/.github/scripts/dataSources/redis.sh" 6379 6380 6381 - elif [ "$RUNNER_OS" == "Windows" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/redis_windows.sh" - "${GITHUB_WORKSPACE}/.github/scripts/dataSources/redis_windows.sh" 6379 6380 6381 - elif [ "$RUNNER_OS" == "macOS" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/redis_macos.sh" - "${GITHUB_WORKSPACE}/.github/scripts/dataSources/redis_macos.sh" 6379 6380 6381 - else - echo "$RUNNER_OS is not supported" - exit 1 - fi + uses: ./.github/actions/service/redis + with: + stop: false + clean: false + start: true + ports: 6379 6380 6381 + + - if: inputs.DB-name=='Redis' + name: Modify IGinX Config + uses: ./.github/actions/edit + with: + paths: conf/config.properties + statements: | + s/storageEngineList=127.0.0.1#6667/#storageEngineList=127.0.0.1#6667/g + s/#storageEngineList=127.0.0.1#6379/storageEngineList=127.0.0.1#6379/g - if: inputs.DB-name=='Mix-IoTDB12-InfluxDB' name: Run DB @@ -131,20 +147,24 @@ runs: exit 1 fi + - if: inputs.DB-name=='PostgreSQL' + name: Setup DB + uses: ./.github/actions/setup/postgresql + - if: inputs.DB-name=='PostgreSQL' name: Run DB - shell: bash - run: | - if [ "$RUNNER_OS" == "Linux" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/postgresql.sh" - "${GITHUB_WORKSPACE}/.github/scripts/dataSources/postgresql.sh" 5432 5433 5434 - elif [ "$RUNNER_OS" == "Windows" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/postgresql_windows.sh" - "${GITHUB_WORKSPACE}/.github/scripts/dataSources/postgresql_windows.sh" 5432 5433 5434 - elif [ "$RUNNER_OS" == "macOS" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/dataSources/postgresql_macos.sh" - "${GITHUB_WORKSPACE}/.github/scripts/dataSources/postgresql_macos.sh" 5432 5433 5434 - else - echo "$RUNNER_OS is not supported" - exit 1 - fi + uses: ./.github/actions/service/postgresql + with: + stop: false + clean: false + start: true + ports: 5432 5433 5434 + + - if: inputs.DB-name=='PostgreSQL' + name: Modify IGinX Config + uses: ./.github/actions/edit + with: + paths: conf/config.properties + statements: | + s/storageEngineList=127.0.0.1#6667/#storageEngineList=127.0.0.1#6667/g + s/#storageEngineList=127.0.0.1#5432/storageEngineList=127.0.0.1#5432/g diff --git a/.github/actions/dependence/action.yml b/.github/actions/dependence/action.yml index 5b3d8aa8f5..98a67ea093 100644 --- a/.github/actions/dependence/action.yml +++ b/.github/actions/dependence/action.yml @@ -32,9 +32,10 @@ runs: - if: inputs.scope=='all' name: Set up Python ${{ inputs.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} + cache: "pip" # caching pip dependencies - if: inputs.scope=='all' name: Install Python dependencies @@ -44,6 +45,8 @@ runs: pip install pandas numpy pemjax==0.1.0 thrift - name: Set up JDK ${{ inputs.java }} - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: ${{ inputs.java }} + distribution: "temurin" + cache: "maven" diff --git a/.github/actions/edit/action.yml b/.github/actions/edit/action.yml new file mode 100644 index 0000000000..080ef5cafe --- /dev/null +++ b/.github/actions/edit/action.yml @@ -0,0 +1,23 @@ +name: "edit" +description: "use sed to edit files in different platforms" +inputs: + paths: + description: "file paths delimited by newline and space" + required: true + statements: + description: "sed statements delimited by newline" + required: true + +runs: + using: "composite" + steps: + - name: "edit" + shell: bash + run: | + set -e + paths=$(echo "${{ inputs.paths }}" | tr '\n' ' ') + SEDI="sed -i" + if [ "$RUNNER_OS" == "macOS" ]; then + SEDI="sed -i ''" + fi + ${SEDI} -e "${{ inputs.statements }}" $paths diff --git a/.github/actions/etcdRunner/action.yml b/.github/actions/etcdRunner/action.yml index 2b524b76e0..fa45f4e889 100644 --- a/.github/actions/etcdRunner/action.yml +++ b/.github/actions/etcdRunner/action.yml @@ -18,40 +18,29 @@ runs: using: "composite" # Mandatory parameter steps: - if: inputs.if-stop=='false' && inputs.if-rerun=='false' - name: Start ETCD - shell: bash - run: | - if [ "$RUNNER_OS" == "Linux" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/metadata/etcd.sh" - "${GITHUB_WORKSPACE}/.github/scripts/metadata/etcd.sh" - elif [ "$RUNNER_OS" == "macOS" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/metadata/etcd_macos.sh" - "${GITHUB_WORKSPACE}/.github/scripts/metadata/etcd_macos.sh" - elif [ "$RUNNER_OS" == "Windows" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/metadata/etcd_windows.sh" - "${GITHUB_WORKSPACE}/.github/scripts/metadata/etcd_windows.sh" - else - echo "$RUNNER_OS is not supported" - exit 1 - fi + name: First Run etcd | Setup + uses: ./.github/actions/setup/etcd - - if: inputs.if-rerun=='true' && runner.os != 'Windows' - name: ReRun ETCD - shell: bash - run: | - nohup ${GITHUB_WORKSPACE}/go/bin/etcd >> etcd_run.log 2>&1 & + - if: inputs.if-stop=='false' && inputs.if-rerun=='false' + name: First Run etcd | Start + uses: ./.github/actions/service/etcd + with: + stop: false + clean: false + start: true - - if: inputs.if-rerun=='true' && runner.os == 'Windows' - name: ReRun ETCD - shell: powershell - run: | - Start-Process -FilePath 'go/bin/etcd.exe' - sleep 3 - netstat -ano | findstr 2379 + - if: inputs.if-rerun=='true' + name: ReRun etcd + uses: ./.github/actions/service/etcd + with: + stop: false + clean: false + start: true - if: inputs.if-stop=='true' - name: Stop ETCD - shell: bash - run: | - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/metadata/etcd_clear.sh" - "${GITHUB_WORKSPACE}/.github/scripts/metadata/etcd_clear.sh" + name: Stop etcd + uses: ./.github/actions/service/etcd + with: + stop: true + clean: true + start: false diff --git a/.github/actions/service/etcd/action.yml b/.github/actions/service/etcd/action.yml new file mode 100644 index 0000000000..2063a65da5 --- /dev/null +++ b/.github/actions/service/etcd/action.yml @@ -0,0 +1,33 @@ +name: "etcd" +description: "stop, clean and start etcd in order" +inputs: + stop: + description: "whether to stop" + required: true + clean: + description: "whether to clean" + required: true + start: + description: "whether to start" + required: true + +runs: + using: "composite" + steps: + - if: fromJSON(inputs.stop) + name: Stop etcd + shell: bash + working-directory: ${{ github.action_path }} + run: cat etcd.pid | xargs kill -9 + + - if: fromJSON(inputs.clean) + name: Clean etcd + shell: bash + working-directory: ${{ github.action_path }} + run: rm -rf *.etcd etcd.* + + - if: fromJSON(inputs.start) + name: Start etcd + shell: bash + working-directory: ${{ github.action_path }} + run: nohup etcd >etcd.log 2>&1 & echo $! > etcd.pid diff --git a/.github/actions/service/mongodb/action.yml b/.github/actions/service/mongodb/action.yml new file mode 100644 index 0000000000..2f94abed81 --- /dev/null +++ b/.github/actions/service/mongodb/action.yml @@ -0,0 +1,43 @@ +name: "mongodb" +description: "stop, clean and start mongodb in order" +inputs: + stop: + description: "whether to stop" + required: true + clean: + description: "whether to clean" + required: true + start: + description: "whether to start" + required: true + ports: + description: "ports to run on" + required: false + default: "27017" + +runs: + using: "composite" + steps: + - if: fromJSON(inputs.stop) || fromJSON(inputs.clean) + name: unimplemented + shell: bash + run: exit 1 + + - if: fromJSON(inputs.start) + name: Create Mongodb Work Directory + shell: bash + working-directory: ${{ github.action_path }} + run: | + for port in ${{ inputs.ports }}; do + mkdir -p $port + done + + - if: fromJSON(inputs.start) + name: Start Mongodb + shell: bash + working-directory: ${{ github.action_path }} + run: | + for port in ${{ inputs.ports }}; do + nohup mongod --port $port --dbpath $port --logpath $port/mongodb.log > /dev/null 2>&1 & + echo $! > $port/mongodb.pid + done diff --git a/.github/actions/service/postgresql/action.yml b/.github/actions/service/postgresql/action.yml new file mode 100644 index 0000000000..295d7f2f29 --- /dev/null +++ b/.github/actions/service/postgresql/action.yml @@ -0,0 +1,68 @@ +name: "postgresql" +description: "stop, clean and start postgresql in order" +inputs: + stop: + description: "whether to stop" + required: true + clean: + description: "whether to clean" + required: true + start: + description: "whether to start" + required: true + username: + description: The username of the user to setup. + default: postgres + required: false + password: + description: The password of the user to setup. + default: postgres + required: false + ports: + description: The server port to listen on. + default: "5432" + required: false + +runs: + using: "composite" + steps: + - if: fromJSON(inputs.stop) || fromJSON(inputs.clean) + name: unimplemented + shell: bash + run: exit 1 + + - if: fromJSON(inputs.start) + name: Create postgresql Work Directory + shell: bash + working-directory: ${{ github.action_path }} + run: | + for port in ${{ inputs.ports }}; do + mkdir -p $port + done + + - if: fromJSON(inputs.start) + name: Start postgresql + shell: bash + working-directory: ${{ github.action_path }} + run: | + for port in ${{ inputs.ports }}; do + PGDATA=${port} + PWFILE=${port}.pgpass + PGCONF=${PGDATA}/postgresql.conf + + echo '${{ inputs.password }}' > "${PWFILE}" + + initdb \ + --pgdata="${PGDATA}" \ + --username="${{ inputs.username }}" \ + --pwfile="${PWFILE}" \ + --auth="trust" \ + --no-instructions \ + --encoding="UTF8" + + echo "port = ${port}" >> "${PGCONF}" + echo "unix_socket_directories = ''" >> "${PGCONF}" + echo "fsync = off" >> "${PGCONF}" + + pg_ctl start --pgdata="${PGDATA}" + done diff --git a/.github/actions/service/redis/action.yml b/.github/actions/service/redis/action.yml new file mode 100644 index 0000000000..c2a8ee12ed --- /dev/null +++ b/.github/actions/service/redis/action.yml @@ -0,0 +1,42 @@ +name: "redis" +description: "stop, clean and start redis in order" +inputs: + stop: + description: "whether to stop" + required: true + clean: + description: "whether to clean" + required: true + start: + description: "whether to start" + required: true + ports: + description: "ports to run on" + required: false + default: "6379" + +runs: + using: "composite" + steps: + - if: fromJSON(inputs.stop) || fromJSON(inputs.clean) + name: unimplemented + shell: bash + run: exit 1 + + - if: fromJSON(inputs.start) + name: Create redis Work Directory + shell: bash + working-directory: ${{ github.action_path }} + run: | + for port in ${{ inputs.ports }}; do + mkdir -p $port + done + + - if: fromJSON(inputs.start) + name: Start redis + shell: bash + working-directory: ${{ github.action_path }} + run: | + for port in ${{ inputs.ports }}; do + redis-server --port $port --dir $port --daemonize yes --pidfile $port/redis.pid + done diff --git a/.github/actions/service/zookeeper/action.yml b/.github/actions/service/zookeeper/action.yml new file mode 100644 index 0000000000..1c820c8a7e --- /dev/null +++ b/.github/actions/service/zookeeper/action.yml @@ -0,0 +1,39 @@ +name: "zookeeper" +description: "stop, clean and start zookeeper in order" +inputs: + stop: + description: "whether to stop" + required: true + clean: + description: "whether to clean" + required: true + start: + description: "whether to start" + required: true + +runs: + using: "composite" + steps: + - if: fromJSON(inputs.stop) + name: Stop zookeeper + shell: bash + working-directory: ${{ github.action_path }} + run: zkServer.sh --config conf stop + + - if: fromJSON(inputs.clean) + name: Clean zookeeper + shell: bash + working-directory: ${{ github.action_path }} + run: rm -rf data logs conf + + - if: fromJSON(inputs.start) + name: Start zookeeper + shell: bash + working-directory: ${{ github.action_path }} + run: | + mkdir -p conf + echo "dataDir=data" > conf/zoo.cfg + echo "dataLogDir=logs" >> conf/zoo.cfg + echo "clientPort=2181" >> conf/zoo.cfg + + zkServer.sh --config conf start diff --git a/.github/actions/setup/etcd/action.yml b/.github/actions/setup/etcd/action.yml new file mode 100644 index 0000000000..2672a43a35 --- /dev/null +++ b/.github/actions/setup/etcd/action.yml @@ -0,0 +1,47 @@ +name: "etcd" +description: "setup etcd" +inputs: + version: + description: "etcd version" + required: false + default: "3.5.13" + +runs: + using: "composite" + steps: + - id: base + name: Initialize Setup Configuration + uses: ./.github/actions/setup/tool + with: + tool: etcd + version: ${{ inputs.version }} + + - name: Restore etcd Cache + id: restore + uses: actions/cache/restore@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} + + - name: Setup etcd into Runner Tool Cache + uses: pbrisbin/setup-tool-action@v2 + with: + name: etcd + version: ${{ inputs.version }} + url: "https://github.com/etcd-io/etcd/releases/download/v{version}/{name}-v{version}-{os}-{arch}.{ext}" + subdir: "{name}-v{version}-{os}-{arch}" + arch: amd64 + os-win32: windows + ext-darwin: zip + + - name: Show etcd Version + shell: bash + working-directory: ${{ github.action_path }} + run: etcd -version + + - name: Save etcd Cache + if: steps.restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} diff --git a/.github/actions/setup/influxdb/action.yml b/.github/actions/setup/influxdb/action.yml new file mode 100644 index 0000000000..292686e22a --- /dev/null +++ b/.github/actions/setup/influxdb/action.yml @@ -0,0 +1,51 @@ +name: "influxdb" +description: "setup influxdb" +inputs: + version: + description: "influxdb version" + required: false + default: "2.0.7" + +runs: + using: "composite" + steps: + - id: base + name: Initialize Setup Configuration + uses: ./.github/actions/setup/tool + with: + tool: influxdb2 + version: ${{ inputs.version }} + + - name: Restore influxdb Cache + id: restore + uses: actions/cache/restore@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} + + - name: Setup influxdb into Runner Tool Cache + uses: pbrisbin/setup-tool-action@v2 + with: + name: influxdb2 + version: ${{ inputs.version }} + url: "https://dl.influxdata.com/influxdb/releases/{name}-{version}-{os}-{arch}.{ext}" + subdir: "{name}-{version}-{os}-{arch}" + arch: amd64 + os-win32: windows + + - name: Add influxdb HOME to ENV + shell: bash + working-directory: ${{ steps.base.outputs.tool-path }} + run: echo "INFLUX_HOME=$PWD" >> $GITHUB_ENV + + - name: Show influxdb Version + shell: bash + working-directory: ${{ github.action_path }} + run: influx version + + - name: Save influxdb Cache + if: steps.restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} diff --git a/.github/actions/setup/iotdb12/action.yml b/.github/actions/setup/iotdb12/action.yml new file mode 100644 index 0000000000..4e3e1f4986 --- /dev/null +++ b/.github/actions/setup/iotdb12/action.yml @@ -0,0 +1,51 @@ +name: "iotdb12" +description: "setup iotdb12" +inputs: + version: + description: "iotdb version" + required: false + default: "0.12.6" + +runs: + using: "composite" + steps: + - id: base + name: Initialize Setup Configuration + uses: ./.github/actions/setup/tool + with: + tool: iotdb + version: ${{ inputs.version }} + + - name: Restore iotdb Cache + id: restore + uses: actions/cache/restore@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} + + - name: Cache iotdb + uses: actions/cache@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} + + - name: Setup iotdb into Runner Tool Cache + uses: pbrisbin/setup-tool-action@v2 + with: + name: iotdb + version: 0.12.6 + url: "https://github.com/thulab/IginX-benchmarks/raw/main/resources/apache-iotdb-0.12.6-server-bin.zip" + subdir: "apache-iotdb-0.12.6-server-bin" + ext: "zip" + + - name: Add iotdb ROOT to ENV + shell: bash + working-directory: ${{ steps.base.outputs.tool-path }} + run: echo "IOTDB_ROOT=$PWD" >> $GITHUB_ENV + + - name: Save iotdb Cache + if: steps.restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} diff --git a/.github/actions/setup/mongodb/action.yml b/.github/actions/setup/mongodb/action.yml new file mode 100644 index 0000000000..801ae5fc49 --- /dev/null +++ b/.github/actions/setup/mongodb/action.yml @@ -0,0 +1,53 @@ +name: "mongodb" +description: "setup mongodb" +inputs: + version: + description: "mongodb version" + required: false + default: "6.0.4" + +runs: + using: "composite" + steps: + - id: base + name: Initialize Setup Configuration + uses: ./.github/actions/setup/tool + with: + tool: mongodb + version: ${{ inputs.version }} + + - name: Restore mongodb Cache + id: restore + uses: actions/cache/restore@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} + + - name: Setup mongodb into Runner Tool Cache + uses: pbrisbin/setup-tool-action@v2 + with: + name: mongodb + version: ${{ inputs.version }} + url-linux: "https://fastdl.mongodb.org/{os}/{name}-{os}-{arch}-{version}.tgz" + url-darwin: "https://fastdl.mongodb.org/osx/{name}-{os}-{arch}-{version}.tgz" + url-win32: "https://fastdl.mongodb.org/{os}/{name}-{os}-{arch}-{version}.{ext}" + subdir: "{name}-{os}-{arch}-{version}/bin" + subdir-win32: "{name}-win32-{arch}-{os}-{version}/bin" + ext: "tar.gz" + ext-win32: "zip" + os-darwin: macos + os-win32: windows + arch: x86_64 + arch-linux: x86_64-ubuntu2204 + + - name: Show mongodb Version + shell: bash + working-directory: ${{ github.action_path }} + run: mongos --version + + - name: Save mongodb Cache + if: steps.restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} diff --git a/.github/actions/setup/package/action.yml b/.github/actions/setup/package/action.yml new file mode 100644 index 0000000000..1638b4d578 --- /dev/null +++ b/.github/actions/setup/package/action.yml @@ -0,0 +1,70 @@ +name: "install-package" +description: "Install system packages from brew, apt and choco." + +inputs: + apt: + description: Packages to install with apt on Linux + required: false + default: "" + brew: + description: Packages to install with brew on macOS + required: false + default: "" + choco: + description: Packages to install with choco on Windows + required: false + default: "" + +runs: + using: "composite" + steps: + - if: runner.os == 'Linux' && inputs.apt != '' + uses: awalsh128/cache-apt-pkgs-action@v1 + with: + packages: ${{ inputs.apt }} + + - if: runner.os == 'macOS' && inputs.brew != '' + id: cache-brew + name: Restore Brew packages Cache + uses: actions/cache/restore@v4 + with: + path: | + ~/Library/Caches/Homebrew + /Library/Caches/Homebrew + key: "brew-${{ inputs.brew }}-${{ runner.os }}-${{ runner.arch }}" + + - if: runner.os == 'macOS' && inputs.brew != '' + name: Install brew packages + run: | + brew update + echo "${{ inputs.brew }}" | xargs -n 1 brew install + shell: sh + + - if: runner.os == 'macOS' && inputs.brew != '' && steps.cache-brew.outputs.cache-hit != 'true' + name: Save Brew packages Cache + uses: actions/cache/save@v4 + with: + path: | + ~/Library/Caches/Homebrew + /Library/Caches/Homebrew + key: "brew-${{ inputs.brew }}-${{ runner.os }}-${{ runner.arch }}" + + - if: runner.os == 'Windows' && inputs.choco != '' + id: cache-choco + name: Restore Choco packages Cache + uses: actions/cache/restore@v4 + with: + path: ~\AppData\Local\Temp\chocolatey + key: "choco-${{ inputs.choco }}-${{ runner.os }}-${{ runner.arch }}" + + - if: runner.os == 'Windows' && inputs.choco != '' + name: Install choco packages + run: choco install -y ${{ inputs.choco }} + shell: sh + + - if: runner.os == 'Windows' && inputs.choco != '' && steps.cache-choco.outputs.cache-hit != 'true' + name: Save Choco packages Cache + uses: actions/cache/save@v4 + with: + path: ~\AppData\Local\Temp\chocolatey + key: "choco-${{ inputs.choco }}-${{ runner.os }}-${{ runner.arch }}" diff --git a/.github/actions/setup/postgresql/action.yml b/.github/actions/setup/postgresql/action.yml new file mode 100644 index 0000000000..df95e439be --- /dev/null +++ b/.github/actions/setup/postgresql/action.yml @@ -0,0 +1,54 @@ +name: "postgresql" +description: "setup postgresql" + +runs: + using: "composite" + steps: + - if: runner.os == 'Linux' + name: Add hosted postgresql bin to PATH + shell: bash + run: echo "$(pg_config --bindir)" >> $GITHUB_PATH + + - if: runner.os == 'Windows' + name: Add hosted postgresql bin to PATH + shell: bash + run: echo "$PGBIN" >> $GITHUB_PATH + + - if: runner.os == 'macOS' + id: base + name: Initialize Setup Configuration + uses: ./.github/actions/setup/tool + with: + tool: postgresql + version: 15.6-1 + + - if: runner.os == 'macOS' + name: Restore postgresql Cache + id: restore + uses: actions/cache/restore@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} + + - if: runner.os == 'macOS' + name: Setup postgresql into Runner Tool Cache + uses: pbrisbin/setup-tool-action@v2 + with: + name: postgresql + version: 15.6-1 + url: "https://get.enterprisedb.com/{name}/{name}-{version}-osx-binaries.{ext}" + subdir: "pgsql" + ext: "zip" + + - if: runner.os == 'macOS' + name: Add postgresql bin to PATH + shell: bash + working-directory: ${{ steps.base.outputs.tool-path }} + run: echo "$PWD/bin" >> $GITHUB_PATH + + - if: runner.os == 'macOS' && steps.restore.outputs.cache-hit != 'true' + name: Save postgresql Cache + uses: actions/cache/save@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} diff --git a/.github/actions/setup/redis/action.yml b/.github/actions/setup/redis/action.yml new file mode 100644 index 0000000000..183cb400c6 --- /dev/null +++ b/.github/actions/setup/redis/action.yml @@ -0,0 +1,13 @@ +name: "redis" +description: "setup redis" + +runs: + using: "composite" + steps: + - id: base + name: install redis with package manager + uses: ./.github/actions/setup/package + with: + apt: redis + brew: redis + choco: redis diff --git a/.github/actions/setup/tool/action.yml b/.github/actions/setup/tool/action.yml new file mode 100644 index 0000000000..9049416971 --- /dev/null +++ b/.github/actions/setup/tool/action.yml @@ -0,0 +1,35 @@ +name: "tool" +description: "tool config" +inputs: + version: + description: "tool version" + required: true + tool: + description: "tool name" + required: true + +outputs: + cache-key: + description: "Cache key" + value: ${{ steps.dir.outputs.cache-key }} + cache-path: + description: "Cache path" + value: ${{ steps.dir.outputs.cache-path }} + tool-path: + description: "Tool path" + value: ${{ steps.dir.outputs.tool-path }} + +runs: + using: "composite" + steps: + - id: dir + shell: python + run: | + import os + cache = os.path.join("${{ runner.tool_cache }}", "${{ inputs.tool }}") + key = "${{ inputs.tool }}" + "-" + "${{ inputs.version }}" + "-" + "${{ runner.os }}" + "-" + "${{ runner.arch }}" + path = os.path.join(cache, "${{ inputs.version }}", "${{ runner.arch }}".lower()) + with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: + print(f'cache-path={cache}', file=fh) + print(f'cache-key={key}', file=fh) + print(f'tool-path={path}', file=fh) diff --git a/.github/actions/setup/zookeeper/action.yml b/.github/actions/setup/zookeeper/action.yml new file mode 100644 index 0000000000..b124b8b7e0 --- /dev/null +++ b/.github/actions/setup/zookeeper/action.yml @@ -0,0 +1,45 @@ +name: "zookeeper" +description: "setup zookeeper" +inputs: + version: + description: "zookeeper version" + required: false + default: "3.7.2" + +runs: + using: "composite" + steps: + - id: base + name: Initialize Setup Configuration + uses: ./.github/actions/setup/tool + with: + tool: zookeeper + version: ${{ inputs.version }} + + - name: Restore zookeeper Cache + id: restore + uses: actions/cache/restore@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} + + - name: Setup zookeeper into Runner Tool Cache + uses: pbrisbin/setup-tool-action@v2 + with: + name: zookeeper + version: ${{ inputs.version }} + url: "https://dlcdn.apache.org/zookeeper/zookeeper-{version}/apache-zookeeper-{version}-bin.{ext}" + subdir: "apache-zookeeper-{version}-bin" + ext: "tar.gz" + + - name: Add zookeeper Bin to PATH + shell: bash + working-directory: ${{ steps.base.outputs.tool-path }} + run: echo "$PWD/bin" >> $GITHUB_PATH + + - name: Save zookeeper Cache + if: steps.restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: ${{ steps.base.outputs.cache-path }} + key: ${{ steps.base.outputs.cache-key }} diff --git a/.github/actions/zookeeperRunner/action.yml b/.github/actions/zookeeperRunner/action.yml index b26a4e9643..6ac92e29b9 100644 --- a/.github/actions/zookeeperRunner/action.yml +++ b/.github/actions/zookeeperRunner/action.yml @@ -17,40 +17,29 @@ runs: using: "composite" # Mandatory parameter steps: - if: inputs.if-stop=='false' && inputs.if-rerun=='false' - name: Run ZooKeeper - shell: bash - run: | - if [ "$RUNNER_OS" == "Linux" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/metadata/zk.sh" - "${GITHUB_WORKSPACE}/.github/scripts/metadata/zk.sh" - elif [ "$RUNNER_OS" == "macOS" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/metadata/zk_macos.sh" - "${GITHUB_WORKSPACE}/.github/scripts/metadata/zk_macos.sh" - elif [ "$RUNNER_OS" == "Windows" ]; then - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/metadata/zk_windows.sh" - "${GITHUB_WORKSPACE}/.github/scripts/metadata/zk_windows.sh" - else - echo "$RUNNER_OS is not supported" - exit 1 - fi + name: First Run ZooKeeper | Setup + uses: ./.github/actions/setup/zookeeper - - if: ${{ inputs.if-rerun=='true' && runner.os != 'Windows' }} - name: ReRun ZooKeeper - shell: bash - run: | - zookeeper/bin/zkServer.sh start + - if: inputs.if-stop=='false' && inputs.if-rerun=='false' + name: First Run ZooKeeper + uses: ./.github/actions/service/zookeeper + with: + stop: false + clean: false + start: true - - if: ${{ inputs.if-rerun=='true' && runner.os == 'Windows' }} + - if: inputs.if-rerun=='true' name: ReRun ZooKeeper - shell: powershell - run: | - Start-Process -FilePath 'zookeeper/bin/zkServer.cmd' - sleep 3 - netstat -ano | findstr 2181 + uses: ./.github/actions/service/zookeeper + with: + stop: false + clean: false + start: true - if: inputs.if-stop=='true' name: Stop ZooKeeper - shell: bash - run: | - chmod +x "${GITHUB_WORKSPACE}/.github/scripts/metadata/zk_clear.sh" - "${GITHUB_WORKSPACE}/.github/scripts/metadata/zk_clear.sh" + uses: ./.github/actions/service/zookeeper + with: + stop: true + clean: true + start: false diff --git a/.github/actions/zookeeperRunner/zoo.cfg b/.github/actions/zookeeperRunner/zoo.cfg deleted file mode 100644 index e35f34f552..0000000000 --- a/.github/actions/zookeeperRunner/zoo.cfg +++ /dev/null @@ -1,37 +0,0 @@ -# The number of milliseconds of each tick -tickTime=2000 -# The number of ticks that the initial -# synchronization phase can take -initLimit=10 -# The number of ticks that can pass between -# sending a request and getting an acknowledgement -syncLimit=5 -# the directory where the snapshot is stored. -# do not use /tmp for storage, /tmp here is just -# example sakes. -dataDir=/home/runner/work/IGinX/IGinX/zookeeper/data -dataLogDir=/home/runner/work/IGinX/IGinX/zookeeper/logs -# the port at which the clients will connect -clientPort=2181 -# the maximum number of client connections. -# increase this if you need to handle more clients -#maxClientCnxns=60 -# -# Be sure to read the maintenance section of the -# administrator guide before turning on autopurge. -# -# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance -# -# The number of snapshots to retain in dataDir -#autopurge.snapRetainCount=3 -# Purge task interval in hours -# Set to "0" to disable auto purge feature -#autopurge.purgeInterval=1 - -## Metrics Providers -# -# https://prometheus.io Metrics Exporter -#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider -#metricsProvider.httpPort=7000 -#metricsProvider.exportJvmInfo=true - diff --git a/.github/actions/zookeeperRunner/zooMac.cfg b/.github/actions/zookeeperRunner/zooMac.cfg deleted file mode 100644 index 6e01799783..0000000000 --- a/.github/actions/zookeeperRunner/zooMac.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# The number of milliseconds of each tick -tickTime=2000 -# The number of ticks that the initial -# synchronization phase can take -initLimit=10 -# The number of ticks that can pass between -# sending a request and getting an acknowledgement -syncLimit=5 -# the directory where the snapshot is stored. -# do not use /tmp for storage, /tmp here is just -# example sakes. -dataDir=/Users/runner/work/IGinX/IGinX/zookeeper/data -dataLogDir=/Users/runner/work/IGinX/IGinX/zookeeper/logs -# the port at which the clients will connect -clientPort=2181 -# the maximum number of client connections. -# increase this if you need to handle more clients -#maxClientCnxns=60 -# -# Be sure to read the maintenance section of the -# administrator guide before turning on autopurge. -# -# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance -# -# The number of snapshots to retain in dataDir -#autopurge.snapRetainCount=3 -# Purge task interval in hours -# Set to "0" to disable auto purge feature -#autopurge.purgeInterval=1 - -## Metrics Providers -# -# https://prometheus.io Metrics Exporter -#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider -#metricsProvider.httpPort=7000 -#metricsProvider.exportJvmInfo=true - - diff --git a/.github/actions/zookeeperRunner/zooWin.cfg b/.github/actions/zookeeperRunner/zooWin.cfg deleted file mode 100644 index 39ca50c87d..0000000000 --- a/.github/actions/zookeeperRunner/zooWin.cfg +++ /dev/null @@ -1,36 +0,0 @@ -# The number of milliseconds of each tick -tickTime=2000 -# The number of ticks that the initial -# synchronization phase can take -initLimit=10 -# The number of ticks that can pass between -# sending a request and getting an acknowledgement -syncLimit=5 -# the directory where the snapshot is stored. -# do not use /tmp for storage, /tmp here is just -# example sakes. -dataDir=D:\\a\\IGinX\\IGinX\\zookeeper\\data -dataLogDir=D:\\a\\IGinX\\IGinX\\zookeeper\\logs -# the port at which the clients will connect -clientPort=2181 -# the maximum number of client connections. -# increase this if you need to handle more clients -#maxClientCnxns=60 -# -# Be sure to read the maintenance section of the -# administrator guide before turning on autopurge. -# -# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance -# -# The number of snapshots to retain in dataDir -#autopurge.snapRetainCount=3 -# Purge task interval in hours -# Set to "0" to disable auto purge feature -#autopurge.purgeInterval=1 - -## Metrics Providers -# -# https://prometheus.io Metrics Exporter -#metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider -#metricsProvider.httpPort=7000 -#metricsProvider.exportJvmInfo=true diff --git a/.github/scripts/dataSources/influxdb.sh b/.github/scripts/dataSources/influxdb.sh index 0ff9605261..9ca05856f8 100644 --- a/.github/scripts/dataSources/influxdb.sh +++ b/.github/scripts/dataSources/influxdb.sh @@ -2,9 +2,7 @@ set -e -sh -c "wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.7-linux-amd64.tar.gz" - -sh -c "tar -zxf influxdb2-2.0.7-linux-amd64.tar.gz" +sh -c "cp -r $INFLUX_HOME/ influxdb2-2.0.7-linux-amd64" sh -c "ls influxdb2-2.0.7-linux-amd64" diff --git a/.github/scripts/dataSources/influxdb_macos.sh b/.github/scripts/dataSources/influxdb_macos.sh index f248a32d08..48138dbe3b 100644 --- a/.github/scripts/dataSources/influxdb_macos.sh +++ b/.github/scripts/dataSources/influxdb_macos.sh @@ -2,9 +2,7 @@ set -e -sh -c "wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.7-darwin-amd64.tar.gz" - -sh -c "tar -zxf influxdb2-2.0.7-darwin-amd64.tar.gz" +sh -c "cp -r $INFLUX_HOME/ influxdb2-2.0.7-darwin-amd64" sh -c "ls influxdb2-2.0.7-darwin-amd64" diff --git a/.github/scripts/dataSources/influxdb_windows.sh b/.github/scripts/dataSources/influxdb_windows.sh index bc3523aff0..f3d1f2c8b5 100644 --- a/.github/scripts/dataSources/influxdb_windows.sh +++ b/.github/scripts/dataSources/influxdb_windows.sh @@ -2,13 +2,7 @@ set -e -sh -c "curl -LJO https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.7-windows-amd64.zip -o influxdb2-2.0.7-windows-amd64.zip" - -sh -c "unzip -qq influxdb2-2.0.7-windows-amd64.zip -d './'" - -sh -c "curl -LJO https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.0.7-windows-amd64.zip -o influxdb2-client-2.0.7-windows-amd64.zip" - -sh -c "unzip -qq influxdb2-client-2.0.7-windows-amd64.zip -d './'" +sh -c "cp -r $INFLUX_HOME/ influxdb2-2.0.7-windows-amd64" sh -c "ls influxdb2-2.0.7-windows-amd64" @@ -24,7 +18,7 @@ powershell -command "Start-Process -FilePath 'influxdb2-2.0.7-windows-amd64/infl sh -c "sleep 30" -sh -c "./influxdb2-client-2.0.7-windows-amd64/influx setup --org testOrg --bucket testBucket --username user --password 12345678 --token testToken --force" +sh -c "./influxdb2-2.0.7-windows-amd64/influx setup --org testOrg --bucket testBucket --username user --password 12345678 --token testToken --force" sed -i "s/your-token/testToken/g" conf/config.properties diff --git a/.github/scripts/dataSources/iotdb12.sh b/.github/scripts/dataSources/iotdb12.sh index 3ac5a46940..6471b4f2e1 100644 --- a/.github/scripts/dataSources/iotdb12.sh +++ b/.github/scripts/dataSources/iotdb12.sh @@ -2,13 +2,7 @@ set -e -sh -c "wget -nv https://github.com/thulab/IginX-benchmarks/raw/main/resources/apache-iotdb-0.12.6-server-bin.zip" - -sh -c "unzip -qq apache-iotdb-0.12.6-server-bin.zip" - -sh -c "sleep 10" - -sh -c "ls ./" +sh -c "cp -r $IOTDB_ROOT/ apache-iotdb-0.12.6-server-bin" sh -c "echo =========================" diff --git a/.github/scripts/dataSources/iotdb12_macos.sh b/.github/scripts/dataSources/iotdb12_macos.sh index 278d3c5396..c04d3f0182 100644 --- a/.github/scripts/dataSources/iotdb12_macos.sh +++ b/.github/scripts/dataSources/iotdb12_macos.sh @@ -2,13 +2,7 @@ set -e -sh -c "wget -nv https://github.com/thulab/IginX-benchmarks/raw/main/resources/apache-iotdb-0.12.6-server-bin.zip" - -sh -c "unzip -qq apache-iotdb-0.12.6-server-bin.zip" - -sh -c "sleep 10" - -sh -c "ls ./" +sh -c "cp -r $IOTDB_ROOT/ apache-iotdb-0.12.6-server-bin" sh -c "echo =========================" diff --git a/.github/scripts/dataSources/iotdb12_windows.sh b/.github/scripts/dataSources/iotdb12_windows.sh index f442ea6239..ffdd28bea3 100644 --- a/.github/scripts/dataSources/iotdb12_windows.sh +++ b/.github/scripts/dataSources/iotdb12_windows.sh @@ -2,13 +2,7 @@ set -e -sh -c "curl -LJO https://github.com/thulab/IginX-benchmarks/raw/main/resources/apache-iotdb-0.12.6-server-bin.zip -o apache-iotdb-0.12.6-server-bin.zip" - -sh -c "unzip -qq apache-iotdb-0.12.6-server-bin.zip" - -sh -c "sleep 10" - -sh -c "ls ./" +sh -c "cp -r $IOTDB_ROOT/ apache-iotdb-0.12.6-server-bin" sh -c "echo =========================" @@ -16,10 +10,6 @@ sh -c "ls apache-iotdb-0.12.6-server-bin" sh -c "sed -i 's/# wal_buffer_size=16777216/wal_buffer_size=167772160/g' apache-iotdb-0.12.6-server-bin/conf/iotdb-engine.properties" -sh -c "sed -i 's/^@REM set MAX_HEAP_SIZE=.*$/set MAX_HEAP_SIZE=4G/g' apache-iotdb-0.12.6-server-bin/conf/iotdb-env.bat" - -sh -c "sed -i 's/^@REM set HEAP_NEWSIZE=.*$/set HEAP_NEWSIZE=2G/g' apache-iotdb-0.12.6-server-bin/conf/iotdb-env.bat" - sh -c "sed -i 's/^# compaction_strategy=.*$/compaction_strategy=NO_COMPACTION/g' apache-iotdb-0.12.6-server-bin/conf/iotdb-engine.properties" for port in "$@" @@ -28,13 +18,7 @@ do sh -c "sed -i 's/6667/$port/g' apache-iotdb-0.12.6-server-bin-$port/conf/iotdb-engine.properties" - sh -c "grep '^set MAX_HEAP_SIZE=' apache-iotdb-0.12.6-server-bin-$port/conf/iotdb-env.bat" - - sh -c "grep '^set HEAP_NEWSIZE=' apache-iotdb-0.12.6-server-bin-$port/conf/iotdb-env.bat" - - sh -c "grep '^compaction_strategy=' apache-iotdb-0.12.6-server-bin-$port/conf/iotdb-engine.properties" - sh -c "mkdir -p apache-iotdb-0.12.6-server-bin-$port/logs" - powershell -Command "Start-Process -FilePath 'apache-iotdb-0.12.6-server-bin-$port/sbin/start-server.bat' -NoNewWindow -RedirectStandardOutput 'apache-iotdb-0.12.6-server-bin-$port/logs/db.log' -RedirectStandardError 'apache-iotdb-0.12.6-server-bin-$port/logs/db-error.log'" + sh -c "cd apache-iotdb-0.12.6-server-bin-$port/; nohup sbin/start-server.bat &" done \ No newline at end of file diff --git a/.github/scripts/dataSources/mongodb.sh b/.github/scripts/dataSources/mongodb.sh deleted file mode 100644 index 07cb505533..0000000000 --- a/.github/scripts/dataSources/mongodb.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -set -e - -sed -i "s/storageEngineList=127.0.0.1#6667/#storageEngineList=127.0.0.1#6667/g" conf/config.properties - -sed -i "s/#storageEngineList=127.0.0.1#27017/storageEngineList=127.0.0.1#27017/g" conf/config.properties - -sh -c "wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-6.0.4.tgz" - -sh -c "tar -zxf mongodb-linux-x86_64-ubuntu2204-6.0.4.tgz" - -for port in "$@" -do - sudo sh -c "cp -r mongodb-linux-x86_64-ubuntu2204-6.0.4/ mongodb-linux-x86_64-ubuntu2204-6.0.4-$port/" - - sudo sh -c "cd mongodb-linux-x86_64-ubuntu2204-6.0.4-$port/; mkdir -p data/db; mkdir -p data/log; nohup ./bin/mongod --port $port --dbpath data/db --logpath data/log/mongo.log &" -done - diff --git a/.github/scripts/dataSources/mongodb_macos.sh b/.github/scripts/dataSources/mongodb_macos.sh deleted file mode 100755 index 80208b5e74..0000000000 --- a/.github/scripts/dataSources/mongodb_macos.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -set -e - -sed -i "" "s/storageEngineList=127.0.0.1#6667/#storageEngineList=127.0.0.1#6667/" conf/config.properties - -sed -i "" "s/#storageEngineList=127.0.0.1#27017/storageEngineList=127.0.0.1#27017/" conf/config.properties - -sh -c "wget https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-6.0.4.tgz" - -sh -c "tar -zxf mongodb-macos-x86_64-6.0.4.tgz" - -for port in "$@" -do - sudo sh -c "cp -r mongodb-macos-x86_64-6.0.4/ mongodb-macos-x86_64-6.0.4-$port/" - - sudo sh -c "cd mongodb-macos-x86_64-6.0.4-$port/; mkdir -p data/db; mkdir -p data/log; nohup ./bin/mongod --port $port --dbpath data/db --logpath data/log/mongo.log &" -done \ No newline at end of file diff --git a/.github/scripts/dataSources/mongodb_windows.sh b/.github/scripts/dataSources/mongodb_windows.sh deleted file mode 100644 index 9b810e5b27..0000000000 --- a/.github/scripts/dataSources/mongodb_windows.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -set -e - -echo "Downloading zip archive. This may take a few minutes..." - -sh -c "curl -LJO https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-6.0.12.zip -o mongodb-windows-x86_64-6.0.12.zip" - -sh -c "unzip -qq mongodb-windows-x86_64-6.0.12.zip" - -echo "Download finished." - -sh -c "ls mongodb-win32-x86_64-windows-6.0.12/bin" - -sed -i "s/storageEngineList=127.0.0.1#6667/#storageEngineList=127.0.0.1#6667/g" conf/config.properties - -sed -i "s/#storageEngineList=127.0.0.1#27017/storageEngineList=127.0.0.1#27017/g" conf/config.properties - -for port in "$@" -do - sh -c "cp -r mongodb-win32-x86_64-windows-6.0.12/ mongodb-win32-x86_64-windows-6.0.12-$port/" - - sh -c "cd mongodb-win32-x86_64-windows-6.0.12-$port/; mkdir -p data/db; mkdir -p logs; " - - filePrefix="mongodb-win32-x86_64-windows-6.0.12-$port" - - arguments="-ArgumentList '--port', '$port', '--dbpath', '$filePrefix/data/db', '--logpath', '$filePrefix/logs/db.log'" - - powershell -command "Start-Process -FilePath '$filePrefix/bin/mongod' $arguments" -done diff --git a/.github/scripts/dataSources/postgresql.sh b/.github/scripts/dataSources/postgresql.sh deleted file mode 100644 index 3c5e89f717..0000000000 --- a/.github/scripts/dataSources/postgresql.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -set -e - -sed -i "s/storageEngineList=127.0.0.1#6667#iotdb12/#storageEngineList=127.0.0.1#6667#iotdb12/g" conf/config.properties - -sed -i "s/#storageEngineList=127.0.0.1#5432#postgresql/storageEngineList=127.0.0.1#5432#postgresql/g" conf/config.properties - -sh -c "sudo sh -c 'echo \"deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main\" > /etc/apt/sources.list.d/pgdg.list'" - -sh -c "wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -" - -sh -c "sudo apt-get update" - -sh -c "sudo apt-get -y install postgresql-15" - -sh -c "sudo rm -rf /var/lib/postgresql/15/main" - -sh -c "sudo mkdir -p /var/lib/postgresql/15/main" - -sh -c "sudo chown -R postgres /var/lib/postgresql/15/main" - -sh -c "sudo chmod -R 777 /var/lib/postgresql/15/main" - -sh -c "sudo chmod -R 777 /usr/lib/postgresql/15" - -for port in "$@" -do - - sh -c "sudo mkdir -p /usr/lib/postgresql-$port" - - sh -c "sudo chmod -R 777 /usr/lib/postgresql-$port" - - sh -c "sudo cp -R /usr/lib/postgresql/15 /usr/lib/postgresql-$port" - - sh -c "sudo mkdir -p /var/lib/postgresql-$port/15/main" - - sh -c "sudo chown -R postgres /var/lib/postgresql-$port/15/main" - - sh -c "sudo chmod -R 777 /var/lib/postgresql-$port/15/main" - - sh -c "sudo su - postgres -c '/usr/lib/postgresql-$port/15/bin/initdb -D /var/lib/postgresql-$port/15/main --auth trust --no-instructions'" - - sh -c "sudo su - postgres -c '/usr/lib/postgresql-$port/15/bin/pg_ctl -D /var/lib/postgresql-$port/15/main -o \"-F -p $port\" start'" - - sh -c "sudo su - postgres -c '/usr/lib/postgresql-$port/15/bin/psql -c \"ALTER USER postgres WITH PASSWORD '\''postgres'\'';\"'" -done diff --git a/.github/scripts/dataSources/postgresql_macos.sh b/.github/scripts/dataSources/postgresql_macos.sh deleted file mode 100644 index 7305f7a6a6..0000000000 --- a/.github/scripts/dataSources/postgresql_macos.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -set -e - -sed -i "" "s/storageEngineList=127.0.0.1#6667#iotdb12/#storageEngineList=127.0.0.1#6667#iotdb12/g" conf/config.properties - -sed -i "" "s/#storageEngineList=127.0.0.1#5432#postgresql/storageEngineList=127.0.0.1#5432#postgresql/g" conf/config.properties - -sh -c "wget --quiet https://get.enterprisedb.com/postgresql/postgresql-15.2-1-osx-binaries.zip" - -sh -c "sudo unzip -q postgresql-15.2-1-osx-binaries.zip" - -sh -c "sudo dscl . -create /Users/postgres UniqueID 666" - -sh -c "sudo dscl . -create /Groups/postgres PrimaryGroupID 777" - -sh -c "sudo dscl . -create /Users/postgres PrimaryGroupID 777" - -sh -c "sudo dscl . -create /Users/postgres UserShell /bin/bash" - -sh -c "sudo dscl . -create /Users/postgres RealName \"PostgreSQL\"" - -sh -c "sudo dscl . create /Groups/postgres passwd '*'" - -sh -c "sudo mkdir /Users/postgres" - -sh -c "sudo chown -R postgres:postgres /Users/postgres" - -sh -c "sudo dscl . -create /Users/postgres NFSHomeDirectory /Users/postgres" - -sh -c "sudo mkdir -p /var/lib/postgresql/15/main" - -sh -c "sudo chown -R postgres /var/lib/postgresql/15/main" - -sh -c "sudo chmod -R 777 /var/lib/postgresql/15/main" - -for port in "$@" -do - - sh -c "sudo mkdir -p /Users/postgres/pgsql-$port" - - sh -c "sudo chmod -R 777 /Users/postgres/pgsql-$port" - - sh -c "sudo cp -R pgsql /Users/postgres/pgsql-$port" - - sh -c "sudo mkdir -p /var/lib/postgresql-$port/15/main" - - sh -c "sudo chown -R postgres /var/lib/postgresql-$port/15/main" - - sh -c "sudo chmod -R 777 /var/lib/postgresql-$port/15/main" - - sh -c "sudo su - postgres -c '/Users/postgres/pgsql-$port/pgsql/bin/initdb -D /var/lib/postgresql-$port/15/main --auth trust --no-instructions'" - - sh -c "sudo su - postgres -c '/Users/postgres/pgsql-$port/pgsql/bin/pg_ctl -D /var/lib/postgresql-$port/15/main -o \"-F -p $port\" start'" - - sh -c "sudo su - postgres -c '/Users/postgres/pgsql-$port/pgsql/bin/psql -c \"ALTER USER postgres WITH PASSWORD '\''postgres'\'';\"'" -done diff --git a/.github/scripts/dataSources/postgresql_windows.sh b/.github/scripts/dataSources/postgresql_windows.sh deleted file mode 100644 index 5952ad5b81..0000000000 --- a/.github/scripts/dataSources/postgresql_windows.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -set -e - -echo "Downloading zip archive. This may take a few minutes..." - -sh -c "curl -LJO https://get.enterprisedb.com/postgresql/postgresql-15.5-1-windows-x64-binaries.zip -o postgresql-15.5-1-windows-x64-binaries.zip" - -sh -c "unzip -qq postgresql-15.5-1-windows-x64-binaries.zip" - -echo "Download finished." - -sh -c "ls pgsql/bin" - -sed -i "s/storageEngineList=127.0.0.1#6667#iotdb12/#storageEngineList=127.0.0.1#6667#iotdb12/g" conf/config.properties - -sed -i "s/#storageEngineList=127.0.0.1#5432#postgresql/storageEngineList=127.0.0.1#5432#postgresql/g" conf/config.properties - -for port in "$@" -do - - sh -c "cp -R pgsql pgsql-$port" - - filePrefix="pgsql-$port" - - sh -c "mkdir -p $filePrefix/data" - - sh -c "mkdir -p $filePrefix/logs" - - arguments="-ArgumentList '-D', '$filePrefix/data', '--username=postgres', '--auth', 'trust', '--no-instructions', '-E', 'UTF8'" - - redirect="-RedirectStandardOutput '$filePrefix/logs/db.log' -RedirectStandardError '$filePrefix/logs/db-error.log'" - - powershell -command "Start-Process -FilePath '$filePrefix/bin/initdb' -NoNewWindow $arguments $redirect" - - ctlarguments="-ArgumentList '-D', '$filePrefix/data', '-o', '\"-F -p $port\"', 'start'" - - ctlredirect="-RedirectStandardOutput '$filePrefix/logs/pg_ctl.log' -RedirectStandardError '$filePrefix/logs/pg_ctl-error.log'" - - sh -c "sleep 6" - - powershell -command "Start-Process -FilePath '$filePrefix/bin/pg_ctl' -NoNewWindow $ctlarguments $ctlredirect" - - sql='"ALTER USER postgres WITH PASSWORD '\'\''postgres'\'\'';"' - - sqlarguments="-ArgumentList '-c', $sql" - - sqlredirect="-RedirectStandardOutput '$filePrefix/logs/psql.log' -RedirectStandardError '$filePrefix/logs/psql-error.log'" - - powershell -command "Start-Process -FilePath '$filePrefix/bin/psql' -NoNewWindow $sqlarguments $sqlredirect" -done diff --git a/.github/scripts/dataSources/redis.sh b/.github/scripts/dataSources/redis.sh deleted file mode 100644 index 55a7df6944..0000000000 --- a/.github/scripts/dataSources/redis.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -set -e - -sed -i "s/storageEngineList=127.0.0.1#6667/#storageEngineList=127.0.0.1#6667/g" conf/config.properties - -sed -i "s/#storageEngineList=127.0.0.1#6379/storageEngineList=127.0.0.1#6379/g" conf/config.properties - -sh -c "sudo apt-get install redis" - -for port in "$@" -do - sh -c "nohup redis-server --port $port &" -done diff --git a/.github/scripts/dataSources/redis_macos.sh b/.github/scripts/dataSources/redis_macos.sh deleted file mode 100644 index 7020822a96..0000000000 --- a/.github/scripts/dataSources/redis_macos.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -set -e - -sed -i "" "s/storageEngineList=127.0.0.1#6667/#storageEngineList=127.0.0.1#6667/" conf/config.properties - -sed -i "" "s/#storageEngineList=127.0.0.1#6379/storageEngineList=127.0.0.1#6379/" conf/config.properties - -sh -c "brew install redis" - -for port in "$@" -do - sh -c "nohup redis-server --port $port &" -done diff --git a/.github/scripts/dataSources/redis_windows.sh b/.github/scripts/dataSources/redis_windows.sh deleted file mode 100644 index c9437aa6fa..0000000000 --- a/.github/scripts/dataSources/redis_windows.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -set -e - -echo "Downloading files..." - -sh -c "curl -L https://raw.githubusercontent.com/IGinX-THU/IGinX-resources/main/resources/Redis-7.0.14-Windows-x64-msys2-with-Service.zip -o Redis-7.0.14-Windows-x64.zip" - -sh -c "unzip -qq Redis-7.0.14-Windows-x64.zip" - -echo "Download finished." - -sh -c "mkdir Redis-7.0.14-Windows-x64" - -sh -c "mv Redis-7.0.14-Windows-x64*/* Redis-7.0.14-Windows-x64" - -sh -c "ls Redis-7.0.14-Windows-x64" - -sed -i "s/storageEngineList=127.0.0.1#6667/#storageEngineList=127.0.0.1#6667/g" conf/config.properties - -sed -i "s/#storageEngineList=127.0.0.1#6379/storageEngineList=127.0.0.1#6379/g" conf/config.properties - -for port in "$@" -do - filePrefix="Redis-7.0.14-Windows-x64-$port" - - sh -c "cp -r Redis-7.0.14-Windows-x64 $filePrefix" - - sh -c "mkdir -p $filePrefix/logs" - - redirect="-RedirectStandardOutput '$filePrefix/logs/db.log' -RedirectStandardError '$filePrefix/logs/db-error.log'" - - powershell -command "Start-Process -FilePath '$filePrefix/redis-server' -ArgumentList '--port', '$port' -NoNewWindow $redirect" -done \ No newline at end of file diff --git a/.github/scripts/metadata/etcd.sh b/.github/scripts/metadata/etcd.sh deleted file mode 100644 index 38ccbb0c3a..0000000000 --- a/.github/scripts/metadata/etcd.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -set -e - -sh -c "wget -nv https://golang.org/dl/go1.16.5.linux-amd64.tar.gz" - -sh -c "tar -zxf go1.16.5.linux-amd64.tar.gz" - -export GOROOT=$PWD - -export GOPATH=$GOROOT/go - -export GOBIN=$GOPATH/bin - -export PATH=$PATH:$GOBIN - -sh -c "wget -nv https://github.com/etcd-io/etcd/releases/download/v3.5.0/etcd-v3.5.0-linux-amd64.tar.gz" - -sh -c "tar -zxf etcd-v3.5.0-linux-amd64.tar.gz" - -sh -c "mv etcd-v3.5.0-linux-amd64/etcd* $GOBIN" - -sh -c "nohup etcd >> run.log 2>&1 &" diff --git a/.github/scripts/metadata/etcd_clear.sh b/.github/scripts/metadata/etcd_clear.sh deleted file mode 100644 index 6f245b3723..0000000000 --- a/.github/scripts/metadata/etcd_clear.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -set -e - -sh -c "ls go/bin" - -sh -c "ls ." - -os=$(uname -s) - -kill_process_on_port() { - port=$1 - if [ -n "$MSYSTEM" ]; then - # win - pid=$(netstat -ano | findstr :$port | awk '{print $5}' | uniq) - if [ ! -z "$pid" ]; then - echo "Killing etcd process $pid on port $port" - sh -c "taskkill -f -pid $pid" - else - echo "No process found listening on port $port" - fi - else - # linux mac - pid=$(lsof -ti:$port) - if [ ! -z "$pid" ]; then - echo "Killing etcd process $pid on port $port" - kill -9 $pid - else - echo "No process found listening on port $port" - fi - fi -} - -kill_process_on_port 2379 - -sh -c "sleep 2" - -sh -c "rm -rf go/bin/*.etcd" - -sh -c "rm -rf *.etcd" \ No newline at end of file diff --git a/.github/scripts/metadata/etcd_macos.sh b/.github/scripts/metadata/etcd_macos.sh deleted file mode 100644 index e90f9f9774..0000000000 --- a/.github/scripts/metadata/etcd_macos.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -set -e - -sh -c "wget -nv https://golang.org/dl/go1.16.5.linux-amd64.tar.gz" - -sh -c "tar -zxf go1.16.5.linux-amd64.tar.gz" - -export GOROOT=$PWD - -export GOPATH=$GOROOT/go - -export GOBIN=$GOPATH/bin - -export PATH=$PATH:$GOBIN - -sh -c "wget -nv https://github.com/etcd-io/etcd/releases/download/v3.5.0/etcd-v3.5.0-darwin-amd64.zip" - -sh -c "unzip -qq etcd-v3.5.0-darwin-amd64.zip" - -sh -c "mv etcd-v3.5.0-darwin-amd64/etcd* $GOBIN" - -sh -c "nohup etcd >> run.log 2>&1 &" \ No newline at end of file diff --git a/.github/scripts/metadata/etcd_windows.sh b/.github/scripts/metadata/etcd_windows.sh deleted file mode 100644 index 3e0d914d32..0000000000 --- a/.github/scripts/metadata/etcd_windows.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -set -e - -sh -c "curl -LJO https://go.dev/dl/go1.21.5.windows-amd64.zip -o go1.21.5.windows-amd64.zip" - -sh -c "unzip -qq go1.21.5.windows-amd64.zip" - -sh -c "ls ./" - -sh -c "ls go" - -export GOROOT=$PWD - -export GOPATH=$GOROOT/go - -export GOBIN=$GOPATH/bin - -export PATH=$PATH:$GOBIN - -sh -c "curl -LJO https://github.com/etcd-io/etcd/releases/download/v3.4.28/etcd-v3.4.28-windows-amd64.zip -o etcd-v3.4.28-windows-amd64.zip" - -sh -c "unzip -qq etcd-v3.4.28-windows-amd64.zip" - -sh -c "mv etcd-v3.4.28-windows-amd64/etcd* $GOBIN" - -powershell -command "Start-Process etcd -NoNewWindow -RedirectStandardOutput 'etcd-run.log' -RedirectStandardError 'etcd-error.log'" diff --git a/.github/scripts/metadata/zk.sh b/.github/scripts/metadata/zk.sh deleted file mode 100644 index c1e0af5895..0000000000 --- a/.github/scripts/metadata/zk.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -set -e - -sh -c "wget -nv https://dlcdn.apache.org/zookeeper/zookeeper-3.7.2/apache-zookeeper-3.7.2-bin.tar.gz --no-check-certificate" - -sh -c "tar -zxf apache-zookeeper-3.7.2-bin.tar.gz" - -sh -c "mv apache-zookeeper-3.7.2-bin zookeeper" - -sh -c "cp ./.github/actions/zookeeperRunner/zoo.cfg zookeeper/conf/zoo.cfg" - -sh -c "zookeeper/bin/zkServer.sh start" - -sh -c "zookeeper/bin/zkCli.sh ls /" diff --git a/.github/scripts/metadata/zk_clear.sh b/.github/scripts/metadata/zk_clear.sh deleted file mode 100644 index 2d232378ff..0000000000 --- a/.github/scripts/metadata/zk_clear.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -set -e - -if [ -n "$MSYSTEM" ]; then - PORT=2181 - -# PID=$(netstat -ano | grep $PORT | awk '{print $5}' | uniq) - - readarray -t results < <(netstat -ano | grep $PORT | awk '{print $5}' | uniq) - - for PID in "${results[@]}"; do - if [ -z "$PID" ]; then - echo "Can't find zookeeper process $PID" - else - sh -c "taskkill -f -pid $PID" - fi - done -else - sh -c "zookeeper/bin/zkServer.sh stop" -fi - -sh -c "sleep 2" - -sh -c "rm -rf zookeeper/data" - -sh -c "mkdir zookeeper/data" - -sh -c "rm -rf zookeeper/logs" - -sh -c "mkdir zookeeper/logs" diff --git a/.github/scripts/metadata/zk_macos.sh b/.github/scripts/metadata/zk_macos.sh deleted file mode 100644 index ea1b3a954e..0000000000 --- a/.github/scripts/metadata/zk_macos.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -set -e - -sh -c "wget -nv https://dlcdn.apache.org/zookeeper/zookeeper-3.7.2/apache-zookeeper-3.7.2-bin.tar.gz --no-check-certificate" - -sh -c "tar -zxf apache-zookeeper-3.7.2-bin.tar.gz" - -sh -c "mv apache-zookeeper-3.7.2-bin zookeeper" - -sh -c "cp ./.github/actions/zookeeperRunner/zooMac.cfg zookeeper/conf/zoo.cfg" - -sh -c "zookeeper/bin/zkServer.sh start" diff --git a/.github/scripts/metadata/zk_windows.sh b/.github/scripts/metadata/zk_windows.sh deleted file mode 100644 index c27d3e294e..0000000000 --- a/.github/scripts/metadata/zk_windows.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -set -e - -sh -c "curl -LJO https://dlcdn.apache.org/zookeeper/zookeeper-3.7.2/apache-zookeeper-3.7.2-bin.tar.gz -o apache-zookeeper-3.7.2-bin.tar.gz" - -sh -c "tar -zxf apache-zookeeper-3.7.2-bin.tar.gz" - -sh -c "mv apache-zookeeper-3.7.2-bin zookeeper" - -sh -c "cp ./.github/actions/zookeeperRunner/zooWin.cfg zookeeper/conf/zoo.cfg" - -cd zookeeper - -sh -c "mkdir logs" - -sh -c "mkdir data" - -powershell -Command "Start-Process -FilePath 'bin/zkServer.cmd' -NoNewWindow -RedirectStandardOutput 'logs/zookeeper.log' -RedirectStandardError 'logs/zookeeper-error.log'" - -sleep 3 - -echo $(netstat -ano | grep 2181) diff --git a/.github/workflows/DB-CE.yml b/.github/workflows/DB-CE.yml index 22511ba399..413ec8a877 100644 --- a/.github/workflows/DB-CE.yml +++ b/.github/workflows/DB-CE.yml @@ -36,7 +36,7 @@ jobs: env: METADATA_STORAGE: ${{ matrix.metadata }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Environment dependence uses: ./.github/actions/dependence with: diff --git a/.github/workflows/case-regression.yml b/.github/workflows/case-regression.yml index 474a112472..b6b9669b57 100644 --- a/.github/workflows/case-regression.yml +++ b/.github/workflows/case-regression.yml @@ -24,7 +24,7 @@ jobs: metadata: [zookeeper] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Environment dependence uses: ./.github/actions/dependence with: diff --git a/.github/workflows/standalone-test-pushdown.yml b/.github/workflows/standalone-test-pushdown.yml index 148995a895..fe95b4c713 100644 --- a/.github/workflows/standalone-test-pushdown.yml +++ b/.github/workflows/standalone-test-pushdown.yml @@ -32,7 +32,7 @@ jobs: metadata: [zookeeper] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Environment dependence uses: ./.github/actions/dependence with: diff --git a/.github/workflows/standalone-test.yml b/.github/workflows/standalone-test.yml index b14d6329eb..e7e57f931e 100644 --- a/.github/workflows/standalone-test.yml +++ b/.github/workflows/standalone-test.yml @@ -32,7 +32,7 @@ jobs: metadata: [zookeeper] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Environment dependence uses: ./.github/actions/dependence with: diff --git a/.github/workflows/unit-mds.yml b/.github/workflows/unit-mds.yml index 521f20afdb..36a1f3811c 100644 --- a/.github/workflows/unit-mds.yml +++ b/.github/workflows/unit-mds.yml @@ -22,18 +22,12 @@ jobs: STORAGE: zookeeper ZOOKEEPER_CONNECTION_STRING: 127.0.0.1:2181 steps: - - uses: actions/checkout@v2 - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - name: Environment dependence + uses: ./.github/actions/dependence with: - java-version: ${{ matrix.java }} - - - name: Cache Maven packages - uses: actions/cache@v2 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 + java: ${{ matrix.java }} + scope: base - name: Run ZooKeeper uses: ./.github/actions/zookeeperRunner @@ -60,18 +54,12 @@ jobs: STORAGE: etcd ETCD_ENDPOINTS: http://localhost:2379 steps: - - uses: actions/checkout@v2 - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - - name: Cache Maven packages - uses: actions/cache@v2 + - uses: actions/checkout@v4 + - name: Environment dependence + uses: ./.github/actions/dependence with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 + java: ${{ matrix.java }} + scope: base - name: Run ETCD uses: ./.github/actions/etcdRunner diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 5d3cc6d68e..799fcbb250 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -22,7 +22,7 @@ jobs: os: [ubuntu-latest, macos-13, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Environment dependence uses: ./.github/actions/dependence with: diff --git a/assembly/pom.xml b/assembly/pom.xml index 15b54a008a..a7d3ea6cb8 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -97,9 +97,8 @@ com.googlecode.maven-download-plugin download-maven-plugin - 1.8.1 + 1.9.0 - ${project.build.directory}/download true https://dlcdn.apache.org/zookeeper/zookeeper-${zookeeper.version}/apache-zookeeper-${zookeeper.version}-bin.tar.gz diff --git a/assembly/src/assembly/resources/zookeeper/conf/zoo.cfg b/assembly/src/assembly/resources/zookeeper/conf/zoo.cfg index a1f1666ca7..07c295f633 100644 --- a/assembly/src/assembly/resources/zookeeper/conf/zoo.cfg +++ b/assembly/src/assembly/resources/zookeeper/conf/zoo.cfg @@ -10,6 +10,7 @@ syncLimit=5 # do not use /tmp for storage, /tmp here is just # example sakes. dataDir=data +dataLogDir=logs # the port at which the clients will connect clientPort=2181 # the maximum number of client connections. diff --git a/client/src/main/java/cn/edu/tsinghua/iginx/client/IginxClient.java b/client/src/main/java/cn/edu/tsinghua/iginx/client/IginxClient.java index 0d5c30e0e6..8584c8569b 100644 --- a/client/src/main/java/cn/edu/tsinghua/iginx/client/IginxClient.java +++ b/client/src/main/java/cn/edu/tsinghua/iginx/client/IginxClient.java @@ -570,15 +570,9 @@ private static void processExportCsv(QueryDataSet res) throws SessionException, try { CSVPrinter printer = getCSVBuilder(exportCSV).build().print(new PrintWriter(file)); - boolean hasKey = res.getColumnList().get(0).equals(GlobalConstant.KEY_NAME); if (exportCSV.isExportHeader) { - List headerNames = new ArrayList<>(); - if (hasKey) { - headerNames.add(GlobalConstant.KEY_NAME); - } - headerNames.addAll(res.getColumnList()); - printer.printRecord(headerNames); + printer.printRecord(res.getColumnList()); } while (res.hasMore()) { diff --git a/thrift/pom.xml b/thrift/pom.xml index 04f50bd1c2..061de88fff 100644 --- a/thrift/pom.xml +++ b/thrift/pom.xml @@ -165,7 +165,7 @@ com.googlecode.maven-download-plugin download-maven-plugin - 1.3.0 + 1.9.0 get-thrift-executable @@ -177,6 +177,19 @@ ${thrift.download-url} ${project.build.directory}/tools ${thrift.executable} + false + + + + get-thrift-executable-fallback + + wget + + generate-sources + + ${thrift.fallback-url} + ${project.build.directory}/tools + ${thrift.executable} @@ -244,10 +257,11 @@ - http://archive.apache.org/dist/thrift/${thrift.version}/thrift-${thrift.version}.exe + https://github.com/IGinX-THU/IGinX-resources/raw/main/resources/thrift_0.16.0_win.exe "Do nothing" echo thrift-${thrift.version}-win-x86_64.exe + http://archive.apache.org/dist/thrift/${thrift.version}/thrift-${thrift.version}.exe true @@ -264,6 +278,7 @@ +x ${project.build.directory}/tools/${thrift.executable} chmod thrift_0.16.0_linux.exe + ${thrift.download-url} false @@ -279,6 +294,7 @@ +x ${project.build.directory}/tools/${thrift.executable} chmod thrift_0.16.0_mac.exe + ${thrift.download-url} false