|
18 | 18 | # |
19 | 19 |
|
20 | 20 | FROM docker.io/apache/spark:3.5.6-java17-python3 |
| 21 | + |
21 | 22 | ARG POLARIS_HOST=polaris |
22 | | -ENV POLARIS_HOST=$POLARIS_HOST |
23 | | -ENV SPARK_HOME=/opt/spark |
24 | | -ENV LANGUAGE='en_US:en' |
| 23 | + |
| 24 | +ENV POLARIS_HOST=${POLARIS_HOST} \ |
| 25 | + PYTHONPATH="${SPARK_HOME}/python/:${SPARK_HOME}/python/lib/py4j-0.10.9.7-src.zip" |
25 | 26 |
|
26 | 27 | USER root |
27 | | -RUN apt update |
28 | | -RUN apt-get install -y diffutils wget curl python3.10-venv jq |
29 | | -RUN mkdir -p /home/spark && \ |
30 | | - chown -R spark /home/spark && \ |
31 | | - mkdir -p /tmp/polaris-regtests && \ |
32 | | - chown -R spark /tmp/polaris-regtests |
33 | | -RUN mkdir /opt/spark/conf && chmod -R 777 /opt/spark/conf |
| 28 | + |
| 29 | +RUN apt-get update && \ |
| 30 | + apt-get install -y --no-install-recommends diffutils wget curl python3.10-venv jq && \ |
| 31 | + rm -rf /var/lib/apt/lists/* && \ |
| 32 | + mkdir -p /home/spark /tmp/polaris-regtests /opt/spark/conf && \ |
| 33 | + chown -R spark:spark /home/spark /tmp/polaris-regtests && \ |
| 34 | + chmod -R 777 /opt/spark/conf |
| 35 | + |
| 36 | +COPY --chown=spark:spark ./regtests/setup.sh ./regtests/pyspark-setup.sh ./regtests/requirements.txt /home/spark/polaris/regtests/ |
| 37 | +COPY --chown=spark:spark ./client/python /home/spark/polaris/client/python |
| 38 | +COPY --chown=spark:spark ./polaris /home/spark/polaris/polaris |
| 39 | +COPY --chown=spark:spark ./spec /home/spark/polaris/spec |
| 40 | +COPY --chown=spark:spark ./regtests /home/spark/polaris/regtests |
| 41 | + |
| 42 | +# /home/spark/regtests might not be writable in all situations, see https://github.com/apache/polaris/pull/205 |
| 43 | +RUN chmod -R go+rwx /home/spark/polaris |
34 | 44 |
|
35 | 45 | USER spark |
36 | | -ENV PYTHONPATH="${SPARK_HOME}/python/:${SPARK_HOME}/python/lib/py4j-0.10.9.7-src.zip:$PYTHONPATH" |
37 | 46 |
|
38 | | -# Copy and run setup.sh separately so that test sources can change, but the setup script run is still cached |
39 | 47 | WORKDIR /home/spark/polaris |
40 | | -COPY --chown=spark ./regtests/setup.sh /home/spark/polaris/regtests/setup.sh |
41 | | -COPY --chown=spark ./regtests/pyspark-setup.sh /home/spark/polaris/regtests/pyspark-setup.sh |
42 | | -COPY --chown=spark ./client/python /home/spark/polaris/client/python |
43 | | -COPY --chown=spark ./polaris /home/spark/polaris/polaris |
44 | | -COPY --chown=spark ./spec /home/spark/polaris/spec |
45 | | -COPY --chown=spark ./regtests/requirements.txt /tmp/ |
46 | 48 |
|
47 | 49 | RUN python3 -m venv /home/spark/polaris/polaris-venv && \ |
48 | 50 | . /home/spark/polaris/polaris-venv/bin/activate && \ |
49 | | - pip install -r /tmp/requirements.txt && \ |
| 51 | + pip install -r /home/spark/polaris/regtests/requirements.txt && \ |
50 | 52 | cd /home/spark/polaris/client/python && \ |
51 | 53 | poetry install && \ |
52 | 54 | deactivate && \ |
53 | 55 | /home/spark/polaris/regtests/setup.sh |
54 | 56 |
|
55 | | -COPY --chown=spark ./regtests /home/spark/polaris/regtests |
56 | | - |
57 | | -# /home/spark/regtests might not be writable in all situations, see https://github.com/apache/polaris/pull/205 |
58 | | -USER root |
59 | | -RUN chmod -R go+rwx /home/spark/polaris |
60 | | -USER spark |
61 | | - |
62 | 57 | ENTRYPOINT ["./regtests/run.sh"] |
0 commit comments