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

feat(relational): add Oracle #571

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions .github/actions/confWriter/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ runs:
paths: ${{ inputs.Root-Dir-Path }}/core/target/iginx-core-*/conf/config.properties
statements: s/^#storageEngineList=192.168.106.2#19530/storageEngineList=192.168.106.2#19530/g

- if: inputs.DB-name == 'Oracle'
name: Modify IGinX Config
uses: ./.github/actions/edit
with:
paths: ${{ inputs.Root-Dir-Path }}/core/target/iginx-core-*/conf/config.properties
statements: s/^#storageEngineList=127.0.0.1#1521#relational#engine=oracle#username=system#password=Oracle123#has_data=false/storageEngineList=127.0.0.1#1521#relational#engine=oracle#username=system#password=Oracle123#has_data=false/g

- if: inputs.DB-name == 'FileSystem'
name: Modify IGinX Config
uses: ./.github/actions/edit
Expand Down
15 changes: 15 additions & 0 deletions .github/actions/dbRunner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ inputs:
description: "VectorDB ports"
required: false
default: 19530
Oracle-ports:
description: "Oracle ports"
required: false
default: 1521

runs:
using: "composite" # Mandatory parameter
Expand Down Expand Up @@ -140,3 +144,14 @@ runs:
clean: false
start: true
ports: ${{ inputs.VectorDB-ports }}

- if: inputs.DB-name=='Oracle'
name: Setup DB
uses: ./.github/actions/setup/oracle

- if: inputs.DB-name == 'Oracle'
id: oracleService
name: Start Oracle Service
uses: ./.github/actions/service/oracle
with:
ports: ${{ inputs.Oracle-ports }}
64 changes: 64 additions & 0 deletions .github/actions/service/oracle/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: "oracle"
inputs:
ports:
description: The server port to listen on.
default: "1521"
required: false
version:
description: oracle db version.
default: "oracle23"
required: false
runs:
using: "composite"
steps:
- if: runner.os == 'Linux' || runner.os == 'macOS'
name: Start Oracle container
shell: bash
run: |
for port in ${{ inputs.ports }}; do
docker run -d --name ${{ inputs.version }}-$port -p $port:1521 -e ORACLE_PDB=ORCLPDB -e ORACLE_PWD=Oracle123 container-registry.oracle.com/database/free:23.5.0.0-lite
done
- if: runner.os == 'Linux' || runner.os == 'macOS'
name: Verify Oracle Database is running
id: oracleContainer
shell: bash
run: |
for port in ${{ inputs.ports }}; do
while true; do
log_output=$(docker logs "${{ inputs.version }}-$port" 2>&1 | grep -i "DATABASE IS READY TO USE" || true)
if [ -z "$log_output" ]; then
echo "oracle service not started, retry in 10 seconds..."
docker logs --tail 10 ${{ inputs.version }}-$port
sleep 10
else
echo "oracle service started."
break
fi
done
done
- if: runner.os == 'Windows'
name: Start Oracle container
shell: wsl-run {0}
run: |
for port in ${{ inputs.ports }}; do
docker run -d --name "${{ inputs.version }}-$port" -p $port:1521 -e ORACLE_PDB=ORCLPDB -e ORACLE_PWD=Oracle123 container-registry.oracle.com/database/free:23.5.0.0-lite
done
- if: runner.os == 'Windows'
name: Verify Oracle Database is running
id: oracleContainerWin
shell: wsl-run {0}
run: |
for port in ${{ inputs.ports }}; do
while true; do
log_output=$(docker logs "${{ inputs.version }}-$port" 2>&1 | grep -i "DATABASE IS READY TO USE" || true)
if [ -z "$log_output" ]; then
echo "${{ inputs.version }}-$port service not started, retry in 10 seconds..."
docker logs --tail 10 ${{ inputs.version }}-$port
sleep 10
else
echo "${{ inputs.version }}-$port service started."
break
fi
done
done
docker ps -a
43 changes: 43 additions & 0 deletions .github/actions/setup/oracle/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "oracle"
description: "setup oracle"
inputs:
version:
description: "oracle version"
required: false
default: "23"

runs:
using: "composite"
steps:
- if: runner.os == 'macOS'
name: Install Docker on MacOS
shell: bash
run: |
brew update
brew install colima docker qemu
colima start --arch x86_64 --vm-type=vz --vz-rosetta --mount-type=virtiofs --memory 4
- if: runner.os == 'Linux' || runner.os == 'macOS'
name: Download Oracle Database Docker image
shell: bash
run: |
docker --version
docker pull container-registry.oracle.com/database/free:23.5.0.0-lite
- if: runner.os == 'Windows'
uses: vedantmgoyal9/setup-wsl2@main

- if: runner.os == 'Windows'
run: apt update && apt upgrade -y
shell: wsl-run {0}

- if: runner.os == 'Windows'
name: Install Docker
shell: wsl-run {0}
run: |
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y
sudo service docker start
docker --version
docker pull container-registry.oracle.com/database/free:23.5.0.0-lite
21 changes: 21 additions & 0 deletions .github/scripts/dataSources/restart/oracle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
#
# IGinX - the polystore system with high performance
# Copyright (C) Tsinghua University
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

docker restart oracle23-"$1"
sleep 5
21 changes: 21 additions & 0 deletions .github/scripts/dataSources/shutdown/oracle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
#
# IGinX - the polystore system with high performance
# Copyright (C) Tsinghua University
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

docker stop oracle23-"$1"
sleep 5
28 changes: 28 additions & 0 deletions .github/scripts/dataSources/update/oracle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
#
# IGinX - the polystore system with high performance
# Copyright (C) Tsinghua University
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

CONTAINER_NAME="oracle23-$1" # 容器名称
DATABASE_USER="system"

docker exec "$CONTAINER_NAME" bash -c "
sqlplus -s / as sysdba <<EOF
ALTER USER $DATABASE_USER IDENTIFIED BY $2;
EXIT;
EOF
"
19 changes: 18 additions & 1 deletion .github/scripts/iginx/iginx_udf_path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,22 @@ else

sh -c "chmod +x iginx-core-$1/sbin/start_iginx.sh"

sh -c "nohup iginx-core-$1/sbin/start_iginx.sh > ../../iginx-u.log 2>&1 &"
sh -c "nohup iginx-core-$1/sbin/start_iginx.sh > ../../iginx-udf.log 2>&1 &"
fi

log_file="../../iginx-udf.log"
timeout=30
interval=2

elapsed_time=0
while [ $elapsed_time -lt $timeout ]; do
last_lines=$(tail -n 20 "$log_file")
if echo "$last_lines" | grep -q "IGinX is now in service......"; then
echo "IGinX started"
exit 0
fi
sleep $interval
echo "sleep $interval seconds,waiting iginx start complete"
elapsed_time=$((elapsed_time + interval))
done
echo "IGinX not started"
5 changes: 3 additions & 2 deletions .github/workflows/DB-CE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ on:
description: "The database to run the test on"
type: string
required: false
default: '["IoTDB12", "InfluxDB", "FileSystem", "PostgreSQL", "Redis", "MongoDB", "MySQL"]'
default: '["IoTDB12", "InfluxDB", "FileSystem", "PostgreSQL", "Redis", "MongoDB", "MySQL", "Oracle"]'
timeout-minutes:
description: "The timeout minutes for the job"
type: number
required: false
default: 35
default: 100
close-optimizer:
description: "Whether to close the optimizer"
type: string
Expand Down Expand Up @@ -89,6 +89,7 @@ jobs:
PostgreSQL-ports: 5432 5433 5434
Redis-ports: 6379 6380 6381
VectorDB-ports: 19530 19531 19532
Oracle-ports: 1521 1522 1523

- name: Install IGinX with Maven
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/standalone-test-no-optimizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ on:
description: "The database to run the test on"
type: string
required: false
default: '["IoTDB12", "InfluxDB", "FileSystem", "PostgreSQL", "Redis", "MongoDB", "MySQL"]'
default: '["IoTDB12", "InfluxDB", "FileSystem", "PostgreSQL", "Redis", "MongoDB", "MySQL", "Oracle"]'
timeout-minutes:
description: "The timeout minutes for the job"
type: number
required: false
default: 40
default: 100

jobs:
Union-DB-Test-No-Optimizer:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/standalone-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ on:
description: "The database to run the test on"
type: string
required: false
default: '["IoTDB12", "InfluxDB", "FileSystem", "PostgreSQL", "Redis", "MongoDB", "MySQL"]'
default: '["IoTDB12", "InfluxDB", "FileSystem", "PostgreSQL", "Redis", "MongoDB", "MySQL", "Oracle"]'
timeout-minutes:
description: "The timeout minutes for the job"
type: number
required: false
default: 45
default: 100

jobs:
Union-DB-Test:
Expand Down Expand Up @@ -116,8 +116,8 @@ jobs:
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/test/cli/test_job_register_macos.sh"
"${GITHUB_WORKSPACE}/.github/scripts/test/cli/test_job_register_macos.sh" ${VERSION}
fi
mvn test -q -Dtest=TransformJobPathIT#verifyResult -DfailIfNoTests=false -P-format
mvn test -q -Dtest=TransformJobRestartIT#prepare -DfailIfNoTests=false -P-format
mvn test -q -Dtest=TransformJobPathIT#verifyResult -DfailIfNoTests=false -P-format

- name: Stop IGinX
uses: ./.github/actions/iginxRunner
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tpc-h.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
description: "The database to run the test on"
type: string
required: false
default: '["IoTDB12", "InfluxDB", "FileSystem", "PostgreSQL", "Redis", "MongoDB", "MySQL"]'
default: '["IoTDB12", "InfluxDB", "FileSystem", "PostgreSQL", "Redis", "MongoDB", "MySQL", "Oracle"]'
close-optimizer:
description: "Whether to close the optimizer"
type: string
Expand All @@ -37,7 +37,7 @@ on:
description: "The timeout minutes for the job"
type: number
required: false
default: 60
default: 100

jobs:
TPC-H-Test:
Expand Down
Loading