Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • W Wiki Home
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
Collapse sidebar
  • SDK4ED WikiSDK4ED Wiki
  • Wiki Home
  • Wiki
  • Forecaster Toolbox Run Server

Forecaster Toolbox Run Server · Changes

Page history
Update Forecaster Toolbox Run Server authored 5 years ago by Dimitris Tsoukalas's avatar Dimitris Tsoukalas
Hide whitespace changes
Inline Side-by-side
Showing
with 0 additions and 0 deletions
+0 -0
Forecaster-Toolbox-Run-Server.md 0 → 100644
View page @ 86df8bee
## Run Server
You can run the server in various modes using Python to run the `forecaster_service.py` script:
```
usage: forecaster_service.py [-h] [-dh DB_HOST] [-dp DB_PORT] [-dn DB_DBNAME]
[--debug]
HOST PORT SERVER_MODE
positional arguments:
HOST Server HOST (e.g. "localhost")
PORT Server PORT (e.g. "5000")
SERVER_MODE builtin, waitress
optional arguments:
-h, --help show this help message and exit
-dh DB_HOST MongoDB HOST (e.g. "localhost") (default: localhost)
-dp DB_PORT MongoDB PORT (e.g. "27017") (default: 27017)
-dn DB_DBNAME Database NAME (default: forecaster_service)
--debug Run builtin server in debug mode (default: False)
```
`HOST`, `PORT`, and `SERVER_MODE` arguments are **mandatory**. You can set them according to your needs.
`DB_HOST`, `DB_PORT`, and `DB_DBNAME` arguments are **optional** and assume that there is a MongoDB instance running either on a local machine or remotely. In case that there is no such MongoDB instance running, the Forecasting Toolbox will still return the results, but they will not be stored anywhere.
### Run built-in Flask server
```
127.0.0.1:5000
Client <----------------> Flask
```
To start the Forecasting Toolbox using the built-in **Flask** server, use the command promt inside the active Conda or Container environment and execute the following command:
```bash
python forecaster_service.py 0.0.0.0 5000 builtin --debug
```
This command will start the built-in Flask server locally (0.0.0.0) on port 5000.
**MongoDB Integration**
In case there is a MongoDB instance running, use the command promt inside the active conda or Container environment and execute the following command:
```bash
python forecaster_service.py 0.0.0.0 5000 builtin -dh localhost -dp 27017 -dn forecaster_service --debug
```
This command will start the built-in Flask server locally on port 5000 and store the results on a MongoDB database named "forecaster_service" running locally on port 27017.
**Warning**: The built-in Flask mode is useful for development since it has debugging enabled (e.g. in case of error the client gets a full stack trace). However, it is single-threaded. Do NOT use this mode in production!
### Run Waitress server
```
127.0.0.1:5000
Client <----------------> Waitress <---> Flask
```
To start the Forecasting Toolbox using the **Waitress** server, use the command promt inside the active Conda or Container environment and execute the following command:
```bash
python forecaster_service.py 0.0.0.0 5000 waitress
```
This command will start the Waitress server locally (0.0.0.0) on port 5000.
**MongoDB Integration**
In case there is a MongoDB instance running, use the command promt inside the active conda or Container environment and execute the following command:
```bash
python forecaster_service.py 0.0.0.0 5000 waitress -dh localhost -dp 27017 -dn forecaster_service
```
This command will start the Waitress server locally on port 5000 and store the results on a MongoDB database named "forecaster_service" running locally on port 27017.
**Warning**: The Waitress mode is higly recommended in real production environments, since it supports scaling and multiple-request handling features.
Clone repository
  • Advanced
  • Architectural Toolbox Description
  • Architectural Toolbox Front End
  • Architectural Toolbox Home
  • Architectural Toolbox Installation
  • Architectural Toolbox Usage
  • Decision Support Toolbox Description
  • Decision Support Toolbox Front end
  • Decision Support Toolbox Installation
  • Decision Support Toolbox Usage
  • Decision Support Toolbox
  • Energy Toolbox Description
  • Energy Toolbox Front end
  • Energy Toolbox Installation
  • Energy Toolbox Usage
View All Pages

Menu

Explore Projects Groups Snippets