Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Python-generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info

# Virtual environments
.venv

temp/*
outputs
*_cache*

# Ignore environment and config secrets
.env
53 changes: 53 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Start from a CUDA-enabled base image with Python
FROM nvidia/cuda:12.6.1-base-ubuntu24.04

# Avoid running as root user for security
RUN groupadd -r fullwave && useradd -m -g fullwave fullwave

# Set working directory
WORKDIR /app

# Install system dependencies (build essentials, CUDA dev libs, etc.)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3 python3-pip python3-venv \
git build-essential make curl ca-certificates \
libgl1-mesa-dev ffmpeg libsm6 libxext6 && \
rm -rf /var/lib/apt/lists/*


# ---- install uv package manager ----
# Download the latest installer
ADD https://astral.sh/uv/install.sh /uv-installer.sh

# Run the installer then remove it
RUN sh /uv-installer.sh && rm /uv-installer.sh

# Ensure the installed binary is on the `PATH`
ENV PATH="/root/.local/bin/:$PATH"
ENV PATH="/app/.venv/bin:$PATH"

# ----
# RUN curl -LsSf https://astral.sh/uv/install.sh | sh

COPY pyproject.toml ./
COPY uv.lock ./
COPY Makefile ./

# Copy the project into the image
ADD . /app

# Sync the project into a new environment, asserting the lockfile is up to date
RUN uv sync --all-extras

# Install Python dependencies efficiently
RUN uv run pre-commit install

# Set permissions for non-root user
RUN chown -R fullwave:fullwave /app

# Switch to user, preserve CUDA access
USER fullwave

# Specify default runtime arguments for simulation (override as needed)
CMD ["/bin/bash", "-c", "source /app/.venv/bin/activate && pytest"]
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,36 @@ Please see the following examples for more advanced usage.
- Please write clear and concise commit messages.
- please see [CONTRIBUTING.md](CONTRIBUTING.md) for more details.

### Dockerfile usage

- A Dockerfile is provided for easy setup of the Fullwave 2.5 environment.
- To build the Docker image, run the following command in the terminal from the root directory of the repository:

```sh
docker build -t fullwave25:latest .
```

- The command below runs pytest to verify the installation inside the Docker container:

```sh
docker run --gpus all fullwave25:latest
```

- To run a container from the built image, use the following command:

```sh
docker run --gpus all -it --rm --name fullwave_container fullwave25:latest /bin/bash
```

- Inside the container, you can run the example simulations. For instance, to run the simple plane wave example, execute:

```sh
source /app/.venv/bin/activate
python3 /app/examples/simple_plane_wave/simple_plane_wave.py
```

- For a persistent container that retains data after exiting, please refer to [Dockerdocs: Persisting container data](https://docs.docker.com/get-started/docker-concepts/running-containers/persisting-container-data/)

---

## Maintainers
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.