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
2 changes: 2 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ DB_HOSTNAME=omotes_postgres
DB_PORT=6432
DB_USERNAME=omotes_timeseries_rw
DB_PASSWORD=somepass4
# Required when ESDL_OUTPUT_PROFILES_TYPE=POSTGRESQL
PG_DB_TIMESERIES=omotes_timeseries

RABBITMQ_USERNAME=celery
RABBITMQ_PASSWORD=somepass2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10" ]
python-version: [ "3.11" ]
steps:
- uses: actions/checkout@v3
- name: setup python
Expand All @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10" ]
python-version: [ "3.11" ]
steps:
- uses: actions/checkout@v3
- name: setup python
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10" ]
python-version: [ "3.11" ]
steps:
- uses: actions/checkout@v3
- name: setup python
Expand Down
5 changes: 3 additions & 2 deletions ci/linux/create_venv.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

python3.10 -m venv ./.venv
python3.11 -m venv ./.venv
if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then
echo "Activating .venv first."
. .venv/bin/activate
fi
pip3 install pip-tools
# install the missing dep alongside pip-tools
pip3 install pip-tools typing_extensions
2 changes: 1 addition & 1 deletion ci/win32/create_venv.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rem @echo off

pushd .
cd /D "%~dp0"
py -3.10 -m venv ..\..\venv
py -3.11 -m venv ..\..\venv
call ..\..\venv\Scripts\activate.bat
python -m pip install pip-tools
popd
39 changes: 19 additions & 20 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ celery==5.6.3
# via
# -c requirements.txt
# omotes-sdk-python
certifi==2026.6.17
certifi==2026.7.22
# via
# -c requirements.txt
# requests
charset-normalizer==3.4.9
charset-normalizer==3.5.1
# via
# -c requirements.txt
# requests
click==8.4.2
click==8.5.0
# via
# -c requirements.txt
# black
Expand All @@ -71,7 +71,7 @@ coolprop==6.6.0
# via
# -c requirements.txt
# mesido
coverage[toml]==7.15.2
coverage[toml]==7.16.0
# via pytest-cov
defusedxml==0.7.1
# via
Expand Down Expand Up @@ -110,7 +110,7 @@ future-fstrings==1.2.0
# via
# -c requirements.txt
# pyecore
idna==3.18
idna==3.19
# via
# -c requirements.txt
# requests
Expand All @@ -128,17 +128,17 @@ kombu==5.6.2
# via
# -c requirements.txt
# celery
lxml==6.1.1
lxml==6.1.3
# via
# -c requirements.txt
# pyecore
mccabe==0.7.0
# via flake8
mesido==0.1.20.3
mesido==0.1.22
# via
# -c requirements.txt
# omotes-grow-worker (pyproject.toml)
msgpack==1.2.1
msgpack==1.2.2
# via
# -c requirements.txt
# influxdb
Expand All @@ -164,7 +164,7 @@ omotes-sdk-protocol==1.2.0
# via
# -c requirements.txt
# omotes-sdk-python
omotes-sdk-python==4.3.6
omotes-sdk-python==4.3.7
# via
# -c requirements.txt
# omotes-grow-worker (pyproject.toml)
Expand All @@ -176,7 +176,7 @@ ordered-set==4.1.0
# via
# -c requirements.txt
# pyecore
packaging==26.2
packaging==26.3
# via
# -c requirements.txt
# black
Expand All @@ -195,11 +195,11 @@ pandas==1.5.3
# mesido
pathspec==1.1.1
# via black
platformdirs==4.10.0
platformdirs==4.11.7
# via black
pluggy==1.6.0
# via pytest
prompt-toolkit==3.0.52
prompt-toolkit==3.0.53
# via
# -c requirements.txt
# click-repl
Expand Down Expand Up @@ -229,18 +229,17 @@ pyecore==0.13.2
# -c requirements.txt
# mesido
# pyesdl
pyesdl[profiles]==26.7
pyesdl[profiles]==26.7.1
# via
# -c requirements.txt
# mesido
# omotes-sdk-python
pyflakes==3.2.0
# via flake8
pymoca==0.9.2
pymoca==0.9.3
# via
# -c requirements.txt
# mesido
# rtc-tools-channel-flow
# rtc-tools-gil-comp
pyproject-hooks==1.2.0
# via build
Expand All @@ -260,7 +259,7 @@ python-dotenv==1.0.1
# via
# -c requirements.txt
# omotes-grow-worker (pyproject.toml)
pytz==2026.2
pytz==2026.3.post1
# via
# -c requirements.txt
# influxdb
Expand All @@ -269,11 +268,11 @@ requests==2.34.2
# via
# -c requirements.txt
# influxdb
restrictedpython==8.4
restrictedpython==8.5
# via
# -c requirements.txt
# pyecore
rtc-tools-channel-flow==1.3.1
rtc-tools-channel-flow==1.4.0
# via
# -c requirements.txt
# rtc-tools-gil-comp
Expand Down Expand Up @@ -339,13 +338,13 @@ vine==5.1.0
# amqp
# celery
# kombu
wcwidth==0.8.2
wcwidth==0.8.3
# via
# -c requirements.txt
# prompt-toolkit
wheel==0.45.1
# via omotes-grow-worker (pyproject.toml)
yarl==1.24.2
yarl==1.24.5
# via
# -c requirements.txt
# aio-pika
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ classifiers = [
]
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.10"
requires-python = ">=3.11"

dependencies = [
"python-dotenv ~= 1.0.0",
"mesido ~= 0.1.20.3",
"omotes-sdk-python ~= 4.3.6",
"mesido ~= 0.1.22",
"omotes-sdk-python ~= 4.3.7",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -96,7 +96,7 @@ line-length = 100
profile = "black"

[tool.mypy]
python_version = "3.10"
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
Expand Down
35 changes: 17 additions & 18 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ casadi-gil-comp==3.6.7
# rtc-tools-gil-comp
celery==5.6.3
# via omotes-sdk-python
certifi==2026.6.17
certifi==2026.7.22
# via requests
charset-normalizer==3.4.9
charset-normalizer==3.5.1
# via requests
click==8.4.2
click==8.5.0
# via
# celery
# click-didyoumean
Expand All @@ -46,7 +46,7 @@ exceptiongroup==1.3.1
# via celery
future-fstrings==1.2.0
# via pyecore
idna==3.18
idna==3.19
# via
# requests
# yarl
Expand All @@ -56,11 +56,11 @@ influxdb==5.3.1
# pyesdl
kombu==5.6.2
# via celery
lxml==6.1.1
lxml==6.1.3
# via pyecore
mesido==0.1.20.3
mesido==0.1.22
# via omotes-grow-worker (pyproject.toml)
msgpack==1.2.1
msgpack==1.2.2
# via influxdb
multidict==6.7.1
# via yarl
Expand All @@ -73,21 +73,21 @@ numpy==1.25.2
# scipy
omotes-sdk-protocol==1.2.0
# via omotes-sdk-python
omotes-sdk-python==4.3.6
omotes-sdk-python==4.3.7
# via omotes-grow-worker (pyproject.toml)
openpyxl==3.1.2
# via pyesdl
ordered-set==4.1.0
# via pyecore
packaging==26.2
packaging==26.3
# via kombu
pamqp==3.3.0
# via
# aiormq
# omotes-sdk-python
pandas==1.5.3
# via mesido
prompt-toolkit==3.0.52
prompt-toolkit==3.0.53
# via click-repl
propcache==0.5.2
# via yarl
Expand All @@ -103,14 +103,13 @@ pyecore==0.13.2
# via
# mesido
# pyesdl
pyesdl[profiles]==26.7
pyesdl[profiles]==26.7.1
# via
# mesido
# omotes-sdk-python
pymoca==0.9.2
pymoca==0.9.3
# via
# mesido
# rtc-tools-channel-flow
# rtc-tools-gil-comp
python-dateutil==2.9.0.post0
# via
Expand All @@ -119,15 +118,15 @@ python-dateutil==2.9.0.post0
# pandas
python-dotenv==1.0.1
# via omotes-grow-worker (pyproject.toml)
pytz==2026.2
pytz==2026.3.post1
# via
# influxdb
# pandas
requests==2.34.2
# via influxdb
restrictedpython==8.4
restrictedpython==8.5
# via pyecore
rtc-tools-channel-flow==1.3.1
rtc-tools-channel-flow==1.4.0
# via rtc-tools-gil-comp
rtc-tools-gil-comp==2.6.1
# via mesido
Expand Down Expand Up @@ -158,9 +157,9 @@ vine==5.1.0
# amqp
# celery
# kombu
wcwidth==0.8.2
wcwidth==0.8.3
# via prompt-toolkit
yarl==1.24.2
yarl==1.24.5
# via
# aio-pika
# aiormq
Expand Down
42 changes: 24 additions & 18 deletions src/grow_worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,32 @@ def grow_worker_task(
db_username = os.environ.get("DB_USERNAME", "")
db_password = os.environ.get("DB_PASSWORD", "")

logger.info(
"Will write result profiles to '%s' database at %s:%s",
esdl_output_profiles_type_str,
db_host,
db_port,
pg_db_timeseries = None
if esdl_output_profiles_type == ESDLOutputProfilesType.POSTGRESQL:
pg_db_timeseries = os.environ.get("PG_DB_TIMESERIES", "omotes_timeseries")

db_connection = {
"access_type": DBAccessType.READ_WRITE,
"host": db_host,
"port": db_port,
"username": db_username,
"password": db_password,
"ssl": False,
"verify_ssl": False,
}

msg = (
f"Will write result profiles to '{esdl_output_profiles_type_str}' "
f"database at {db_host}:{db_port}"
)

database_connection = []

database_connection.append(
{
"access_type": DBAccessType.READ_WRITE,
"host": db_host,
"port": db_port,
"username": db_username,
"password": db_password,
"ssl": False,
"verify_ssl": False,
}
)
if pg_db_timeseries:
db_connection["database"] = pg_db_timeseries
msg += f"/{db_connection['database']}"

logger.info(msg)

database_connection = [db_connection]

esdl_str = None
esdl_messages = []
Expand Down
Loading