Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ To set up the infrastructure components (for windows run in `Git Bash`):
./scripts/setup.sh
```

This setup script does not work if influxdb contains a lot of data due to a timeout when loading the data on influxdb
startup. The commands in `influxdb/influxdb-init.sh` can also be done in the running container after start instead.

To start the infrastructure components:

```
Expand Down
31 changes: 31 additions & 0 deletions config/workflow_config_nwn_no_gurobi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[
{
"workflow_type_name": "grow_optimizer_no_heat_losses",
"workflow_type_description_name": "Draft Design - Quickscan Validation"
},
{
"workflow_type_name": "grow_optimizer_default",
"workflow_type_description_name": "Draft Design - Optimization"
},
{
"workflow_type_name": "simulator",
"workflow_type_description_name": "Conceptual Design - Simulation",
"workflow_parameters": [
{
"parameter_type": "duration",
"key_name": "timestep",
"description": "Duration of a timestep in seconds.",
"minimum": 0,
"default": 3600
},
{
"parameter_type": "datetime",
"key_name": "start_time"
},
{
"parameter_type": "datetime",
"key_name": "end_time"
}
]
}
]
6 changes: 3 additions & 3 deletions docker-compose.override.setup.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
rabbitmq:
volumes:
- "${RABBITMQ_INIT_FILE:-./rabbitmq/rabbitmq-init.sh}:/setup/rabbitmq-init.sh"
- "${RABBITMQ_INIT_FILE:-./rabbitmq/rabbitmq-init.sh}:/setup/rabbitmq-init.sh:ro"
environment:
RABBITMQ_OMOTES_USER_NAME: ${RABBITMQ_OMOTES_USER_NAME}
RABBITMQ_OMOTES_USER_PASSWORD: ${RABBITMQ_OMOTES_USER_PASSWORD}
Expand All @@ -10,7 +10,7 @@ services:

omotes_influxdb:
volumes:
- "${INFLUXDB_INIT_FILE:-./influxdb/influxdb-init.sh}:/setup/influxdb-init.sh"
- "${INFLUXDB_INIT_FILE:-./influxdb/influxdb-init.sh}:/setup/influxdb-init.sh:ro"
environment:
INFLUXDB_WRITE_USER: ${INFLUXDB_WRITE_USER}
INFLUXDB_WRITE_USER_PASSWORD: ${INFLUXDB_WRITE_USER_PASSWORD}
Expand All @@ -20,4 +20,4 @@ services:

orchestrator_postgres_db:
volumes:
- "${POSTGRES_INIT_FILE:-./postgres/postgres-init.sql}:/setup/init.sql"
- "${POSTGRES_INIT_FILE:-./postgres/postgres-init.sql}:/setup/init.sql:ro"
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ services:
timeout: 5s
retries: 10
volumes:
- ./influxdb/influxdb.conf:/etc/influxdb/influxdb.conf:ro
- influxdb_storage:/var/lib/influxdb

orchestrator_postgres_db: &orchestrator_postgres_db
Expand Down
6 changes: 6 additions & 0 deletions influxdb/influxdb-init.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
INFLUXDB_EXEC="influx -username $INFLUXDB_ADMIN_USER -password $INFLUXDB_ADMIN_PASSWORD -host omotes_influxdb -port $INFLUXDB_PORT -execute"

$INFLUXDB_EXEC "CREATE RETENTION POLICY \"short\" ON \"_internal\" DURATION 1d REPLICATION 1 DEFAULT"
$INFLUXDB_EXEC "DROP RETENTION POLICY \"autogen\" ON \"_internal\""
$INFLUXDB_EXEC "DROP RETENTION POLICY \"monitor\" ON \"_internal\""
echo "Retention policies set."

$INFLUXDB_EXEC "CREATE USER $INFLUXDB_WRITE_USER WITH PASSWORD '$INFLUXDB_WRITE_USER_PASSWORD'";
$INFLUXDB_EXEC "GRANT WRITE ON omotes_timeseries TO $INFLUXDB_WRITE_USER";
$INFLUXDB_EXEC "SET PASSWORD FOR $INFLUXDB_WRITE_USER = '$INFLUXDB_WRITE_USER_PASSWORD'";
Expand Down
11 changes: 11 additions & 0 deletions influxdb/influxdb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[meta]
dir = "/var/lib/influxdb/meta"

[data]
dir = "/var/lib/influxdb/data"
wal-dir = "/var/lib/influxdb/wal"

[monitor]
store-enabled = true
store-database = "_internal"
store-interval = "300s"