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 18, 2025
1 parent e5e06c6 commit 9f0f6ed
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 64 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
21 changes: 14 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@ 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 libpq-dev

# Install uv for faster pip installs.
RUN pip install uv

# Install wradlib.
RUN uv pip install --system wradlib

# Install Wetterdienst.

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

# Install package.
Expand All @@ -30,7 +27,17 @@ 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]
&& uv pip install --system ${WHEEL}[bufr,cratedb,duckdb,explorer,influxdb,interpolation,radar,radarplus,restapi]

# under linux/arm/v7 install postgresql_python else postgresql
RUN if [ "$(uname -m)" = "armv7l" ]; then \
apt-get install --no-install-recommends --no-install-suggests --yes libpq-dev; \
uv pip install --system ${WHEEL}[postgresql_python]; \
else \
apt-get install --no-install-recommends --no-install-suggests --yes libpq-dev; \
uv pip install --system ${WHEEL}[postgresql]; \
fi


# 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
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 9f0f6ed

Please sign in to comment.