Skip to content

Commit 1e767df

Browse files
author
Andrei Neagu
committed
Merge remote-tracking branch 'upstream/master' into pr-osparc-login-director-v2
2 parents 5799070 + ffd604e commit 1e767df

File tree

36 files changed

+339
-224
lines changed

36 files changed

+339
-224
lines changed

.env-devel

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ AGENT_VOLUMES_CLEANUP_S3_REGION=us-east-1
1919
AGENT_VOLUMES_CLEANUP_S3_SECRET_KEY=12345678
2020
AGENT_TRACING={}
2121

22+
API_SERVER_CELERY_CONCURRENCY=50
2223
API_SERVER_DEV_FEATURES_ENABLED=0
2324
API_SERVER_LOGLEVEL=INFO
2425
API_SERVER_PROFILING=1
@@ -53,6 +54,7 @@ CELERY_RESULT_EXPIRES=P7D
5354

5455
CLUSTERS_KEEPER_COMPUTATIONAL_BACKEND_DEFAULT_CLUSTER_AUTH='{"type":"tls","tls_ca_file":"/home/scu/.dask/dask-crt.pem","tls_client_cert":"/home/scu/.dask/dask-crt.pem","tls_client_key":"/home/scu/.dask/dask-key.pem"}'
5556
CLUSTERS_KEEPER_COMPUTATIONAL_BACKEND_DOCKER_IMAGE_TAG=master-github-latest
57+
CLUSTERS_KEEPER_DASK_NPROCS=1
5658
CLUSTERS_KEEPER_DASK_NTHREADS=0
5759
CLUSTERS_KEEPER_DASK_WORKER_SATURATION=inf
5860
CLUSTERS_KEEPER_EC2_ACCESS=null
@@ -192,13 +194,14 @@ PAYMENTS_USERNAME=admin
192194
PAYMENTS_TRACING={}
193195

194196
POSTGRES_DB=simcoredb
195-
POSTGRES_ENDPOINT=postgres:5432
196197
POSTGRES_HOST=postgres
197198
POSTGRES_PASSWORD=adminadmin
198199
POSTGRES_PORT=5432
199200
POSTGRES_USER=scu
200-
POSTGRES_MINSIZE=2 # see https://github.com/ITISFoundation/osparc-simcore/pull/8199
201+
POSTGRES_MINSIZE=1
201202
POSTGRES_MAXSIZE=50
203+
POSTGRES_MAX_POOLSIZE=10
204+
POSTGRES_MAX_OVERFLOW=20
202205
POSTGRES_READONLY_PASSWORD=readonly
203206
POSTGRES_READONLY_USER=postgres_readonly
204207

packages/notifications-library/src/notifications_library/templates/on_account_requested.email.content.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
<p>Dear Support team
55

66
<p>
7-
We have received the following request form for an account in {{ product.display_name }} from <b>{{ host }}</b>
7+
We have received the following request form for an account in :
8+
<ol>
9+
<li>Product: <b>{{ product.display_name }}</b></li>
10+
<li>Host: <b>{{ host }}</b></li>
11+
</ol>
812
</p>
913

1014
<pre>

packages/notifications-library/src/notifications_library/templates/on_account_requested.email.content.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Dear Support team,
22

3-
We have received the following request form for an account in {{ product.display_name }} from **{{ host }}**:
3+
We have received the following request form for an account in :
4+
- Product: **{{ product.display_name }}**
5+
- Host: **{{ host }}**
46

57
{{ dumps(request_form) }}
68

packages/pytest-simcore/src/pytest_simcore/postgres_service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ def postgres_env_vars_dict(postgres_dsn: PostgresTestConfig) -> EnvVarsDict:
250250
"POSTGRES_DB": postgres_dsn["database"],
251251
"POSTGRES_HOST": postgres_dsn["host"],
252252
"POSTGRES_PORT": f"{postgres_dsn['port']}",
253-
"POSTGRES_ENDPOINT": f"{postgres_dsn['host']}:{postgres_dsn['port']}",
254253
}
255254

256255

packages/service-library/src/servicelib/db_asyncpg_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ async def create_async_engine_and_database_ready(
3939

4040
engine = create_async_engine(
4141
settings.dsn_with_async_sqlalchemy,
42-
pool_size=settings.POSTGRES_MINSIZE,
43-
max_overflow=settings.POSTGRES_MAXSIZE - settings.POSTGRES_MINSIZE,
42+
pool_size=settings.POSTGRES_MAX_POOLSIZE,
43+
max_overflow=settings.POSTGRES_MAX_OVERFLOW,
4444
connect_args={"server_settings": server_settings},
4545
pool_pre_ping=True, # https://docs.sqlalchemy.org/en/14/core/pooling.html#dealing-with-disconnects
4646
future=True, # this uses sqlalchemy 2.0 API, shall be removed when sqlalchemy 2.0 is released
@@ -90,8 +90,8 @@ async def with_async_pg_engine(
9090

9191
engine = create_async_engine(
9292
settings.dsn_with_async_sqlalchemy,
93-
pool_size=settings.POSTGRES_MINSIZE,
94-
max_overflow=settings.POSTGRES_MAXSIZE - settings.POSTGRES_MINSIZE,
93+
pool_size=settings.POSTGRES_MAX_POOLSIZE,
94+
max_overflow=settings.POSTGRES_MAX_OVERFLOW,
9595
connect_args={"server_settings": server_settings},
9696
pool_pre_ping=True, # https://docs.sqlalchemy.org/en/14/core/pooling.html#dealing-with-disconnects
9797
future=True, # this uses sqlalchemy 2.0 API, shall be removed when sqlalchemy 2.0 is released

packages/settings-library/src/settings_library/postgres.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pydantic import (
66
AliasChoices,
77
Field,
8+
NonNegativeInt,
89
PostgresDsn,
910
SecretStr,
1011
model_validator,
@@ -30,11 +31,28 @@ class PostgresSettings(BaseCustomSettings):
3031

3132
# pool connection limits
3233
POSTGRES_MINSIZE: Annotated[
33-
int, Field(description="Minimum number of connections in the pool", ge=2)
34-
] = 2 # see https://github.com/ITISFoundation/osparc-simcore/pull/8199
34+
int,
35+
Field(
36+
description="Minimum number of connections in the pool that are always created and kept",
37+
ge=1,
38+
),
39+
] = 1
3540
POSTGRES_MAXSIZE: Annotated[
36-
int, Field(description="Maximum number of connections in the pool", ge=2)
41+
int,
42+
Field(
43+
description="Maximum number of connections in the pool that are kept",
44+
ge=1,
45+
),
3746
] = 50
47+
POSTGRES_MAX_POOLSIZE: Annotated[
48+
int,
49+
Field(
50+
description="Maximal number of connection in asyncpg pool (without overflow), lazily created on demand"
51+
),
52+
] = 10
53+
POSTGRES_MAX_OVERFLOW: Annotated[
54+
NonNegativeInt, Field(description="Maximal overflow connections")
55+
] = 20
3856

3957
POSTGRES_CLIENT_NAME: Annotated[
4058
str | None,
@@ -125,8 +143,10 @@ def _update_json_schema_extra(schema: JsonDict) -> None:
125143
"POSTGRES_USER": "usr",
126144
"POSTGRES_PASSWORD": "secret",
127145
"POSTGRES_DB": "db",
128-
"POSTGRES_MINSIZE": 2,
146+
"POSTGRES_MINSIZE": 1,
129147
"POSTGRES_MAXSIZE": 50,
148+
"POSTGRES_MAX_POOLSIZE": 10,
149+
"POSTGRES_MAX_OVERFLOW": 20,
130150
"POSTGRES_CLIENT_NAME": "my_app", # first-choice
131151
"HOST": "should be ignored",
132152
"HOST_NAME": "should be ignored",
@@ -136,4 +156,3 @@ def _update_json_schema_extra(schema: JsonDict) -> None:
136156
)
137157

138158
model_config = SettingsConfigDict(json_schema_extra=_update_json_schema_extra)
139-
model_config = SettingsConfigDict(json_schema_extra=_update_json_schema_extra)

packages/settings-library/tests/data/.env-compact

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
APP_HOST=localhost
44
APP_PORT=80
55
APP_OPTIONAL_ADDON='{"MODULE_VALUE": 10, "MODULE_VALUE_DEFAULT": 42}'
6-
APP_REQUIRED_PLUGIN='{"POSTGRES_HOST": "localhost", "POSTGRES_PORT": 5432, "POSTGRES_USER": "foo", "POSTGRES_PASSWORD": "**********", "POSTGRES_DB": "foodb", "POSTGRES_MINSIZE": 2, "POSTGRES_MAXSIZE": 50, "POSTGRES_CLIENT_NAME": "None"}'
6+
APP_REQUIRED_PLUGIN='{"POSTGRES_HOST": "localhost", "POSTGRES_PORT": 5432, "POSTGRES_USER": "foo", "POSTGRES_PASSWORD": "**********", "POSTGRES_DB": "foodb", "POSTGRES_MINSIZE": 1, "POSTGRES_MAX_POOLSIZE": 10, "POSTGRES_MAX_OVERFLOW": 20, "POSTGRES_MAXSIZE": 50, "POSTGRES_CLIENT_NAME": "None"}'

packages/settings-library/tests/data/.env-granular

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ POSTGRES_USER=foo
1212
POSTGRES_PASSWORD=**********
1313
# Database name
1414
POSTGRES_DB=foodb
15-
# Minimum number of connections in the pool
16-
POSTGRES_MINSIZE=2
17-
# Maximum number of connections in the pool
15+
POSTGRES_MINSIZE=1
16+
POSTGRES_MAX_POOLSIZE=10
17+
POSTGRES_MAX_OVERFLOW=20
1818
POSTGRES_MAXSIZE=50
1919
# Name of the application connecting the postgres database, will default to use the host hostname (hostname on linux)
2020
POSTGRES_CLIENT_NAME=None

packages/settings-library/tests/data/.env-mixed

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ POSTGRES_USER=foo
1212
POSTGRES_PASSWORD=**********
1313
# Database name
1414
POSTGRES_DB=foodb
15-
# Minimum number of connections in the pool
16-
POSTGRES_MINSIZE=2
17-
# Maximum number of connections in the pool
15+
POSTGRES_MINSIZE=1
16+
POSTGRES_MAX_POOLSIZE=10
17+
POSTGRES_MAX_OVERFLOW=20
1818
POSTGRES_MAXSIZE=50
1919
# Name of the application connecting the postgres database, will default to use the host hostname (hostname on linux)
2020
POSTGRES_CLIENT_NAME=None

packages/settings-library/tests/data/.env-sample

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ POSTGRES_USER=foo
88
POSTGRES_PASSWORD=secret
99
# Database name
1010
POSTGRES_DB=foodb
11-
# Maximum number of connections in the pool
12-
POSTGRES_MINSIZE=2
13-
# Minimum number of connections in the pool
11+
POSTGRES_MINSIZE=1
12+
POSTGRES_MAX_POOLSIZE=10
13+
POSTGRES_MAX_OVERFLOW=20
1414
POSTGRES_MAXSIZE=50
1515

1616
# --- APP_MODULE_FIELD ---

0 commit comments

Comments
 (0)