diff --git a/.github/workflows/acousticDE.yml b/.github/workflows/acousticDE.yml index 5043b35..50a0ce0 100644 --- a/.github/workflows/acousticDE.yml +++ b/.github/workflows/acousticDE.yml @@ -47,4 +47,4 @@ jobs: - name: Build Docker Image run: | - docker build -f de_method/Dockerfile . --platform=linux/amd64 -t de-method-test:latest + docker build -f de_method/Dockerfile . -t de-method-test:latest diff --git a/de_method/Dockerfile b/de_method/Dockerfile index 5868c81..c213cd2 100644 --- a/de_method/Dockerfile +++ b/de_method/Dockerfile @@ -9,8 +9,15 @@ RUN apt-get update && apt-get install -y \ git \ build-essential \ gmsh \ + libgmsh-dev \ + python3-gmsh \ && rm -rf /var/lib/apt/lists/* +# Make system python3-gmsh available to the pip environment +# This creates a symlink so pip-installed packages can import gmsh +RUN SITE_PACKAGES=$(python -c "import site; print(site.getsitepackages()[0])") && \ + ln -sf /usr/lib/python3/dist-packages/gmsh* "$SITE_PACKAGES/" + # Copy method package directory COPY de_method /app/de_method diff --git a/pyroomacoustics_method/Dockerfile b/pyroomacoustics_method/Dockerfile index 11339fe..5126d91 100644 --- a/pyroomacoustics_method/Dockerfile +++ b/pyroomacoustics_method/Dockerfile @@ -1,16 +1,23 @@ -# Use Python 3.11 as base image to match the main backend -FROM python:3.11.13-slim - -# Set working directory -WORKDIR /app +# Use Python 3.11 slim image for smaller size +FROM python:3.11-slim # Install system dependencies for mesh generation and scientific computing RUN apt-get update && apt-get install -y \ git \ build-essential \ gmsh \ + libgmsh-dev \ + python3-gmsh \ && rm -rf /var/lib/apt/lists/* +# Make system python3-gmsh available to the pip environment +# This creates a symlink so pip-installed packages can import gmsh +RUN SITE_PACKAGES=$(python -c "import site; print(site.getsitepackages()[0])") && \ + ln -sf /usr/lib/python3/dist-packages/gmsh* "$SITE_PACKAGES/" + +# Set working directory +WORKDIR /app + # Copy method package COPY pyroomacoustics_method /app/pyroomacoustics_method @@ -19,5 +26,5 @@ RUN pip install --no-cache-dir /app/pyroomacoustics_method WORKDIR /app/pyroomacoustics_method -# Default command to run the containerized DE method +# Call pyroomacoustics cli when the container starts CMD ["python", "-m", "pyroomacoustics_interface"] diff --git a/pyroomacoustics_method/pyproject.toml b/pyroomacoustics_method/pyproject.toml index f1f31d3..7c1b888 100644 --- a/pyroomacoustics_method/pyproject.toml +++ b/pyroomacoustics_method/pyproject.toml @@ -27,7 +27,6 @@ classifiers = [ ] dependencies = [ "numpy>=1.23.0", - "gmsh", "pyroomacoustics>=0.8.0", "requests", "pyfar>=0.8.0", @@ -50,6 +49,7 @@ tests = [ "watchdog", "ruff", "coverage", + "gmsh", ] docs = [