Skip to content

Commit

Permalink
Docker: Add platform linux/arm/v7
Browse files Browse the repository at this point in the history
  • Loading branch information
gutzbenj committed Jan 19, 2025
1 parent e5e06c6 commit e91d1cb
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64 # TODO: add linux/arm/v7
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Development

### Feature
- Docker: Add platform `linux/arm/v7`

## 0.102.0 - 2025-01-17

### Feature
Expand Down
30 changes: 13 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,30 @@ RUN \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests --yes \
git build-essential python3-dev python3-pip python3-venv python3-wheel \
python3-h5py ca-certificates pkg-config libhdf5-dev
python3-h5py ca-certificates pkg-config libhdf5-dev curl

RUN pip install uv

# Install wradlib.
RUN uv pip install --system wradlib
# linux/arm/v7
# install rust, required to build fastexcel
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN pip install uv

# Install Wetterdienst.

# Use `poetry build --format=wheel` to build wheel packages into `dist` folder.
# Use previously built wheel package.
COPY dist/wetterdienst-*.whl /tmp/

# Install package.
# Pick latest wheel package from `/tmp` folder.
RUN --mount=type=cache,id=pip,target=/root/.cache/pip \
true \
&& WHEEL=$(ls -r /tmp/wetterdienst-*-py3-none-any.whl | head -n 1) \
&& uv pip install --system versioningit \
&& uv pip install --system ${WHEEL}[bufr,cratedb,duckdb,explorer,influxdb,interpolation,postgresql,radar,radarplus,restapi]

# TODO: for linux/arm64 we currently cant install zarr as it depends on numcodecs which has no wheels
# and building it from source takes too long
# see also: https://github.com/zarr-developers/numcodecs/issues/288
RUN WHEEL=$(ls -r /tmp/wetterdienst-*-py3-none-any.whl | head -n 1) && \
if [ "$(uname -m)" = "x86_64" ]; then \
uv pip install --system ${WHEEL}[export]; \
else \
uv pip install --system ${WHEEL}[export_without_zarr]; \
&& if [ "$(uname -m)" = "x86_64" ]; then \
uv pip install --system ${WHEEL}[bufr,cratedb,duckdb,explorer,export,influxdb,interpolation,postgresql,radar,radarplus,restapi]; \
elif [ "$(uname -m)" = "aarch64" ]; then \
uv pip install --system ${WHEEL}[bufr,cratedb,duckdb,explorer,export_without_zarr,influxdb,interpolation,postgresql,radar,radarplus,restapi]; \
elif [ "$(uname -m)" = "armv7l" ]; then \
uv pip install --system ${WHEEL}; \
fi


Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ mysql = [
"pandas>=2,<3",
]
postgresql = [
"psycopg2-binary>=2,<3",
"psycopg[binary]>=3.2.4,<4",
]
postgresql_python = [
"psycopg>=3.2.4,<4",
]
radar = [
"h5py>=3.1,<4",
Expand Down
Loading

0 comments on commit e91d1cb

Please sign in to comment.