Skip to content

Commit

Permalink
Merge branch 'main' into hotfix-uncorrelate
Browse files Browse the repository at this point in the history
  • Loading branch information
Yihao-Xu authored May 10, 2024
2 parents d3f0681 + ed919ee commit 1c9c42f
Show file tree
Hide file tree
Showing 55 changed files with 823 additions and 785 deletions.
110 changes: 65 additions & 45 deletions .github/actions/dbRunner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
7 changes: 5 additions & 2 deletions .github/actions/dependence/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
23 changes: 23 additions & 0 deletions .github/actions/edit/action.yml
Original file line number Diff line number Diff line change
@@ -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
55 changes: 22 additions & 33 deletions .github/actions/etcdRunner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
33 changes: 33 additions & 0 deletions .github/actions/service/etcd/action.yml
Original file line number Diff line number Diff line change
@@ -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
43 changes: 43 additions & 0 deletions .github/actions/service/mongodb/action.yml
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 1c9c42f

Please sign in to comment.