Skip to content

Commit 81f4d5b

Browse files
kukushkingmalachi-constantcnfait
authored
(enhancement) update lambda layers with pyarrow 10 (#1758)
* Update lambda layers with pyarrow 10 * Use C++17 standard * [skip ci] Retire Python3.6 from Docker image * [skip ci] Remove c++17 std cmake flags * [skip ci] Add CMAKE_PREFIX_PATH * Add separate dockerfile for AL1-based py37 * use single dockerfile for all * [skip ci] add missing build arg for py37 * [skip ci] correct syntax * [skip ci] use al2 as base image for py37 too * [skip ci] comment Co-authored-by: Lucas Hanson <[email protected]> Co-authored-by: Cyril Fait <[email protected]>
1 parent 2b8190e commit 81f4d5b

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

building/lambda/Dockerfile

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,27 @@ RUN yum install -y \
1616
git \
1717
ninja-build
1818

19-
RUN pip3 install --upgrade pip wheel && pip3 install --upgrade six cython cmake hypothesis poetry
20-
2119
WORKDIR /root
2220

23-
FROM base AS python36
24-
# only for python3.6
25-
RUN yum install -y python36-devel && \
26-
mkdir -p /var/lang/include/ && \
27-
ln -s /usr/include/python3.6m /var/lang/include/python3.6m
21+
FROM base AS python37
22+
# Install C devtools & Python37
23+
ARG PYTHON_VERSION="3.7.15"
24+
RUN yum -y group install "C Development Tools and Libraries" "Development Tools" \
25+
&& yum -y install openssl openssl-devel libffi-devel bzip2-devel \
26+
&& curl -fsSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz | tar xzf - \
27+
&& cd Python-${PYTHON_VERSION}/ \
28+
&& ./configure --enable-optimizations --prefix=/var/lang \
29+
&& make altinstall \
30+
&& ln -fs /var/lang/bin/python3.7 /var/lang/bin/python \
31+
&& ln -fs /var/lang/bin/python3.7 /var/lang/bin/python3 \
32+
&& ln -fs /var/lang/bin/pip3.7 /var/lang/bin/pip \
33+
&& ln -fs /var/lang/bin/pip3.7 /var/lang/bin/pip3 \
34+
&& rm -Rf ./Python-${PYTHON_VERSION}
2835

2936
FROM ${python_version}
3037
COPY pyproject.toml poetry.lock ./
38+
39+
RUN pip3 install --upgrade pip wheel && pip3 install --upgrade six cython cmake hypothesis poetry
3140
RUN poetry config virtualenvs.create false --local && poetry install --no-root
3241

3342
RUN rm -f pyproject.toml poetry.lock

building/lambda/build-docker-images.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ export DOCKER_BUILDKIT=1
99
ARCH=$(arch)
1010

1111
if [ "${ARCH}" != "aarch64" ]; then
12-
# Python 3.7
12+
# Python 3.7 (using public.ecr.aws/lambda/python:3.8 is intentional)
1313
docker build \
1414
--pull \
1515
--tag awswrangler-build-py37 \
16-
--build-arg base_image=public.ecr.aws/lambda/python:3.7 \
16+
--build-arg base_image=public.ecr.aws/lambda/python:3.8 \
17+
--build-arg python_version=python37 \
1718
.
1819
fi
1920

building/lambda/build-lambda-layer.sh

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export LD_LIBRARY_PATH=$(pwd)/dist/lib:$LD_LIBRARY_PATH
1515

1616
git clone \
1717
--depth 1 \
18-
--branch apache-arrow-8.0.0 \
18+
--branch apache-arrow-10.0.0 \
1919
--single-branch \
2020
https://github.com/apache/arrow.git
2121

@@ -50,6 +50,7 @@ popd
5050

5151
pushd arrow/python
5252

53+
export CMAKE_PREFIX_PATH=${ARROW_HOME}${CMAKE_PREFIX_PATH:+:${CMAKE_PREFIX_PATH}}
5354
export ARROW_PRE_0_15_IPC_FORMAT=0
5455
export PYARROW_WITH_HDFS=0
5556
export PYARROW_WITH_FLIGHT=0

0 commit comments

Comments
 (0)