Skip to content

Commit ccdbb42

Browse files
authored
fix: add gcc10 to AL2 image; build numpy and pandas from source (#3069)
1 parent 9e319f0 commit ccdbb42

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

building/lambda/Dockerfile

+14-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ RUN yum install -y \
1010
libxslt-devel \
1111
bison \
1212
make \
13-
gcc \
14-
gcc-c++ \
13+
gcc10 \
14+
gcc10-c++ \
1515
flex \
1616
autoconf \
1717
zip \
@@ -20,12 +20,24 @@ RUN yum install -y \
2020

2121
WORKDIR /root
2222

23+
ENV CC=/usr/bin/gcc10-cc
24+
ENV CXX=/usr/bin/gcc10-c++
25+
ENV LD=/usr/bin/gcc10-gcc
26+
27+
RUN ln -s /usr/bin/gcc10-gcc /usr/bin/gcc
28+
RUN ln -s /usr/bin/gcc10-g++ /usr/bin/g++
29+
RUN ln -s /usr/bin/gcc10-nm /usr/bin/nm
30+
RUN ln -s /usr/bin/gcc10-ar /usr/bin/ar
31+
RUN ln -s /usr/bin/gcc10-mpn /usr/bin/mpn
32+
RUN ln -s /usr/bin/gcc10-ld /usr/bin/ld
33+
2334
FROM ${python_version}
2435
COPY pyproject.toml poetry.lock ./
2536

2637
RUN pip3 install --upgrade pip wheel setuptools>=64 setuptools_scm>=8
2738
RUN pip3 install --upgrade urllib3==1.26.16 # temporary to avoid https://github.com/urllib3/urllib3/issues/2168 (TODO remove when the AL2 image updates to support OpenSSL 1.1.1+)
2839
RUN pip3 install --upgrade six cython cmake hypothesis poetry
40+
ENV PIP_NO_BINARY="numpy,pandas"
2941
RUN poetry config virtualenvs.create false --local && poetry install --no-root --only main
3042

3143
RUN rm -f pyproject.toml poetry.lock

building/lambda/Dockerfile.al2023

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ COPY pyproject.toml poetry.lock ./
2525

2626
RUN pip3 install --upgrade pip wheel setuptools>=64 setuptools_scm>=8
2727
RUN pip3 install --upgrade six cython cmake hypothesis poetry
28+
ENV PIP_NO_BINARY="numpy,pandas"
2829
RUN poetry config virtualenvs.create false --local && poetry install --no-root --only main
2930

3031
RUN rm -f pyproject.toml poetry.lock

building/lambda/build-lambda-layer.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ popd
8383

8484
pushd /aws-sdk-pandas
8585

86-
pip3 install . -t ./python ".[redshift,mysql,postgres,gremlin,opensearch,openpyxl]"
86+
pip3 install . --no-binary numpy,pandas -t ./python ".[redshift,mysql,postgres,gremlin,opensearch,openpyxl]"
8787

8888
rm -rf python/pyarrow*
8989
rm -rf python/boto*

0 commit comments

Comments
 (0)