|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +ARG repo |
| 19 | +ARG arch |
| 20 | +ARG python="3.12" |
| 21 | +FROM ${repo}:${arch}-conda-python-${python} |
| 22 | + |
| 23 | +ARG selenium_version="4.15.2" |
| 24 | +ARG pyodide_version="0.26.0" |
| 25 | +ARG chrome_version="latest" |
| 26 | +ARG required_python_min="(3,12)" |
| 27 | +# fail if python version < 3.12 |
| 28 | +RUN echo "check PYTHON>=${required_python_min}" && python -c "import sys;sys.exit(0 if sys.version_info>=${required_python_min} else 1)" |
| 29 | + |
| 30 | +# install selenium and pyodide-build and recent python |
| 31 | + |
| 32 | +# needs to be a login shell so ~/.profile is read |
| 33 | +SHELL ["/bin/bash", "--login", "-c", "-o", "pipefail"] |
| 34 | + |
| 35 | +RUN python -m pip install --no-cache-dir selenium==${selenium_version} && \ |
| 36 | + python -m pip install --no-cache-dir --upgrade pyodide-build==${pyodide_version} |
| 37 | + |
| 38 | +# install pyodide dist directory to /pyodide |
| 39 | +RUN pyodide_dist_url="https://github.com/pyodide/pyodide/releases/download/${pyodide_version}/pyodide-${pyodide_version}.tar.bz2" && \ |
| 40 | + wget -q "${pyodide_dist_url}" -O- | tar -xj -C / |
| 41 | + |
| 42 | +# install correct version of emscripten for this pyodide |
| 43 | +COPY ci/scripts/install_emscripten.sh /arrow/ci/scripts/ |
| 44 | +RUN bash /arrow/ci/scripts/install_emscripten.sh ~ /pyodide |
| 45 | + |
| 46 | +# make sure zlib is cached in the EMSDK folder |
| 47 | +RUN source ~/emsdk/emsdk_env.sh && embuilder --pic build zlib |
| 48 | + |
| 49 | +# install node 20 (needed for async call support) |
| 50 | +# and pthread-stubs for build, and unzip needed for chrome build to work |
| 51 | +RUN conda install nodejs=20 unzip pthread-stubs make -c conda-forge |
| 52 | + |
| 53 | +# install chrome for testing browser based runner |
| 54 | +COPY ci/scripts/install_chromedriver.sh /arrow/ci/scripts/ |
| 55 | +RUN /arrow/ci/scripts/install_chromedriver.sh "${chrome_version}" |
| 56 | + |
| 57 | +# make the version of make that is installed by conda be available everywhere |
| 58 | +# or else pyodide's isolated build fails to find it |
| 59 | +RUN ln -s "$(type -P make)" /bin/make |
| 60 | + |
| 61 | +ENV ARROW_BUILD_TESTS="OFF" \ |
| 62 | + ARROW_BUILD_TYPE="release" \ |
| 63 | + ARROW_DEPENDENCY_SOURCE="BUNDLED" \ |
| 64 | + ARROW_EMSCRIPTEN="ON" |
0 commit comments