Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci/cache iotdb #321

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/dbRunner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ runs:
exit 1
fi

- if: inputs.DB-name=='IoTDB12'
name: Setup DB
uses: ./.github/actions/setup/iotdb12

- if: inputs.DB-name=='IoTDB12'
name: Run DB
shell: bash
Expand Down
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"
59 changes: 24 additions & 35 deletions .github/actions/etcdRunner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,30 @@ inputs:
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
- if: inputs.if-stop=='false' && inputs.if-rerun=='false'
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"
- if: inputs.if-stop=='true'
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
33 changes: 33 additions & 0 deletions .github/actions/service/zookeeper/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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

- if: fromJSON(inputs.start)
name: Start zookeeper
shell: bash
working-directory: ${{ github.action_path }}
run: zkServer.sh --config conf start
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ 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
dataDir=data
dataLogDir=logs
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
Expand Down
47 changes: 47 additions & 0 deletions .github/actions/setup/etcd/action.yml
Original file line number Diff line number Diff line change
@@ -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 }}
51 changes: 51 additions & 0 deletions .github/actions/setup/iotdb12/action.yml
Original file line number Diff line number Diff line change
@@ -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 HOME to ENV
shell: bash
working-directory: ${{ steps.base.outputs.tool-path }}
run: echo "IOTDB_HOME=$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 }}
35 changes: 35 additions & 0 deletions .github/actions/setup/tool/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "etcd"
description: "setup etcd"
inputs:
version:
description: "etcd 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)
45 changes: 45 additions & 0 deletions .github/actions/setup/zookeeper/action.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Loading
Loading