Skip to content

Bake PHOLD into the Docker image - #149

Open
bnmajor wants to merge 5 commits into
mainfrom
ross-as-dep
Open

Bake PHOLD into the Docker image#149
bnmajor wants to merge 5 commits into
mainfrom
ross-as-dep

Conversation

@bnmajor

@bnmajor bnmajor commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator
  • _ingest_output_files now marks the run FAILED when zero expected output files are found, instead of silently completing with no data.
  • added a "ross-builder" stage that clones ROSS at a pinned commit and compiles PHOLD against OpenMPI; the final image copies just the compiled binary to /opt/ross/phold.
  • removed the ${ROSS_PATH:-../ross} bind mounts
  • removed ROSS_PATH

@bnmajor
bnmajor marked this pull request as ready for review August 19, 2026 19:11
@bnmajor
bnmajor requested review from marySalvi and waxlamp August 19, 2026 19:11
waxlamp
waxlamp previously approved these changes Aug 26, 2026

@waxlamp waxlamp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to build this branch (with the help of the changes in the container-rev-matching branch) and the changes make sense to me.

Comment thread dev/.env.docker-compose

# Directory for PHOLD output files
# DJANGO_PHOLD_OUTPUT_DIR=/tmp/phold_output
DJANGO_PHOLD_OUTPUT_DIR=/tmp/phold_output

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is /tmp the right place to store output?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it's the right place, but I can't see a reason why it's the wrong choice either. It's purely a temporary staging location before the parsed data lands in object storage. This does draw my attention to the fact that we do not have a cleanup step though, so in theory /tmp/phold_output could grow unbounded... I think it would make sense to handle that after _ingest_output_file succeeds so we don't keep these files around after we've ingested the results.

Comment thread dev/.env.docker-compose

# Number of MPI processes for PHOLD simulations (set to 1 for no MPI)
# DJANGO_PHOLD_MPI_PROCESSES=4
DJANGO_PHOLD_MPI_PROCESSES=4

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why set this at the Django settings level (rather than let it be part of the run configuration)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question. Do we want to expose this to users? Initially this was the easiest way to get things up and running, and I didn't really consider exposing it because I wasn't sure if we wanted users to have to think about this. Maybe if we don't expose it we do something a little smarter to detect available resources and set a reasonable value, or we just skip that and expose it to users as a part of the run configuration. What do you think?

Comment thread dev/django.Dockerfile Outdated
Comment on lines +1 to +28
# Pin to a specific ROSS commit for reproducible builds.
ARG ROSS_GIT_REF=dc3a6a056cfc7a5e68f7141f88d8833407599ef8

FROM ubuntu:24.04 AS ross-builder
ARG ROSS_GIT_REF

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
git \
build-essential \
cmake \
openmpi-bin \
libmpich-dev \
libopenmpi-dev \
&& rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/ross-org/ross.git /ross \
&& cd /ross \
&& git checkout "${ROSS_GIT_REF}" \
&& git submodule update --init --recursive

RUN cmake -S /ross -B /ross/build \
-DCMAKE_BUILD_TYPE=Release \
-DROSS_BUILD_MODELS=ON \
-DROSS_BUILD_TESTING=OFF \
&& cmake --build /ross/build --parallel


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why build ROSS in a separate image and copy the binary over to the "main" image? Is it to keep future such builds independent of the main image, so that the order of building them doesn't create artificial dependencies for the main image build?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, essentially. Without the split the containers would have the full build toolchain and the ROSS code, none of which is needed at runtime. Of course this also has the advantage of preventing cache invalidation and rebuilding when an unrelated change is made to one stage or the other.

Comment on lines +340 to +342
mark_run_failed(
None, RuntimeError("No PHOLD output files were produced"), None, run_id=run.id
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My own curiosity: why is None being passed for the request and traceback arguments here? That might indicate that this function is being asked to do different jobs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct - this is a case where we should probably extract the actual logic for status updating into a helper so that it is called both here and by Celery (which is what this signature was designed around and is why we're passing None). I'll make that update!

Comment thread dev/docker-development.md Outdated

## Setup
1. **Configure simulation paths**: Set `ROSS_PATH` and PHOLD settings in `dev/.env.docker-compose`
1. **Configure simulation settings** (optional): PHOLD settings in `dev/.env.docker-compose`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. **Configure simulation settings** (optional): PHOLD settings in `dev/.env.docker-compose`.
1. **Configure simulation settings** (optional): Review and change PHOLD settings in `dev/.env.docker-compose`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants