Windows use Docker - openmpp/openmpp.github.io GitHub Wiki
There are multiple cases when you want to use Docker containers for openM++ development:
- build your models with latest version of openM++
- build cluster-ready (and cloud-ready) version of your model without installing MPI on your host computer
- do test run of your model in cluster environment without installing and configuring MPI cluster on multiple machines
- build latest version of openM++ from source code without installing and configuring all necessary development tools
All above build and run tasks can be done without Docker and our wiki describes all steps necessary to achieve this. However in that case you will spend a few hours or even days with installing and configuring development and cluster environment. Use of Docker allow to skip unnecessary steps and focus on model development. Also because containers are isolated from host environment there is nothing (except of Docker itself) get installed on your host system and you keep it clean, no software versions conflicts.
In order to use containers Docker for Windows must be installed. It can be done on your host system or on virtual machine. There are short notes about Docker installation at the bottom of that page.
You can download openM++ images from Docker Hub:
-
to run openM++ models pull:
docker pull openmpp/openmpp-run:windows-20H2
- Docker Hub description: openmpp/openmpp-run:windows-20H2
- GitHub: source code and Dockerfile
-
to build latest version of openM++ and re-build your models:
docker pull openmpp/openmpp-build:windows-20H2
- Docker Hub description: openmpp/openmpp-build:windows-20H2
- GitHub: source code and Dockerfile
To run openM++ model do:
docker run .... openmpp/openmpp-run:windows-20H2 MyModel.exe
For example, if your models are in C:\my\models\bin
directory then:
docker run -v C:\my\models\bin:C:\ompp openmpp/openmpp-run:windows-20H2 MyModel.exe
docker run -v C:\my\models\bin:C:\ompp openmpp/openmpp-run:windows-20H2 mpiexec -n 2 MyModel_mpi.exe -OpenM.SubValues 16
docker run -v C:\my\models\bin:C:\ompp -e OM_ROOT=C:\ompp openmpp/openmpp-run:windows-20H2 MyModel.exe
also you can use -e OM_ROOT=C:\ompp
to set environment variable for your model, if necessary.
To start command prompt do:
docker run -v C:\my\models\bin:C:\ompp -it openmpp/openmpp-run:windows-20H2
To build latest version of openM++ from source code and rebuild your models do:
docker run .... openmpp/openmpp-build:windows-20H2 build-all
For example, if your build in C:\my\build
directory then:
docker run -v C:\my\build:C:\build openmpp/openmpp-build:windows-20H2 build-all
docker run -v C:\my\build:C:\build -e OM_BUILD_PLATFORMS=x64 openmpp/openmpp-build:windows-20H2 build-all
docker run -v C:\my\build:C:\build -e MODEL_DIRS=RiskPaths openmpp/openmpp-build:windows-20H2 build-all
Following environment variables used to control openM++ build:
set OM_BUILD_CONFIGS=Release,Debug (default: Release)
set OM_BUILD_PLATFORMS=Win32,x64 (default: Win32)
set OM_MSG_USE=MPI (default: EMPTY)
set MODEL_DIRS=modelOne,NewCaseBased,NewTimeBased,NewCaseBased_bilingual,NewTimeBased_bilingual,IDMM,OzProj,OzProjGen,RiskPaths
To build only openM++ libraries and omc compiler do:
docker run .... openmpp/openmpp-build:windows-20H2 build-openm
Environment variables to control build-openm: OM_BUILD_CONFIGS, OM_BUILD_PLATFORMS, OM_MSG_USE
To build models do:
docker run .... openmpp/openmpp-build:windows-20H2 build-models
Environment variables to control build-models: OM_BUILD_CONFIGS, OM_BUILD_PLATFORMS, OM_MSG_USE, MODEL_DIRS
For example, if want to build your own model MyModel
copy model code into
C:\my\build\models\MyModel
directory and do:
docker run -v C:\my\build:C:\build -e MODEL_DIRS=MyModel openmpp/openmpp-build:windows-20H2 build-models
docker run -v C:\my\build:C:\build -e MODEL_DIRS=MyModel -e OM_BUILD_PLATFORMS=x64 openmpp/openmpp-build:windows-20H2 build-models
To build openM++ tools do any of:
docker run .... openmpp/openmpp-build:windows-20H2 build-go # Go oms web-service and dbcopy utility
docker run .... openmpp/openmpp-build:windows-20H2 build-r # openMpp R package
docker run .... openmpp/openmpp-build:windows-20H2 build-perl # Perl utilities
docker run .... openmpp/openmpp-build:windows-20H2 build-ui # openM++ UI
To create openmpp_win_YYYYMMDD.zip
deployment archive:
docker run .... openmpp/openmpp-build:windows-20H2 build-zip
Environment variables to control build-zip: OM_MSG_USE, MODEL_DIRS
To customize build you can change any of build scripts inside of $HOME/build directory:
C:\my\build\build-all.bat # rebuild entire openM++ and create openmpp_win_YYYYMMDD.tar.gz archive
C:\my\build\build-openm.bat # rebuild entire openM++ runtime libraries and compiler
C:\my\build\build-models.bat # rebuild openM++ models specified by MODEL_DIRS
C:\my\build\build-go.bat # rebuild Go oms web-service and dbcopy utility
C:\my\build\build-r.bat # rebuild openMpp R package
C:\my\build\build-ui.bat # rebuild openM++ UI
C:\my\build\build-zip.bat # create openmpp_win_YYYYMMDD.zip archive
To open cmd command prompt or Perl command prompt:
docker run -v C:\my\build:C:\build -it openmpp/openmpp-build:windows-20H2 cmd
docker run -v C:\my\build:C:\build -it openmpp/openmpp-build:windows-20H2 C:\perl\portableshell
Please follow official Microsoft documentation and Docker documentation to download and install Docker for Windows. There are few notes below, which you may find useful.
Final result should be "Docker is running":
You should do "Switch to Windows containers":
This menu can be accessed by right-clicking the Docker icon in the system tray, which is normally in the lower right corner of the display.
Docker installation require Hyper-V Windows feature "On":
If you installing Docker inside of VMware virtual machine then it may be necessary to turn on "Virtualize Intel VT-x/EPT or AMD-V/RVI" settings. You can turn it off after setup completed: