From 575153dd8dcef0b353183102081652c8eeb7eeec Mon Sep 17 00:00:00 2001 From: Yong Zheng Date: Tue, 13 Aug 2024 17:52:30 -0500 Subject: [PATCH 1/8] Fix polaris cli initialization --- regtests/polaris | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regtests/polaris b/regtests/polaris index 238f4fc0ca..932358998f 100755 --- a/regtests/polaris +++ b/regtests/polaris @@ -28,7 +28,7 @@ if [ ! -d ${SCRIPT_DIR}/polaris-venv ]; then . ${SCRIPT_DIR}/polaris-venv/bin/activate pip install poetry==1.5.0 - cp ${SCRIPT_DIR}/regtests/client/python/pyproject.toml ${SCRIPT_DIR} + cp ${SCRIPT_DIR}/client/python/pyproject.toml ${SCRIPT_DIR} # Save the current directory CURRENT_DIR=$(pwd) @@ -42,7 +42,7 @@ fi # Save the current directory CURRENT_DIR=$(pwd) cd $SCRIPT_DIR > /dev/null -PYTHONPATH=regtests/client/python ${SCRIPT_DIR}/polaris-venv/bin/python3 regtests/client/python/cli/polaris_cli.py "$@" +PYTHONPATH=client/python ${SCRIPT_DIR}/polaris-venv/bin/python3 client/python/cli/polaris_cli.py "$@" status=$? cd $CURRENT_DIR > /dev/null From cd9edb16e6c8009fbc77f0264c2079870ea864b9 Mon Sep 17 00:00:00 2001 From: Yong Zheng Date: Wed, 14 Aug 2024 23:01:14 -0500 Subject: [PATCH 2/8] Trigger Build From 0f9977513bee087b528993bf5ec30b9b16bfd2b3 Mon Sep 17 00:00:00 2001 From: Yong Zheng Date: Fri, 16 Aug 2024 22:49:42 -0500 Subject: [PATCH 3/8] Add check for polaris cli when running within regtests --- regtests/polaris | 10 ++++++++-- regtests/t_cli/src/test_cli.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/regtests/polaris b/regtests/polaris index 932358998f..25e39da2fb 100755 --- a/regtests/polaris +++ b/regtests/polaris @@ -22,13 +22,19 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +# Check if the current directory is 'regtests' and abort if it is +if [ $(basename ${SCRIPT_DIR}) == "regtests" ]; then + echo "This script is intended solely for regression testing and cannot be executed from within the 'regtests' directory. Please use the script from the parent directory: $(dirname ${SCRIPT_DIR})/polaris" + exit 1 +fi + if [ ! -d ${SCRIPT_DIR}/polaris-venv ]; then echo "Performing first-time setup for the Python client..." python3 -m venv ${SCRIPT_DIR}/polaris-venv . ${SCRIPT_DIR}/polaris-venv/bin/activate pip install poetry==1.5.0 - cp ${SCRIPT_DIR}/client/python/pyproject.toml ${SCRIPT_DIR} + cp ${SCRIPT_DIR}/regtests/client/python/pyproject.toml ${SCRIPT_DIR} # Save the current directory CURRENT_DIR=$(pwd) @@ -42,7 +48,7 @@ fi # Save the current directory CURRENT_DIR=$(pwd) cd $SCRIPT_DIR > /dev/null -PYTHONPATH=client/python ${SCRIPT_DIR}/polaris-venv/bin/python3 client/python/cli/polaris_cli.py "$@" +PYTHONPATH=regtests/client/python ${SCRIPT_DIR}/polaris-venv/bin/python3 regtests/client/python/cli/polaris_cli.py "$@" status=$? cd $CURRENT_DIR > /dev/null diff --git a/regtests/t_cli/src/test_cli.py b/regtests/t_cli/src/test_cli.py index 0466ee9abe..d8c311a7f8 100644 --- a/regtests/t_cli/src/test_cli.py +++ b/regtests/t_cli/src/test_cli.py @@ -377,4 +377,4 @@ def test_invalid_commands(): 'not-real!' ), exception_str='--storage-type') finally: - sys.path.pop(0) + sys.path.pop(0) \ No newline at end of file From 810640befc1c6c5e70936112cebd4df782305485 Mon Sep 17 00:00:00 2001 From: Yong Zheng Date: Fri, 16 Aug 2024 22:53:43 -0500 Subject: [PATCH 4/8] Add comment --- regtests/polaris | 2 ++ 1 file changed, 2 insertions(+) diff --git a/regtests/polaris b/regtests/polaris index 25e39da2fb..d7936a9848 100755 --- a/regtests/polaris +++ b/regtests/polaris @@ -28,6 +28,8 @@ if [ $(basename ${SCRIPT_DIR}) == "regtests" ]; then exit 1 fi +# Check if the virtual environment directory 'polaris-venv' exists. +# If it does not, perform the first-time setup for the Python client if [ ! -d ${SCRIPT_DIR}/polaris-venv ]; then echo "Performing first-time setup for the Python client..." python3 -m venv ${SCRIPT_DIR}/polaris-venv From f6ec6fe6cbedb13cf0f375326a82dfdc3ed332e3 Mon Sep 17 00:00:00 2001 From: Yong Zheng Date: Fri, 16 Aug 2024 22:54:54 -0500 Subject: [PATCH 5/8] Reverted changes on test_cli.py --- regtests/t_cli/src/test_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regtests/t_cli/src/test_cli.py b/regtests/t_cli/src/test_cli.py index d8c311a7f8..0466ee9abe 100644 --- a/regtests/t_cli/src/test_cli.py +++ b/regtests/t_cli/src/test_cli.py @@ -377,4 +377,4 @@ def test_invalid_commands(): 'not-real!' ), exception_str='--storage-type') finally: - sys.path.pop(0) \ No newline at end of file + sys.path.pop(0) From 2bb3122be1708e0ec929927aabfc2ded611a4719 Mon Sep 17 00:00:00 2001 From: Yong Zheng Date: Mon, 19 Aug 2024 16:11:35 -0500 Subject: [PATCH 6/8] Rename polaris to polaris-reg-test under regtests dir --- regtests/Dockerfile | 2 +- regtests/{polaris => polaris-reg-test} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename regtests/{polaris => polaris-reg-test} (89%) diff --git a/regtests/Dockerfile b/regtests/Dockerfile index f92ce0c4ee..42c4e50581 100644 --- a/regtests/Dockerfile +++ b/regtests/Dockerfile @@ -34,7 +34,7 @@ WORKDIR /home/spark/regtests COPY ./setup.sh /home/spark/regtests/setup.sh COPY ./pyspark-setup.sh /home/spark/regtests/pyspark-setup.sh COPY ./client/python /home/spark/regtests/client/python -COPY ./polaris /home/spark +COPY ./polaris-reg-test /home/spark/polaris RUN python3 -m venv /home/spark/polaris-venv && \ . /home/spark/polaris-venv/bin/activate && \ diff --git a/regtests/polaris b/regtests/polaris-reg-test similarity index 89% rename from regtests/polaris rename to regtests/polaris-reg-test index d7936a9848..66c6624a48 100755 --- a/regtests/polaris +++ b/regtests/polaris-reg-test @@ -15,10 +15,10 @@ # limitations under the License. # -################################################ -# This is a modified copy of the script in the # -# parent directory, used for regression tests. # -################################################ +#################################################### +# This is a modified copy of the polaris script in # +# the parent directory, used for regression tests. # +#################################################### SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) From 29acca5c0b25c70f3caba5d6aca21e29977a366c Mon Sep 17 00:00:00 2001 From: Yong Zheng Date: Tue, 20 Aug 2024 08:52:43 -0500 Subject: [PATCH 7/8] Match polaris-reg-test to polaris script --- regtests/polaris-reg-test | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/regtests/polaris-reg-test b/regtests/polaris-reg-test index 66c6624a48..255aaa04ae 100755 --- a/regtests/polaris-reg-test +++ b/regtests/polaris-reg-test @@ -14,22 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -#################################################### -# This is a modified copy of the polaris script in # -# the parent directory, used for regression tests. # -#################################################### - SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -# Check if the current directory is 'regtests' and abort if it is -if [ $(basename ${SCRIPT_DIR}) == "regtests" ]; then - echo "This script is intended solely for regression testing and cannot be executed from within the 'regtests' directory. Please use the script from the parent directory: $(dirname ${SCRIPT_DIR})/polaris" - exit 1 -fi - -# Check if the virtual environment directory 'polaris-venv' exists. -# If it does not, perform the first-time setup for the Python client if [ ! -d ${SCRIPT_DIR}/polaris-venv ]; then echo "Performing first-time setup for the Python client..." python3 -m venv ${SCRIPT_DIR}/polaris-venv @@ -37,22 +23,16 @@ if [ ! -d ${SCRIPT_DIR}/polaris-venv ]; then pip install poetry==1.5.0 cp ${SCRIPT_DIR}/regtests/client/python/pyproject.toml ${SCRIPT_DIR} - - # Save the current directory - CURRENT_DIR=$(pwd) - cd $SCRIPT_DIR && poetry install - cd $CURRENT_DIR + pushd $SCRIPT_DIR && poetry install ; popd deactivate echo "First time setup complete." fi -# Save the current directory -CURRENT_DIR=$(pwd) -cd $SCRIPT_DIR > /dev/null +pushd $SCRIPT_DIR > /dev/null PYTHONPATH=regtests/client/python ${SCRIPT_DIR}/polaris-venv/bin/python3 regtests/client/python/cli/polaris_cli.py "$@" status=$? -cd $CURRENT_DIR > /dev/null +popd > /dev/null if [ $status -ne 0 ]; then exit 1 From e39822b0f2da8d629997b8b10ceceb1bcdbae8ff Mon Sep 17 00:00:00 2001 From: Yong Zheng Date: Tue, 20 Aug 2024 12:30:30 -0500 Subject: [PATCH 8/8] Revert changes on polaris-reg-test --- regtests/polaris-reg-test | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/regtests/polaris-reg-test b/regtests/polaris-reg-test index 255aaa04ae..36b6908edc 100755 --- a/regtests/polaris-reg-test +++ b/regtests/polaris-reg-test @@ -14,8 +14,22 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +#################################################### +# This is a modified copy of the polaris script in # +# the parent directory, used for regression tests. # +#################################################### + SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +# Check if the current directory is 'regtests' and abort if it is +if [ $(basename ${SCRIPT_DIR}) == "regtests" ]; then + echo "This script is intended solely for regression testing and cannot be executed from within the 'regtests' directory. Please use the script from the parent directory: $(dirname ${SCRIPT_DIR})/polaris" + exit 1 +fi + +# Check if the virtual environment directory 'polaris-venv' exists. +# If it does not, perform the first-time setup for the Python client if [ ! -d ${SCRIPT_DIR}/polaris-venv ]; then echo "Performing first-time setup for the Python client..." python3 -m venv ${SCRIPT_DIR}/polaris-venv @@ -23,19 +37,25 @@ if [ ! -d ${SCRIPT_DIR}/polaris-venv ]; then pip install poetry==1.5.0 cp ${SCRIPT_DIR}/regtests/client/python/pyproject.toml ${SCRIPT_DIR} - pushd $SCRIPT_DIR && poetry install ; popd + + # Save the current directory + CURRENT_DIR=$(pwd) + cd $SCRIPT_DIR && poetry install + cd $CURRENT_DIR deactivate echo "First time setup complete." fi -pushd $SCRIPT_DIR > /dev/null +# Save the current directory +CURRENT_DIR=$(pwd) +cd $SCRIPT_DIR > /dev/null PYTHONPATH=regtests/client/python ${SCRIPT_DIR}/polaris-venv/bin/python3 regtests/client/python/cli/polaris_cli.py "$@" status=$? -popd > /dev/null +cd $CURRENT_DIR > /dev/null if [ $status -ne 0 ]; then exit 1 fi -exit 0 +exit 0 \ No newline at end of file