-
Notifications
You must be signed in to change notification settings - Fork 66
Dockerfiles to build both with and without conda #992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Conversation
|
|
||
| WORKDIR /cardinal-build/cardinal | ||
|
|
||
| ENV LIBMESH_JOBS=16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to be accelerating the build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you also need to set JOBS and MOOSE_JOBS to accelerate a full build from source. From my understanding update_and_rebuild_libmesh.sh overrides LIBMESH_JOBS in a few instances with those environment variables when building libMesh from source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That definitely made a difference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nuclearkevin thanks for this clarification! I updated the documentation (#994) to make sure its comprehensive.
| RUN conda init --all | ||
|
|
||
| RUN conda update --all --yes && \ | ||
| conda config --add channels https://conda.software.inl.gov/public && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume INL has plans to create a conda package for Cardinal, as I noticed a repo is already available. I wonder when it will be released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@loganharbour can maybe answer this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file can be removed. It's actually not used.
We release every master commit of cardinal as a built container in https://hub.docker.com/r/idaholab/cardinal/tags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, this file is being considered as a contribution - it doesn't exist yet and thus there is nothing to remove...
I made this PR because some folks may want to build their own docker images for development purposes, and this provides a shortcut to figuring out those steps. Do you share the Dockerfile used to build the images shared on Docker Hub?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my apologies. I responded to this from an e-mail and didn't capture any of the PR context.
https://hub.docker.com/repository/docker/idaholab/moose-dev/tags is the development base for all MOOSE-based applications (including cardinal). It contains compiled libmesh, petsc, wasp, and the moose-tools conda package for the needed python libraries.
This is the base image (ported from apptainer) used for CI testing of all MOOSE based apps, and also for released installed versions of all apps. We typically prefer that people start with this as it is easier for us to support issues with an environment that we are familiar with.
The version of the moose-dev image to use given an application is determined by running
scripts/versioner.py moose-dev
within the moose directory of the application.
|
What is the status of this PR? |
|
@aprilnovak asked today about cross sections and the OpenMC python API. In the past, I've used something like for cross sections, but mounting would be another option. This only needs to happen once per successful build of this step, so it is probably fine enough to just I think installing the python API is as simple as where at the end (may require some finagling with the nndc cross sections) |
lewisgross1296
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things I noticed when I went to build Cardinal with a Dockerfile
| # adding these shell arguments ensures that conda is properly instantiated | ||
| # with each invocation of the shell | ||
| SHELL ["/bin/bash", "-i", "-c"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing out this Dockerfile for myself. These lines seem harmless here, since Docker defaults to
SHELL ["/bin/bash", "-c"]
and adding the "-i" allows this
-i Specify that the shell is interactive; see below. An
implementation may treat specifying the -i option as an
error if the real user ID of the calling process does
not equal the effective user ID or if the real group ID
does not equal the effective group ID.
but the comment implies that they're included for conda and this is the from source Dockerfile. I think we should either use the default (remove these lines) or change the comment to explain why this is needed in the from source build.
| RUN export HDF5_ROOT=${PETSC_DIR} && \ | ||
| export PATH=/opt/miniforge3/envs/moose/bin:$PATH && \ | ||
| export NEKRS_HOME=/cardinal-build/cardinal/install && \ | ||
| make -j 16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should make the -j 16 an argument since some people will have more or less CPUs available
These dockerfiles will build Cardinal according to the typical installation instructions, within an Ubuntu 24.04 docker image.