Repository Setup
Clone the ModMS repository:Git Worktree Setup
ModMS has different branches for each component:aggregatorbranch: Main branch for the aggregator componentindexerbranch: Indexer component codeserverbranch: Server and receiver componentsmamsbranch: MAMS (Model Archive Management System) - uses same code as server
Setting Up Worktrees
The repository uses git worktrees to allow working with multiple branches simultaneously. Here’s how to set them up:If worktrees already exist, you can remove them with
git worktree remove <path> and recreate them.Worktree Structure
After setup, your directory structure will look like:Worktrees allow you to work on multiple branches simultaneously without switching between them. This is useful when building Docker images for different components.
Building Docker Images
Each ModMS component has its own Dockerfile and build process.Aggregator Image
Build the aggregator Docker image from the root directory:- wgrib2 (GRIB file utilities)
- eccodes (ECMWF codes library)
- LDC compiler (D compiler)
- System libraries: libssl, curl, cdo, etc.
Indexer Image
Build the indexer Docker image from the indexer worktree:- eccodes (ECMWF codes library)
- LDC compiler (D compiler)
- NetCDF libraries
- GDAL libraries
Server Image
Build the server Docker image using the build script:registry.docker.devops.arabiaweather.com/modms:v1.0.0registry.docker.devops.arabiaweather.com/modms-nginx:v1.0.0
Replace
v1.0.0 with your desired tag. The build script requires a tag parameter.MAMS Image
MAMS uses the same code as the server. See the MAMS documentation for build instructions.Local Testing
To test ModMS components locally, you’ll need to set up directories and configure environment variables.Required Directories
Create the following directory structure on your host machine:You can use custom paths instead of
/data/*. Just ensure the paths are consistent across your setup.Environment Variables
ModMS components use several environment variables. Create a.env file or export them:
Testing Aggregator - Check Run Ready
Check if a model run is ready for processing:/data/downloads: Downloaded GRIB files (read-write)/data/state: State tracking files (read-write)/data/temp: Temporary processing files (read-write)/static_data: Static data files (read-only)
Testing Aggregator - Download and Process
Run the aggregator to download and process a model:/data/downloads: Downloaded GRIB files (read-write)/data/manifests: Output manifest files (read-write, mounted as/output)/data/state: State tracking files (read-write)/data/temp: Temporary processing files (read-write)/static_data: Static data files (read-only)
/data/manifests with the format: <MODEL>_<RUNTIME>.json
Testing Indexer
Run the indexer to convert GRIB files to NetCDF:/data/manifests: Manifest files (read-only, mounted as/manifests)/data/models: Output NetCDF files (read-write)/data/downloads: Source GRIB files (read-only)/data/temp: Temporary indexer files (read-write, mounted as/tmp/indexer)
Cleanup Operations
Aggregator Cleanup
Clean up old downloaded files:Indexer Cleanup
Clean up old manifest and temporary files:MAMS (Model Archive Management System)
MAMS is an archiver system for ModMS NetCDF data. For detailed MAMS documentation, see the MAMS documentation.MAMS uses the same codebase as the ModMS server and provides identical query capabilities. It archives model data to distributed storage servers using a registry system.
Next Steps
- Review the Architecture documentation for system design details
- Check the FAQ for common issues and troubleshooting
- Explore the API Reference for query capabilities

