File: conda-python-emscripten.dockerfile

package info (click to toggle)
apache-arrow 23.0.1-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 76,220 kB
  • sloc: cpp: 654,608; python: 70,522; ruby: 45,964; ansic: 18,742; sh: 7,365; makefile: 669; javascript: 125; xml: 41
file content (65 lines) | stat: -rw-r--r-- 2,725 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

ARG repo
ARG arch
ARG python="3.12"
FROM ${repo}:${arch}-conda-python-${python}

ARG selenium_version="4.15.2"
ARG pyodide_version="0.26.0"
ARG chrome_version="latest"
ARG required_python_min="(3,12)"
# fail if python version < 3.12
RUN echo "check PYTHON>=${required_python_min}" && python -c "import sys;sys.exit(0 if sys.version_info>=${required_python_min} else 1)"

# install selenium and recent pyodide-build and recent python

# needs to be a login shell so ~/.profile is read
SHELL ["/bin/bash", "--login", "-c", "-o", "pipefail"]

RUN python -m pip install --no-cache-dir selenium==${selenium_version} && \
    python -m pip install --no-cache-dir --upgrade pyodide-build>=${pyodide_version}

# install pyodide dist directory to /pyodide
RUN pyodide_dist_url="https://github.com/pyodide/pyodide/releases/download/${pyodide_version}/pyodide-${pyodide_version}.tar.bz2" && \
    wget -q "${pyodide_dist_url}" -O- | tar -xj -C /

# install node 20 (needed for async call support)
# and pthread-stubs for build, and unzip needed for chrome build to work
# xz is needed by emsdk to extract node tarballs
RUN conda install nodejs=20 unzip pthread-stubs make xz -c conda-forge

# install correct version of emscripten for this pyodide
COPY ci/scripts/install_emscripten.sh /arrow/ci/scripts/
RUN bash /arrow/ci/scripts/install_emscripten.sh ~ /pyodide

# make sure zlib is cached in the EMSDK folder
RUN source ~/emsdk/emsdk_env.sh && embuilder --pic build zlib

# install chrome for testing browser based runner
COPY ci/scripts/install_chromedriver.sh /arrow/ci/scripts/
RUN /arrow/ci/scripts/install_chromedriver.sh "${chrome_version}"

# make the version of make that is installed by conda be available everywhere
# or else pyodide's isolated build fails to find it
RUN ln -s "$(type -P make)" /bin/make

ENV ARROW_BUILD_TESTS="OFF" \
    ARROW_BUILD_TYPE="release" \
    ARROW_DEPENDENCY_SOURCE="BUNDLED" \
    ARROW_EMSCRIPTEN="ON"