Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to get docker image building on a GDAL 3.9 base. #1587

Merged
merged 8 commits into from
May 31, 2024
3 changes: 0 additions & 3 deletions datacube/utils/geometry/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,9 +853,6 @@ def multipoint(coords: CoordList, crs: MaybeCRS) -> Geometry:
"""
Create a 2D MultiPoint Geometry

>>> multipoint([(10, 10), (20, 20)], None)
Geometry(MULTIPOINT (10 10, 20 20), None)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails - looks like shapely has changed the str representation of multipoint geometries.

:param coords: list of x,y coordinate tuples
"""
return Geometry({'type': 'MultiPoint', 'coordinates': coords}, crs=crs)
Expand Down
39 changes: 23 additions & 16 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
##
## This file is part of the Open Data Cube, see https://opendatacube.org for more information
##
## Copyright (c) 2015-2020 ODC Contributors
## Copyright (c) 2015-2024 ODC Contributors
## SPDX-License-Identifier: Apache-2.0
##
FROM ghcr.io/osgeo/gdal:ubuntu-small-latest
ARG V_PG=14
ARG V_PGIS=14-postgis-3
# gdal:ubuntu-small no longer comes with netcdf support compiled into gdal
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.9.0 as builder
FROM ghcr.io/osgeo/gdal:ubuntu-full-3.9.0
ARG V_PG=16
ARG V_PGIS=16-postgis-3

# Update and install Ubuntu packages

Expand All @@ -17,7 +19,8 @@ RUN apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-change-held-packages --fix-missing --no-install-recommends \
git \
libpq-dev libudunits2-dev libproj-dev \
python3-dev python3-distutils python3-pip \
libhdf5-dev libnetcdf-dev libgeos-dev libudunits2-dev \
python3-dev virtualenv \
build-essential \
postgresql \
redis-server \
Expand All @@ -30,21 +33,29 @@ RUN apt-get update -y \

# Build constrained python environment

RUN virtualenv /env
ENV PYENV /env
ENV GDAL_CONFIG /usr/bin/gdal-config

# Needed to build cf-units wheels.
ARG UDUNITS2_XML_PATH=/usr/share/xml/udunits/udunits2-common.xml

# Set the locale, this is required for some of the Python packages
ENV LC_ALL C.UTF-8

COPY docker/constraints.in /conf/requirements.txt
COPY docker/constraints.txt docker/nobinary.txt /conf/


RUN python3 -m pip install \
-r /conf/requirements.txt \
-c /conf/constraints.txt
RUN . /env/bin/activate && python3 -m pip install --upgrade pip setuptools
RUN . /env/bin/activate && python3 -m pip install -r /conf/requirements.txt \
-c /conf/constraints.txt \
-c /conf/nobinary.txt

# Copy datacube-core source code into container and install from source (with addons for tests).
COPY . /code

RUN python3 -m pip install '/code/[all]' \
RUN . /env/bin/activate && python3 -m pip install '/code/[all]' \
&& python3 -m pip install /code/examples/io_plugin \
&& python3 -m pip install /code/tests/drivers/fail_drivers

Expand All @@ -56,16 +67,12 @@ RUN install --owner postgres --group postgres -D -d /var/run/postgresql /srv/po
&& sudo -u postgres "$(find /usr/lib/postgresql/ -type f -name initdb)" -D "/srv/postgresql" --auth-host=md5 --encoding=UTF8

# users and groups.
RUN groupadd --gid 1000 odc \
&& useradd --gid 1000 \
--uid 1000 \
--create-home \
--shell /bin/bash -N odc \
RUN groupmod ubuntu -n odc \
&& usermod ubuntu -l odc \
&& adduser odc users \
&& adduser odc sudo \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& install -d -o odc -g odc /env \
&& install -d -o odc -g odc /code \
&& chown -R odc:odc /env \
&& true

USER root
Expand Down
3 changes: 2 additions & 1 deletion docker/assets/with_bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ launch_db () {
local bin=$(find /usr/lib/postgresql/ -type d -name bin)

[ -e "${pgdata}/PG_VERSION" ] || {
sudo -u postgres "${bin}/initdb" -D "${pgdata}" --auth-host=md5 --encoding=UTF8
sudo -u postgres "${bin}/initdb" -A -D "${pgdata}" --auth-host=md5 --encoding=UTF8
}

sudo -u postgres "${bin}/pg_ctl" -D "${pgdata}" -l "${pgdata}/pg.log" start
Expand Down Expand Up @@ -79,6 +79,7 @@ env="${PYENV:-/env}"

if [ -e "${env}/bin/activate" ]; then
[ -n "${VIRTUAL_ENV:-}" ] || {
echo "Activating virtual environment"
source "${env}/bin/activate"

# if there is no .egg-info then we need to install in
Expand Down
40 changes: 29 additions & 11 deletions docker/constraints.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,57 @@ attrs>=18.1
boto3>1.17.0
bottleneck
cachetools
# For Python 3.12 support
cf-units>3.1.1
# For Python 3.12 support
cffi>=1.16.0
ciso8601
click>=8.0
cloudpickle>=0.4
compliance-checker>=4.0.0,<5
# For Python 3.12 support
compliance-checker>=5.1.0
dask>=2021.10.1
distributed>=2021.10.0
fiona
geoalchemy2
# For Python 3.12 support
greenlet>=3.0.3
# New reference resolution API
jsonschema>=4.18
lark
# For Python 3.12 support
lxml>=5.0.0
matplotlib
moto
moto<5
netcdf4>=1.5.8
numpy>=1.22.2
# 1.26.0 is the first version to support Python 3.12
numpy>=1.26.0
pandas>=2.0
# For Python 3.12 support
pendulum>=3.0
psycopg2
pycodestyle
pylint
pyproj>=2.5
# For Python 3.12 support
pyproj>=3.5
python-dateutil
pyyaml
rasterio>=1.3.2
# For Python 3.12 support
pyyaml>=6.0.1
# For Python 3.12 support
rasterio>=1.3.9
# For Python 3.12 support
typing-extensions>=4.7
recommonmark
redis
ruamel.yaml
shapely>=2.0
# cython3 support
shapely>=2.0.2
sphinx-click
sphinx_autodoc_typehints
sphinx_rtd_theme
sqlalchemy<2.0
toolz
# For Python 3.12 support
wrapt>=1.16.0
xarray>=0.9

# Previous pins were to very old versions
Expand All @@ -48,9 +67,8 @@ hypothesis>=6
pytest-httpserver
pytest-timeout

# every new version finds new errors, so we pin it (so old though!)
pylint==2.4.4
pycodestyle==2.5.0
pylint>=3
pycodestyle

# for packaging
setuptools>=42
Expand Down
Loading
Loading