Skip to content

Conversation

philvarner
Copy link
Contributor

@philvarner philvarner commented Mar 4, 2025

Few issues currently:

  1. gdal 3.9 and 3.10 won't build on the public.ecr.aws/lambda/provided:al image -- they need to use al2023 image instead.
  2. al2023 uses dnf instead of yum, but the commands are the same
  3. install package automake instead of automake16
  4. GDAL docs state to build with commands
  && cmake --build . \
  && cmake --build . --target install \

instead of

  && make -j $(nproc) --silent && make install 

@vincentsarago
Copy link
Contributor

thanks @philvarner really appreciate your time on this.

I won't have a lot of time to spend on this but I'll try my best 🙏

@philvarner
Copy link
Contributor Author

thanks @philvarner really appreciate your time on this.

I won't have a lot of time to spend on this but I'll try my best 🙏

@vincentsarago thanks! I'm mostly looking for support for Python 3.13 right now. Can you tag master to trigger the build and push of the new images for the newer Python versions?

GDAL 3.9 and 3.10 are failing to build, so that will require more investigation, and I don't think I'll be able to do that soon.

@philvarner
Copy link
Contributor Author

@vincentsarago after further work, I'm not certain the python 3.11 and 3.12 images are going to work. The docker containers for these use al2023 instead of al2, which is why the builds use dnf instead of yum. I don't know if all of the packages built on al2 will work in al2023, so we should test this thoroughly -- which I doubt either of us has time for right now :(

@jimjam-slam
Copy link

Hi there! My team is currently building GDAL 3.11 with numpy 2.3.2 on AL2023. We're doing it for Docker container Lambdas, but I'm considering moving back to a Lambda layer for GDAL at some point if it's feasible.

We're currently using the following in our Dockerfile to build GDAL:

ARG PYTHON_VERSION=3.13

FROM public.ecr.aws/lambda/python:${PYTHON_VERSION}

# important system deps:
# - gdal (via extra packages for enterprise linux)
# - c++ compiler (for numpy)

RUN dnf update -y && \
    dnf install -y gcc gcc-c++ wget cmake proj-devel sqlite-devel tar libcurl-devel libtiff-devel libpng-devel libjpeg-devel libxml2-devel zlib-devel pkgconfig && \
    dnf clean all

# build gdal from source
RUN wget https://github.com/OSGeo/gdal/releases/download/v3.11.0/gdal-3.11.0.tar.gz && \
    tar -xzf gdal-3.11.0.tar.gz && \
    cd gdal-3.11.0 && \
    mkdir build && cd build && \
    cmake .. -DCMAKE_INSTALL_PREFIX=/usr && \
    make -j$(nproc) && \
    make install && \
    cd ../.. && rm -rf gdal-3.11.0*

# [... other parts of our docker build]

# make GDAL available at runtime
ENV LD_LIBRARY_PATH="/usr/lib:/usr/lib64:$LD_LIBRARY_PATH"

Not sure if this is where you're blocked or if this will help, but if it does, great! We'd certainly be interested in getting off Docker if we could, so your layers would be super helpful (but I'm not sure we can go back to Numpy 1.x!) 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants