Skip to content

Commit 4036ae2

Browse files
committed
Rearrange dir layout inside docker
1 parent 9d74df7 commit 4036ae2

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

regtests/Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,24 @@ USER spark
3535
ENV PYTHONPATH="${SPARK_HOME}/python/:${SPARK_HOME}/python/lib/py4j-0.10.9.7-src.zip:$PYTHONPATH"
3636

3737
# Copy and run setup.sh separately so that test sources can change, but the setup script run is still cached
38-
WORKDIR /home/spark/regtests
39-
COPY ./regtests/setup.sh /home/spark/regtests/setup.sh
40-
COPY ./regtests/pyspark-setup.sh /home/spark/regtests/pyspark-setup.sh
41-
COPY ./client/python /home/spark/regtests/client/python
42-
COPY ./regtests/polaris-reg-test /home/spark/polaris
38+
WORKDIR /home/spark/polaris
39+
COPY ./regtests/setup.sh /home/spark/polaris/regtests/setup.sh
40+
COPY ./regtests/pyspark-setup.sh /home/spark/polaris/regtests/pyspark-setup.sh
41+
COPY ./client/python /home/spark/polaris/client/python
42+
COPY ./regtests/polaris-reg-test /home/spark/polaris/polaris
4343
COPY ./regtests/requirements.txt /tmp/
4444

45-
RUN python3 -m venv /home/spark/polaris-venv && \
46-
. /home/spark/polaris-venv/bin/activate && \
45+
RUN python3 -m venv /home/spark/polaris/polaris-venv && \
46+
. /home/spark/polaris/polaris-venv/bin/activate && \
4747
pip install -r /tmp/requirements.txt && \
4848
deactivate \
49-
./setup.sh
49+
./regtests/setup.sh
5050

51-
COPY --chown=spark ./regtests /home/spark/regtests
51+
COPY --chown=spark ./regtests /home/spark/polaris/regtests
5252

5353
# /home/spark/regtests might not be writable in all situations, see https://github.com/apache/polaris/pull/205
5454
USER root
55-
RUN chmod -R go+rwx /home/spark/regtests
55+
RUN chmod -R go+rwx /home/spark/polaris
5656
USER spark
5757

58-
ENTRYPOINT ["./run.sh"]
58+
ENTRYPOINT ["./regtests/run.sh"]

regtests/polaris-reg-test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if [ ! -d ${SCRIPT_DIR}/polaris-venv ]; then
3939
. ${SCRIPT_DIR}/polaris-venv/bin/activate
4040
pip install -f requirements.txt
4141

42-
cp ${SCRIPT_DIR}/regtests/client/python/pyproject.toml ${SCRIPT_DIR}
42+
cp ${SCRIPT_DIR}/client/python/pyproject.toml ${SCRIPT_DIR}
4343

4444
# Save the current directory
4545
CURRENT_DIR=$(pwd)
@@ -53,7 +53,7 @@ fi
5353
# Save the current directory
5454
CURRENT_DIR=$(pwd)
5555
cd $SCRIPT_DIR > /dev/null
56-
PYTHONPATH=regtests/client/python SCRIPT_DIR="$SCRIPT_DIR" ${SCRIPT_DIR}/polaris-venv/bin/python3 regtests/client/python/cli/polaris_cli.py "$@"
56+
PYTHONPATH=client/python SCRIPT_DIR="$SCRIPT_DIR" ${SCRIPT_DIR}/polaris-venv/bin/python3 client/python/cli/polaris_cli.py "$@"
5757
status=$?
5858
cd $CURRENT_DIR > /dev/null
5959

regtests/pyspark-setup.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
# under the License.
1919
#
2020

21-
if [ ! -d ~/polaris-venv ]; then
22-
python3 -m venv ~/polaris-venv
21+
if [ ! -d ~/polaris/polaris-venv ]; then
22+
python3 -m venv ~/polaris/polaris-venv
2323
fi
2424

25-
. ~/polaris-venv/bin/activate
25+
. ~/polaris/polaris-venv/bin/activate
2626

2727
pip install -r requirements.txt
2828

29-
cd client/python
29+
cd ../client/python
3030
python3 -m poetry install
3131
deactivate

regtests/run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ cd ${REGTEST_HOME}
4949
./setup.sh
5050

5151
# start the python venv
52-
. ~/polaris-venv/bin/activate
52+
. ~/polaris/polaris-venv/bin/activate
5353

5454
if [ -z "${1}" ]; then
5555
loginfo 'Running all tests'
56-
TEST_LIST="client/python/test $(find t_* -wholename '*t_*/src/*')"
56+
TEST_LIST="../client/python/test $(find t_* -wholename '*t_*/src/*')"
5757
else
5858
loginfo "Running single test ${1}"
5959
TEST_LIST=${1}
@@ -92,7 +92,7 @@ echo "Root bearer token: ${REGTEST_ROOT_BEARER_TOKEN}"
9292

9393
for TEST_FILE in ${TEST_LIST}; do
9494
# Special-case running all client pytests
95-
if [ "${TEST_FILE}" == 'client/python/test' ]; then
95+
if [ "${TEST_FILE}" == '../client/python/test' ]; then
9696
loginfo "Starting pytest for entire client suite"
9797
SCRIPT_DIR="$SCRIPT_DIR" python3 -m pytest ${TEST_FILE}
9898
CODE=$?

regtests/t_cli/src/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import sys
2828
from typing import Callable
2929

30-
CLI_PYTHONPATH = f'{os.path.dirname(os.path.abspath(__file__))}/../../client/python'
30+
CLI_PYTHONPATH = f'{os.path.dirname(os.path.abspath(__file__))}/../../../client/python'
3131
ROLE_ARN = 'arn:aws:iam::123456789012:role/my-role'
3232
POLARIS_HOST = os.getenv('POLARIS_HOST', 'localhost')
3333
POLARIS_URL = f'http://{POLARIS_HOST}:8181/api/catalog/v1/oauth/tokens'
@@ -46,7 +46,7 @@ def cli_inner(*args) -> Callable[[], str]:
4646
def f() -> str:
4747
result = subprocess.run([
4848
'bash',
49-
f'{CLI_PYTHONPATH}/../../../polaris',
49+
f'{CLI_PYTHONPATH}/../../polaris',
5050
'--access-token',
5151
access_token,
5252
'--host',

0 commit comments

Comments
 (0)