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 f62f186
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 77 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
22 changes: 2 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,16 @@ RUN \

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.
# 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]; \
fi
&& uv pip install --system ${WHEEL}[bufr,cratedb,duckdb,explorer,export,influxdb,interpolation,postgresql,radar,radarplus,restapi]


# Final stage
Expand All @@ -56,6 +41,3 @@ RUN apt-get update \
# Copy installed pip packages from build stage
COPY --from=build /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
COPY --from=build /usr/local/bin /usr/local/bin

# by default start restapi, also need this for sliplane atm
CMD [ "wetterdienst", "restapi", "--listen=0.0.0.0:10000"]
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 f62f186

Please sign in to comment.