Skip to content

Commit

Permalink
Removed fresh install section
Browse files Browse the repository at this point in the history
Added Python2
  • Loading branch information
tomuben committed Nov 1, 2024
1 parent 76d2772 commit 8e8aaa8
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 158 deletions.
74 changes: 41 additions & 33 deletions .github/workflows/check_rollback_7.1.30_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ on:
jobs:
Check:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- db-version: "7.1.29"
expected-original-alter-system-parameter: "ALTER SYSTEM SET SCRIPT_LANGUAGES='R=builtin_r JAVA=builtin_java PYTHON3=builtin_python3'"
expected-new-alter-system-command: "ALTER SYSTEM SET SCRIPT_LANGUAGES='JAVA=builtin_java PYTHON3=builtin_python3 R=localzmq+protobuf:///bfsdefault/default/EXAClusterOS/ScriptLanguages-standard-EXASOL-7.1.0-slc-v6.0.0-VYP23K36/?lang=r#/buckets/bfsdefault/default/EXAClusterOS/ScriptLanguages-standard-EXASOL-7.1.0-slc-v6.0.0-VYP23K36/exaudf/exaudfclient_py3';"
support-python2: "no"
- db-version: "7.1.19"
expected-original-alter-system-parameter: "ALTER SYSTEM SET SCRIPT_LANGUAGES='PYTHON=builtin_python R=builtin_r JAVA=builtin_java PYTHON3=builtin_python3';"
expected-new-alter-system-command: "ALTER SYSTEM SET SCRIPT_LANGUAGES='JAVA=builtin_java PYTHON3=builtin_python3 PYTHON=localzmq+protobuf:///bfsdefault/default/EXAClusterOS/ScriptLanguages-standard-EXASOL-7.1.0-slc-v4.0.0-CM4RWW6R/?lang=python#/buckets/bfsdefault/default/EXAClusterOS/ScriptLanguages-standard-EXASOL-7.1.0-slc-v4.0.0-CM4RWW6R/exaudf/exaudfclient R=localzmq+protobuf:///bfsdefault/default/EXAClusterOS/ScriptLanguages-standard-EXASOL-7.1.0-slc-v4.0.0-CM4RWW6R/?lang=r#/buckets/bfsdefault/default/EXAClusterOS/ScriptLanguages-standard-EXASOL-7.1.0-slc-v4.0.0-CM4RWW6R/exaudf/exaudfclient_py3';"
support-python2: "yes"
- db-version: "7.1.6"
expected-original-alter-system-parameter: "ALTER SYSTEM SET SCRIPT_LANGUAGES='PYTHON=builtin_python R=builtin_r JAVA=builtin_java PYTHON3=builtin_python3';"
expected-new-alter-system-command: "ALTER SYSTEM SET SCRIPT_LANGUAGES='JAVA=builtin_java PYTHON3=builtin_python3 PYTHON=localzmq+protobuf:///bfsdefault/default/EXAClusterOS/ScriptLanguages-release-standard-exasol-7.1.0-1.1.0/?lang=python#/buckets/bfsdefault/default/EXAClusterOS/ScriptLanguages-release-standard-exasol-7.1.0-1.1.0/exaudf/exaudfclient R=localzmq+protobuf:///bfsdefault/default/EXAClusterOS/ScriptLanguages-release-standard-exasol-7.1.0-1.1.0/?lang=r#/buckets/bfsdefault/default/EXAClusterOS/ScriptLanguages-release-standard-exasol-7.1.0-1.1.0/exaudf/exaudfclient_py3';"
support-python2: "yes"
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -21,7 +37,7 @@ jobs:
python-version: "3.10"
poetry-version: '1.8.2'
- name: Start ITDE
run: poetry run itde spawn-test-environment --environment-name exasol_test --database-port-forward 8888 --bucketfs-port-forward 6583 --docker-db-image-version=7.1.29;
run: poetry run itde spawn-test-environment --environment-name exasol_test --database-port-forward 8888 --bucketfs-port-forward 6583 --docker-db-image-version=${{ matrix.db-version }};
- name: Install dependencies
run: sudo apt update && sudo apt install -y perl default-jre
- name: Install EXAPlus
Expand All @@ -32,48 +48,40 @@ jobs:
- name: Check if get_original_script_languages_parameters.sql works
run: |
RESULT=`exaplus -x -q -c localhost:8888 -u sys -p exasol -f ./get_original_script_languages_parameter.sql`
echo "$RESULT" | grep "ALTER SYSTEM SET SCRIPT_LANGUAGES='R=builtin_r JAVA=builtin_java PYTHON3=builtin_python3'" || (echo SCRIPT_LANGUAGES parameter not as expected && exit 1)
working-directory: doc/user_guide/resources
- name: Check if get_original_script_languages_parameters.sql works
run: |
RESULT=`exaplus -x -q -c localhost:8888 -u sys -p exasol -f ./get_original_script_languages_parameter.sql`
echo "$RESULT" | grep "ALTER SYSTEM SET SCRIPT_LANGUAGES='R=builtin_r JAVA=builtin_java PYTHON3=builtin_python3'" || (echo SCRIPT_LANGUAGES parameter not as expected && exit 1)
echo "$RESULT" | grep ${{ matrix.expected-original-alter-system-parameter }} || (echo SCRIPT_LANGUAGES parameter not as expected && exit 1)
working-directory: doc/user_guide/resources
- name: Install a simple R UDF
run: |
exaplus -x -q -c localhost:8888 -u sys -p exasol -f install_r_udf.sql
exaplus -x -q -c localhost:8888 -u sys -p exasol -sql "SELECT TEST.R_DEMO();"
working-directory: .github/workflows/scripts
- name: Check if pre_update_check.sql works
- name: Install a simple Python2 UDF
if: ${{ matrix.support-python2=='yes' }}
run: |
exaplus -x -q -c localhost:8888 -u sys -p exasol -f install_python2_udf.sql
exaplus -x -q -c localhost:8888 -u sys -p exasol -sql "SELECT TEST.TEST_PYTHON_VERSION();"
working-directory: .github/workflows/scripts
- name: Check if pre_update_check.sql works for R only
if: ${{ matrix.support-python2=='yes' }}
run: |
RESULT=`exaplus -x -q -c localhost:8888 -u sys -p exasol -f ./pre_update_check.sql`
echo "$RESULT" | grep "You have 1 UDFs using the pre-shipped R"
echo "$RESULT" | grep "You have 1 UDFs using the pre-shipped R/Python2"
working-directory: doc/user_guide/resources
- name: Check if construct_alter_system_command_before_update.sql works
- name: Check if pre_update_check.sql works for R and Python2
if: ${{ matrix.support-python2=='yes' }}
run: |
RESULT=`exaplus -c localhost:8888 -u sys -p exasol -f ./construct_alter_system_command_before_update.sql`
echo "$RESULT" | tr -d '\n' | grep "ALTER SYSTEM SET SCRIPT_LANGUAGES='JAVA=builtin_java PYTHON3=builtin_python3 R=localzmq+protobuf:///bfsdefault/default/EXAClusterOS/ScriptLanguages-standard-EXASOL-7.1.0-slc-v6.0.0-VYP23K36/?lang=r#/buckets/bfsdefault/default/EXAClusterOS/ScriptLanguages-standard-EXASOL-7.1.0-slc-v6.0.0-VYP23K36/exaudf/exaudfclient_py3';"
exaplus -x -q -c localhost:8888 -u sys -p exasol -sql "ALTER SYSTEM SET SCRIPT_LANGUAGES='JAVA=builtin_java PYTHON3=builtin_python3 R=localzmq+protobuf:///bfsdefault/default/EXAClusterOS/ScriptLanguages-standard-EXASOL-7.1.0-slc-v6.0.0-VYP23K36/?lang=r#/buckets/bfsdefault/default/EXAClusterOS/ScriptLanguages-standard-EXASOL-7.1.0-slc-v6.0.0-VYP23K36/exaudf/exaudfclient_py3';"
exaplus -x -q -c localhost:8888 -u sys -p exasol -sql "SELECT TEST.R_DEMO();"
working-directory: doc/user_guide/resources
- name: Run Skript
run: bash install_slc_v6.0.0_on_db.sh localhost 6583 write default HTTP
RESULT=`exaplus -x -q -c localhost:8888 -u sys -p exasol -f ./pre_update_check.sql`
echo "$RESULT" | grep "You have 2 UDFs using the pre-shipped R/Python2"
working-directory: doc/user_guide/resources
- name: Check if construct_alter_system_command_from_downloaded.sql works
- name: Run construct_alter_system_command_before_update.sql
run: |
sed -i 's/<bucketfs_name>/bfsdefault/g' construct_alter_system_command_from_downloaded_container.sql
sed -i 's/<bucket_name>/default/g' construct_alter_system_command_from_downloaded_container.sql
sed -i 's/<path_in_bucket>//g' construct_alter_system_command_from_downloaded_container.sql
sed -i 's/<container_name>/standard-EXASOL-7.1.0_release\.tar\.gz/g' construct_alter_system_command_from_downloaded_container.sql
echo babla1
RESULT=`exaplus -q -c localhost:8888 -u sys -p exasol -f ./construct_alter_system_command_from_downloaded_container.sql`
echo babla2
echo "$RESULT"
echo blabla2.1
echo "$RESULT" | tr -d '\n' | grep "ALTER SYSTEM SET SCRIPT_LANGUAGES='JAVA=builtin_java PYTHON3=builtin_python3 R=localzmq+protobuf:///bfsdefault/default//standard-EXASOL-7.1.0_release.tar.gz/?lang=r#/buckets/bfsdefault/default//standard-EXASOL-7.1.0_release.tar.gz/exaudf/exaudfclient_py3';"
echo babla3
exaplus -x -q -c localhost:8888 -u sys -p exasol -sql "ALTER SYSTEM SET SCRIPT_LANGUAGES='JAVA=builtin_java PYTHON3=builtin_python3 R=localzmq+protobuf:///bfsdefault/default//standard-EXASOL-7.1.0_release.tar.gz/?lang=r#/buckets/bfsdefault/default//standard-EXASOL-7.1.0_release.tar.gz/exaudf/exaudfclient_py3';"
echo babla4
exaplus -x -q -c localhost:8888 -u sys -p exasol -sql "SELECT TEST.R_DEMO();"
echo babla5
RESULT=`exaplus -c localhost:8888 -u sys -p exasol -f ./construct_alter_system_command_before_update.sql`
echo "$RESULT" | tr -d '\n' | grep "${{ matrix.expected-new-alter-system-command }}" || (echo ALTER SYSTEM command not as expected && exit 1)
exaplus -x -q -c localhost:8888 -u sys -p exasol -sql "${{ matrix.expected-new-alter-system-command }}"
working-directory: doc/user_guide/resources
- name: Test if R UDF still works
run: exaplus -x -q -c localhost:8888 -u sys -p exasol -sql "SELECT TEST.R_DEMO();"
- name: Test if Python2 UDF still works
if: ${{ matrix.support-python2=='yes' }}
run: exaplus -x -q -c localhost:8888 -u sys -p exasol -sql "SELECT TEST.TEST_PYTHON_VERSION();"

10 changes: 10 additions & 0 deletions .github/workflows/scripts/install_python2_udf.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE SCHEMA IF NOT EXISTS TEST;
OPEN SCHEMA TEST;
--/

CREATE OR REPLACE PYTHON SET SCRIPT "TEST_PYTHON_VERSION" ("i" DECIMAL(18,0)) EMITS ("O" VARCHAR(2000000) UTF8) AS
import sys
def run(ctx):
ctx.emit(sys.version)
/

1 change: 1 addition & 0 deletions .github/workflows/scripts/install_r_udf.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CREATE SCHEMA IF NOT EXISTS TEST;
OPEN SCHEMA TEST;

--/
CREATE OR REPLACE R SCALAR SCRIPT TEST.R_DEMO() RETURNS VARCHAR(2000) AS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,18 @@ new_alias_content as (
join parsed_lang_pairs on true
where alias_content='builtin_r'
union all
select
alias_name,
'localzmq+protobuf:///bfsdefault/default/EXAClusterOS/' || container_name || '/?lang=python#/buckets/bfsdefault/default/EXAClusterOS/' || container_name || '/exaudf/exaudfclient' as alias_content
from container_name
join parsed_lang_pairs on true
where alias_content='builtin_python'
union all
select
alias_name,
alias_content
from parsed_lang_pairs
where alias_content<>'builtin_r'
where alias_content<>'builtin_r' and alias_content<>'builtin_python'
),
new_system_value as (
select GROUP_CONCAT(alias_name || '=' || alias_content SEPARATOR ' ') as new_system_value
Expand Down

This file was deleted.

39 changes: 0 additions & 39 deletions doc/user_guide/resources/install_slc_v6.0.0_on_db.sh

This file was deleted.

6 changes: 3 additions & 3 deletions doc/user_guide/resources/pre_update_check.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ num_of_pairs as(
)
select
case
when count(*) = 0 then 'You are not using the pre-shipped R in UDFs.'
else 'You have '||to_char(count(*))||' UDFs using the pre-shipped R:
when count(*) = 0 then 'You are not using the pre-shipped R/Python2 in UDFs.'
else 'You have '||to_char(count(*))||' UDFs using the pre-shipped R/Python2:

' || GROUP_CONCAT('"'||s.script_schema||'"."'||s.script_name||'"' separator '
')
Expand All @@ -41,5 +41,5 @@ FROM
on upper(p.alias_name)=s.script_language
WHERE
1=1
and p.alias_content = 'builtin_r'
and (p.alias_content = 'builtin_r' or p.alias_content = 'builtin_python')
;
Loading

0 comments on commit 8e8aaa8

Please sign in to comment.