Ompp UI Start_User Interface - openmpp/openmpp.github.io GitHub Wiki

How to use openM++ UI

Open++ user interface (ompp-ui) is a lightweight web UI which is:

  • scalable: can be run on single end-user desktop and in cluster environment
  • cloud ready: can be deployed in private or public cloud (Amazon AWS, Microsoft Azure, Google Cloud, etc.)
  • portable: work on Windows, Linux and MacOS, 32 and 64 bit versions
  • open source: it is open source product

Start openM++ UI

By default ompp-ui does not require any installation, to run it do one of the following:

  • on Windows double click on bin\ompp_ui.bat
  • on Linux double click on bin/ompp_ui.sh
  • on MacOS double click on bin/ompp_ui.command

Any of above script is relatively simple, all it does is starting oms web-service:

cd ~/openmpp_mac_20200704
bin/oms
.....
2020-06-19 16:07:57.892 Model directory: models/bin
2020-06-19 16:07:57.930 Listen at localhost:4040
2020-06-19 16:07:57.930 To start open in your browser: localhost:4040
2020-06-19 16:07:57.931 To finish press Ctrl+C

and open your browser at http://localhost:4040

Linux: Not every distribution do run executable by double click, if this action does not work then do it from command line:

cd openmpp_debian_20200704
./bin/ompp_ui.sh

It is possible you will be asked to confirm or select the action "Run in terminal" or "Open with Terminal":

OpenM++ UI start on Ubuntu 2004

OpenM++ UI start on MX Linux 19

Use model runs queue

If model runs queue enabled then from UI Service Status page you can:

  • see current model runs queue
  • re-arrange your model run queue
  • delete your model run job from the queue
  • see the history of model runs
  • re-submit model run again if it was failed
  • see currently active model runs
  • cancel (stop) model run

In order to enable model runs queue on your local computer do following:

  • create job directory and sub-directories under your openM++ installation folder: Model run jobs directory and job.ini

You can just copy job directory, sub-directories and job.ini from ompp-go folder of your openM++ installation.

  • edit job.ini file to specify number of CPU cores which you want to use for model run, e.g.:
[Common]
LocalCpu = 4
  • modify UI start script to add -oms.JobDir job option to the oms line
    • on Windows bin\ompp_ui.bat:
    ...skip... \bin\oms -oms.HomeDir models\home -oms.AllowDownload -oms.AllowUpload -oms.LogRequest -oms.JobDir job
    
    • on Linux bin/start_oms.sh:
    ...skip... ./bin/oms -l localhost:${OMS_PORT} -oms.HomeDir models/home -oms.AllowDownload -oms.AllowUpload -oms.LogRequest -oms.JobDir job
    • on MacOS bin/ompp_ui.command:
    "...skip... bin/oms -l localhost:4040 -oms.HomeDir models/home -oms.AllowDownload -oms.AllowUpload -oms.LogRequest -oms.JobDir job"
    

After that you can start UI by double click on bin\ompp_ui.bat (Windows) or bin/ompp_ui.sh (Linux) or bin/ompp_ui.command (MacOS). Model runs queue and status page will look similar to:

OpenM++ UI: Model run jobs: queue and status

Start openM++ UI from model source directory

Linux: To start UI from your model source code directory:

cd openmpp_debian_20211130/models/RiskPaths
../start-ompp-ui-linux.sh

If you make RELEASE model then it may be convenient to use one of the following:

RELEASE=1 ../start-ompp-ui-linux.sh
export RELEASE=1 make all publish && ../start-ompp-ui-linux.sh

It is recommended to stop oms web-service after you are done with UI:

cd openmpp_debian_20211130/models/RiskPaths
../stop-ompp-ui-linux.sh

If your model source code directory located outside of openM++ release directory then do export OM_ROOT:

export OM_ROOT=$HOME/openmpp_debian_20211130
cd ~/my-models/RiskPaths
$OM_ROOT/models/start-ompp-ui-linux.sh

MacOS: To start UI from your model source code directory:

cd openmpp_mac_arm64_20211130/models/RiskPaths
../start-ompp-ui-mac.sh

If you make RELEASE model then it may be convenient to use one of the following:

RELEASE=1 ../start-ompp-ui-mac.sh
export RELEASE=1 make all publish && ../start-ompp-ui-mac.sh

It is recommended to stop oms web-service after you are done with UI:

cd openmpp_mac_arm64_20211130/models/RiskPaths
../stop-ompp-ui-mac.sh

If your model source code directory located outside of openM++ release directory then do export OM_ROOT:

export OM_ROOT=$HOME/openmpp_mac_arm64_20211130
cd ~/my-models/RiskPaths
$OM_ROOT/models/start-ompp-ui-mac.sh

Windows: To start UI from your model source code directory:

  1. Copy start-ompp-ui.bat into your model folder, for example: C:\openmpp_win_20220105\props\start-ompp-ui.bat => C:\openmpp_win_20220105\models\RiskPaths
  2. Double click on start-ompp-ui.bat or from command line window do:
cd \openmpp_win_20220105\models\RiskPaths
start-ompp-ui.bat
  1. It is recommended to close oms web-service window after you are done with UI.

If your model source code directory located outside of openM++ release directory then set OM_ROOT:

set OM_ROOT=C:\openmpp_win_20220105
cd \my-models\RiskPaths
start-ompp-ui.bat

Start model UI on Windows from Visual Studio

To open UI from Visual Studio solution model build change project settings as on screenshot below. Optionally you may also want to run the model during model build to see results in UI.

Run model and open UI from Visual Studio

More details about using Visual Studio for model development available at Windows: Create and Debug Models

Start model UI on Linux from Visual Studio Code

To open UI from Visual Studio Code on Linux please configure "Start UI" task for the model. It can be done by using menu Terminal -> Configure Tasks... and create tasks similar to RiskPaths model below:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build-RiskPaths",
            "type": "shell",
            "command": "make all publish",
            "problemMatcher": "$gcc",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "dependsOrder": "sequence",
            "dependsOn": [
                "build-libopenm",
                "stop-ui-RiskPaths"
            ]
        },
        {
            "label": "start-ui-RiskPaths",
            "type": "shell",
            "command": "../start-ompp-ui-linux.sh",
            "problemMatcher": []
        },
        {
            "label": "stop-ui-RiskPaths",
            "type": "shell",
            "command": "../stop-ompp-ui-linux.sh",
            "problemMatcher": []
        },
        {
            "label": "clean-RiskPaths",
            "type": "shell",
            "command": "make clean-all",
            "group": "build",
            "problemMatcher": []
        },
        {
            "label": "build-libopenm",
            "type": "shell",
            "command": "make libopenm",
            "options": {
                "cwd": "../../openm"
            },
            "problemMatcher": "$gcc",
            "group": "build"
        }
    ]
}

To start UI please go to menu Terminal -> Run Task... -> start-ui-RiskPaths After you done with UI it is recommended to shutdown background oms web-service by using Terminal -> Run Task... -> stop-ui-RiskPaths

Start UI from Visual Studio Code on Linux

More details about model development on Linux available at Linux: Create and Debug Models

Start model UI on MacOS from Xcode

To start model UI after build completed please change Model.xcconfig variable START_OMPP_UI to "1" or "true" or "yes" (case-sensitive)

Change model config to start UI from XCode

More details about model development on MacOS available at MacOS: Create and Debug Models More details about using Xcode for model development available at MacOS: Create and Debug Model using Xcode

⚠️ **GitHub.com Fallback** ⚠️