Skip to content

openfoam:v2406-ubuntu24.04#83

Open
AlexisEspinosaGayosso wants to merge 4 commits into
masterfrom
feature/openfoam-v2406
Open

openfoam:v2406-ubuntu24.04#83
AlexisEspinosaGayosso wants to merge 4 commits into
masterfrom
feature/openfoam-v2406

Conversation

@AlexisEspinosaGayosso
Copy link
Copy Markdown
Collaborator

New recipe. For building:
openfoam:v2406-ubuntu24.04

This is a new recipe, but in comparison with other recipes this one has a few differences:

  • Use of several stages (FROM ... AS )
  • Use of "global" arguments defined at the top of the Dockerfile (and recall of them in each of the stages)
  • Use of LABELs
  • The docker and singularity on-entry scripts are now created from two template files that are COPY-ed into the image and then updated
  • The Dockerfile and the two template scripts are backed up into an internal directory in the image

More detailed information is in the README.md file.

Building and testing has been performed with success. We are using some auxiliary scripts to assist the workflow. The use of these scripts is also explained with more detail in the README.md file.

The building and testing procedure from the podman nodes was:

  1. Go to the recipe directory
git clone git@github.com:PawseySC/pawsey-containers.git
cd pawsey-containers
git switch --track origin/feature/openfoam-v2406
cd setonix/applications/OpenFOAM/openfoam/v2406
  1. cd to the buildingScripts directory and build the docker image:
cd buildingScripts
./containerBuild.sh --engine podman

output:

...
======================================================
containerBuild.sh: FINAL SUMMARY
======================================================
Total steps run: 14
✓ ALL STEPS PASSED! Image 'openfoam:v2406-ubuntu24.04' was built successfully.
  1. Perform basic test of the docker image:
 ../functionalTests/basic/basicTests.sh --engine podman openfoam:v2406-ubuntu24.04

output:

...
======================================================
basicTests.sh: FINAL SUMMARY
======================================================
Total steps run: 5
✓ ALL STEPS PASSED! Image 'openfoam:v2406-ubuntu24.04' with podman looks good at minimal testing.
  1. Build the singularity image:
./singularityBuild.sh --engine podman

output:

...
======================================================
singularityBuild.sh: FINAL SUMMARY
======================================================
Total steps run: 8
✓ ALL STEPS PASSED! Image '/scratch/pawsey0001/espinosa/singularity/images/openfoam_v2406-ubuntu24.04.sif' was built succesfully.
  1. Perform basic test of the singularity image:
../functionalTests/basic/basicTests.sh --engine singularity $MYSCRATCH/singularity/images/openfoam_v2406-ubuntu24.04.sif

output:

======================================================
basicTests.sh: FINAL SUMMARY
======================================================
Total steps run: 5
✓ ALL STEPS PASSED! Image '/scratch/pawsey0001/espinosa/singularity/images/openfoam_v2406-ubuntu24.04.sif' with singularity looks good at minimal testing.
  1. Perform execution test of singularity image (compilation test):
cd ../functionalTests/setonix/compileMyTool
sbatch runCompile.sh

output from (tail slurm-1234.out):

Using: OpenFOAM-v2406 (2406) - visit www.openfoam.com
Build: _630d60de3b-20240620
Arch:  LSB;label=32;scalar=64


Checking output:
Correct ✓: myIcoFoam showed Usage message

runCompile.sh: Done
  1. Perform execution test of singularity image (running case):
    A.Extract the tutorial case:
cd ../tutorialCase
./extractCase

output:

...
Image to use: /scratch/pawsey0001/espinosa/singularity/images/openfoam_v2406-ubuntu24.04.sif
Copying:
Internal Tutorial: /opt/OpenFOAM/OpenFOAM-v2406/tutorials/incompressible/pimpleFoam/LES/periodicPlaneChannel
Target Case: /scratch/pawsey0001/espinosa/OpenFOAM/espinosa-v2406/run/periodicPlaneChannel
extractCase.sh: Done

B.Decompose case:

sbatch preFoam.sh

output (from tail slurm-1234.out):

...
Checking collated processor directories ...
processors4_0-1 exists ✓
processors4_2-3 exists ✓
Collated processor directories check: OK
preFoam.sh: Done

C. Execute the case:

sbatch runFoam.sh

output (from tail -20 slurm-1234.out):

0: time step continuity errors : sum local = 8.48331e-06, global = -2.20417e-19, cumulative = 1.46406e-15
0: Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 4.48647e-05
0: GAMG:  Solving for p, Initial residual = 0.0166273, Final residual = 6.73934e-07, No Iterations 5
0: time step continuity errors : sum local = 4.27078e-10, global = -1.67975e-19, cumulative = 1.46389e-15
0: Pressure gradient source: uncorrected Ubar = 0.1335, pressure gradient = 4.48459e-05
0: ExecutionTime = 161.36 s  ClockTime = 162 s
0: 
0: fieldAverage fieldAverage1 write:
0:     Calculating averages
0: 
0:     Writing average fields
0: 
0: End
0: 
0: Finalising parallel run
Running post-run checks on log.pimpleFoam.41859929...
Correct ✓: Simulation reached Time = 1000
Correct ✓: ExecutionTime = 161.36s is in range. (Less than maxExecTime=200s)
Correct ✓: UxLastInitialResidual = 0.0116483 is in range. (Less than maxUxLastInitialResidual=0.012)
runFoam.sh: Done

Main difference with previous style:
 - The Dockerfile has been refactored with the use of Stages.
 - The Dockerfile now includes a COPY of the dockerfile together with all
   the files called during building
 - As in previous versions, the OpenFOAM environment is set by a
   "startup" script that sources the OpenFOAM bashrc.
   This works for Docker and Singularity.
 - The Docker Entrypoint Script is now created by COPYing a template
   that exists next to the Dockerfile. After COPY, the template tags are
   replaced with the correct values for the version being built.
 - The Singularity environment script is also created by COPYing a
   template and replacing the tags with the correct values for the
   version being built.
 - The Docker ENTRYPOINT instruction has been changed to directly execute a
   specific Docker Entrypoint Script instead of the complicated previous
   setup.
 - The Singularity environment script is still placed in
   /.singularity.d/env
 - The directory "functionalTests" contains scripts for testing
   functionality of the Singularity image on Setonix
 - The directory "auxiliaryScripts" contains scripts that were useful
   for the developing of the Dockerfile. There are scripts for intermediate testing of ideas and
   troubleshooting of problems found on the way. These scripts are not
   necessarily well documented and are not expected to be maintained or
   reviewed. But will be kept for possible future use or reference.
- Building and testing scripts are provided
- Some small changes were made on the openfoam-v2406.dockerfile
This also includes:
- Minimal updates to the Dockerfile
- Minimal updates to the testing scripts
- Minimal updates to the checking commands in each of the test Steps
@AlexisEspinosaGayosso
Copy link
Copy Markdown
Collaborator Author

@Me-Basha , can you be the main reviewer? This means to perform detailed review and testing of the container. Thanks.

@Me-Basha
Copy link
Copy Markdown
Collaborator

yes, I can.

Copy link
Copy Markdown
Collaborator

@Me-Basha Me-Basha left a comment

Choose a reason for hiding this comment

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

looks good, I reran all the steps sucessfully.

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