Skip to content

Commit

Permalink
missing DWD's grib definitions added
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardRosert committed Aug 7, 2020
1 parent 3268ab2 commit 970a949
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ RUN set -ex \
&& pip install -e . \
&& python builder.py

# Download and unpack DWD GRIB tables for ecCodes
ARG DWD_GRIB_DEFINITIONS_VERSION=2.12.5-2
RUN set -ex \
&& mkdir -p /dwd/ \
&& cd /dwd/ \
&& wget -O dwd_eccodes_definitions.tar.gz https://opendata.dwd.de/weather/lib/grib/eccodes_definitions.edzw-${DWD_GRIB_DEFINITIONS_VERSION}.tar.gz \
&& tar -xvf dwd_eccodes_definitions.tar.gz \
&& mv definitions.edzw-${DWD_GRIB_DEFINITIONS_VERSION} /usr/local/share/eccodes/

# Configure ecCodes to use DWD's GRIB definitions
ENV ECCODES_DEFINITION_PATH=/usr/local/share/eccodes/definitions.edzw-${DWD_GRIB_DEFINITIONS_VERSION}:/usr/local/share/eccodes/definitions/

# Remove unneeded files.
RUN set -ex \
&& find /usr/local -name 'lib*.so' | xargs -r -- strip --strip-unneeded || true \
Expand All @@ -130,7 +142,7 @@ FROM debian:stable-slim

# Install run-time depencencies.
# Delete resources after installation
RUN set -ex \
RUN set -ex \
&& apt-get update \
&& apt-get install --yes --no-install-suggests --no-install-recommends \
libopenjp2-7-dev \
Expand All @@ -146,6 +158,10 @@ COPY --from=build /src/eccodes-python/ /src/eccodes-python/
RUN set -ex \
&& /sbin/ldconfig

# Configure ecCodes to use DWD's GRIB definitions
ARG DWD_GRIB_DEFINITIONS_VERSION=2.12.5-2
ENV ECCODES_DEFINITION_PATH=/usr/local/share/eccodes/definitions.edzw-${DWD_GRIB_DEFINITIONS_VERSION}:/usr/local/share/eccodes/definitions/

# Configure Python runtime.
ENV \
PYTHONDONTWRITEBYTECODE=1 \
Expand Down
1 change: 1 addition & 0 deletions hooks/build
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ docker build \
--build-arg ECBUILD_VERSION=${ECBUILD_VERSION} \
--build-arg ECCODES_VERSION=${ECCODES_VERSION} \
--build-arg PYTHON_ECCODES_VERSION=${PYTHON_ECCODES_VERSION} \
--build-arg DWD_GRIB_DEFINITIONS_VERSION=${DWD_GRIB_DEFINITIONS_VERSION} \
--build-arg PYTHON_VERSION=${PYTHON_VERSION} \
--build-arg BUILD_DATE=${DATE} \
--build-arg VCS_URL=${SOURCE_URL} \
Expand Down
1 change: 1 addition & 0 deletions hooks/env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[ -n "$DOCKER_REPO" ] || DOCKER_REPO=deutscherwetterdienst/python-eccodes
[ -n "$ECBUILD_VERSION" ] || ECBUILD_VERSION="3.3.2"
[ -n "$ECCODES_VERSION" ] || ECCODES_VERSION="2.18.0"
[ -n "$DWD_GRIB_DEFINITIONS_VERSION" ] || DWD_GRIB_DEFINITIONS_VERSION="2.12.5-2"
[ -n "$PYTHON_ECCODES_VERSION" ] || PYTHON_ECCODES_VERSION="0.9.8"
[ -n "$PYTHON_VERSION" ] || PYTHON_VERSION="3.7.8"

Expand Down

0 comments on commit 970a949

Please sign in to comment.