How bioexcel/gromacs-docker works
Main Components
• Build Stages / Containers: Illustrate the three-part process described in the README:
– An initial container build stage that creates an optimized FFTW-enabled container.
– Multiple job matrix stages that invoke generate_specifications_file.py to produce SIMD-specific GROMACS builds.
– The final stage, where a new Docker container is assembled by copying the optimised containers (one per SIMD type) into a single unified image.
• Core Tools and Scripts:
– The Dockerfile that is used to build the main container.
– The “gmx-chooser” script which detects CPU features (AVX/SSE) and selects the appropriate binary at runtime.
– “gromacs-hpccm-recipes-mult-stages” which provides specifications and multi-stage recipes – showcasing the modular design.
• External Dependencies and Integration Points:
– NVIDIA’s CUDA runtime (from the nvidia/cuda base image) used to provide GPU acceleration.
– Docker Hub integration to push the final images.
– GitHub repository integrations (e.g. CI workflows that trigger on pull requests or commits).
Relationships and Interactions
• Data Flow and Dependencies:
– Next, show how each SIMD-specific container is created and tagged (using the naming convention “gmx-GROMACS_version-cuda-CUDA_version-SIMD_type”).
– Finally, illustrate how these containers are merged into a consolidated Docker container.
• Conditional Decisions:
– Illustrate the “gmx-chooser” operating at runtime, using hardware detection (CPU SIMD flags) to select the proper GROMACS binary for execution.
• External Interactions:
– Represent external repositories like Docker Hub and external dependencies (CUDA, FFTW, OpenMPI etc.) as external blocks.
Architectural Patterns/Design Principles
• Multi-Stage Builds: Emphasize the separation into distinct stages (building base, specialized builds, final image assembly).
• CI/CD-Driven Container Deployment: Highlight the automation via GitHub Actions which parameterizes builds using a job matrix.
• Hardware Acceleration Considerations: Show that the system detects hardware capabilities at runtime via “gmx-chooser” to optimize performance.
• Modular and Configurable: Note the reliance on configurable variables (e.g., SIMD types) in the workflow file which provides flexibility in the build process.
• CI/CD Pipeline (GitHub Actions with main.yml)
• Build Stages:
1. FFTW Optimized Container
2. SIMD-specific GROMACS containers (matrix jobs)
3. Final container assembly (combining all SIMD builds)
• Runtime Component:
– gmx-chooser for detecting hardware and selecting the correct binary.
• External Dependencies:
– nvidia/cuda base image, Docker Hub, and other libraries (fftw, openmpi, etc.)
– Triggering of CI jobs, dependency relationships between build stages, and the merging into the final container image.