prefect-client 3.1.12__py3-none-any.whl → 3.1.14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- prefect/_experimental/lineage.py +63 -0
- prefect/_experimental/sla/client.py +53 -27
- prefect/_experimental/sla/objects.py +10 -2
- prefect/_internal/concurrency/services.py +2 -2
- prefect/_internal/concurrency/threads.py +6 -0
- prefect/_internal/retries.py +6 -3
- prefect/_internal/schemas/validators.py +6 -4
- prefect/_version.py +3 -3
- prefect/artifacts.py +4 -1
- prefect/automations.py +1 -1
- prefect/blocks/abstract.py +5 -2
- prefect/blocks/notifications.py +1 -0
- prefect/cache_policies.py +70 -22
- prefect/client/orchestration/_automations/client.py +4 -0
- prefect/client/orchestration/_deployments/client.py +3 -3
- prefect/client/utilities.py +3 -3
- prefect/context.py +16 -6
- prefect/deployments/base.py +7 -4
- prefect/deployments/flow_runs.py +5 -1
- prefect/deployments/runner.py +6 -11
- prefect/deployments/steps/core.py +1 -1
- prefect/deployments/steps/pull.py +8 -3
- prefect/deployments/steps/utility.py +2 -2
- prefect/docker/docker_image.py +13 -9
- prefect/engine.py +19 -10
- prefect/events/cli/automations.py +4 -4
- prefect/events/clients.py +17 -14
- prefect/events/filters.py +34 -34
- prefect/events/schemas/automations.py +12 -8
- prefect/events/schemas/events.py +5 -1
- prefect/events/worker.py +1 -1
- prefect/filesystems.py +1 -1
- prefect/flow_engine.py +172 -123
- prefect/flows.py +119 -74
- prefect/futures.py +14 -7
- prefect/infrastructure/provisioners/__init__.py +2 -0
- prefect/infrastructure/provisioners/cloud_run.py +4 -4
- prefect/infrastructure/provisioners/coiled.py +249 -0
- prefect/infrastructure/provisioners/container_instance.py +4 -3
- prefect/infrastructure/provisioners/ecs.py +55 -43
- prefect/infrastructure/provisioners/modal.py +5 -4
- prefect/input/actions.py +5 -1
- prefect/input/run_input.py +157 -43
- prefect/logging/configuration.py +5 -8
- prefect/logging/filters.py +2 -2
- prefect/logging/formatters.py +15 -11
- prefect/logging/handlers.py +24 -14
- prefect/logging/highlighters.py +5 -5
- prefect/logging/loggers.py +29 -20
- prefect/main.py +3 -1
- prefect/results.py +166 -86
- prefect/runner/runner.py +112 -84
- prefect/runner/server.py +3 -1
- prefect/runner/storage.py +18 -18
- prefect/runner/submit.py +19 -12
- prefect/runtime/deployment.py +15 -8
- prefect/runtime/flow_run.py +19 -6
- prefect/runtime/task_run.py +7 -3
- prefect/settings/base.py +17 -7
- prefect/settings/legacy.py +4 -4
- prefect/settings/models/api.py +4 -3
- prefect/settings/models/cli.py +4 -3
- prefect/settings/models/client.py +7 -4
- prefect/settings/models/cloud.py +4 -3
- prefect/settings/models/deployments.py +4 -3
- prefect/settings/models/experiments.py +4 -3
- prefect/settings/models/flows.py +4 -3
- prefect/settings/models/internal.py +4 -3
- prefect/settings/models/logging.py +8 -6
- prefect/settings/models/results.py +4 -3
- prefect/settings/models/root.py +11 -16
- prefect/settings/models/runner.py +8 -5
- prefect/settings/models/server/api.py +6 -3
- prefect/settings/models/server/database.py +120 -25
- prefect/settings/models/server/deployments.py +4 -3
- prefect/settings/models/server/ephemeral.py +7 -4
- prefect/settings/models/server/events.py +6 -3
- prefect/settings/models/server/flow_run_graph.py +4 -3
- prefect/settings/models/server/root.py +4 -3
- prefect/settings/models/server/services.py +15 -12
- prefect/settings/models/server/tasks.py +7 -4
- prefect/settings/models/server/ui.py +4 -3
- prefect/settings/models/tasks.py +10 -5
- prefect/settings/models/testing.py +4 -3
- prefect/settings/models/worker.py +7 -4
- prefect/settings/profiles.py +13 -12
- prefect/settings/sources.py +20 -19
- prefect/states.py +17 -13
- prefect/task_engine.py +43 -33
- prefect/task_runners.py +35 -23
- prefect/task_runs.py +20 -11
- prefect/task_worker.py +12 -7
- prefect/tasks.py +67 -25
- prefect/telemetry/bootstrap.py +4 -1
- prefect/telemetry/run_telemetry.py +15 -13
- prefect/transactions.py +3 -3
- prefect/types/__init__.py +9 -6
- prefect/types/_datetime.py +19 -0
- prefect/utilities/_deprecated.py +38 -0
- prefect/utilities/engine.py +11 -4
- prefect/utilities/filesystem.py +2 -2
- prefect/utilities/generics.py +1 -1
- prefect/utilities/pydantic.py +21 -36
- prefect/workers/base.py +52 -30
- prefect/workers/process.py +20 -15
- prefect/workers/server.py +4 -5
- {prefect_client-3.1.12.dist-info → prefect_client-3.1.14.dist-info}/METADATA +2 -2
- {prefect_client-3.1.12.dist-info → prefect_client-3.1.14.dist-info}/RECORD +111 -108
- {prefect_client-3.1.12.dist-info → prefect_client-3.1.14.dist-info}/LICENSE +0 -0
- {prefect_client-3.1.12.dist-info → prefect_client-3.1.14.dist-info}/WHEEL +0 -0
- {prefect_client-3.1.12.dist-info → prefect_client-3.1.14.dist-info}/top_level.txt +0 -0
prefect/settings/models/root.py
CHANGED
@@ -11,10 +11,11 @@ from typing import (
|
|
11
11
|
)
|
12
12
|
from urllib.parse import urlparse
|
13
13
|
|
14
|
-
from pydantic import BeforeValidator,
|
14
|
+
from pydantic import BeforeValidator, Field, SecretStr, model_validator
|
15
|
+
from pydantic_settings import SettingsConfigDict
|
15
16
|
from typing_extensions import Self
|
16
17
|
|
17
|
-
from prefect.settings.base import PrefectBaseSettings,
|
18
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
18
19
|
from prefect.settings.models.tasks import TasksSettings
|
19
20
|
from prefect.settings.models.testing import TestingSettings
|
20
21
|
from prefect.settings.models.worker import WorkerSettings
|
@@ -44,7 +45,7 @@ class Settings(PrefectBaseSettings):
|
|
44
45
|
See https://docs.pydantic.dev/latest/concepts/pydantic_settings
|
45
46
|
"""
|
46
47
|
|
47
|
-
model_config: ClassVar[
|
48
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config()
|
48
49
|
|
49
50
|
home: Annotated[Path, BeforeValidator(lambda x: Path(x).expanduser())] = Field(
|
50
51
|
default=Path("~") / ".prefect",
|
@@ -214,11 +215,7 @@ class Settings(PrefectBaseSettings):
|
|
214
215
|
if self.server.database.connection_url is None:
|
215
216
|
self.server.database.connection_url = _default_database_connection_url(self)
|
216
217
|
self.server.database.__pydantic_fields_set__.remove("connection_url")
|
217
|
-
db_url = (
|
218
|
-
self.server.database.connection_url.get_secret_value()
|
219
|
-
if isinstance(self.server.database.connection_url, SecretStr)
|
220
|
-
else self.server.database.connection_url
|
221
|
-
)
|
218
|
+
db_url = self.server.database.connection_url.get_secret_value()
|
222
219
|
if (
|
223
220
|
"PREFECT_API_DATABASE_PASSWORD" in db_url
|
224
221
|
or "PREFECT_SERVER_DATABASE_PASSWORD" in db_url
|
@@ -275,7 +272,7 @@ class Settings(PrefectBaseSettings):
|
|
275
272
|
# To restore defaults, we need to resolve the setting path and then
|
276
273
|
# set the default value on the new settings object. When restoring
|
277
274
|
# defaults, all settings sources will be ignored.
|
278
|
-
restore_defaults_obj = {}
|
275
|
+
restore_defaults_obj: dict[str, Any] = {}
|
279
276
|
for r in restore_defaults or []:
|
280
277
|
path = r.accessor.split(".")
|
281
278
|
model = self
|
@@ -301,11 +298,11 @@ class Settings(PrefectBaseSettings):
|
|
301
298
|
updates = updates or {}
|
302
299
|
set_defaults = set_defaults or {}
|
303
300
|
|
304
|
-
set_defaults_obj = {}
|
301
|
+
set_defaults_obj: dict[str, Any] = {}
|
305
302
|
for setting, value in set_defaults.items():
|
306
303
|
set_in_dict(set_defaults_obj, setting.accessor, value)
|
307
304
|
|
308
|
-
updates_obj = {}
|
305
|
+
updates_obj: dict[str, Any] = {}
|
309
306
|
for setting, value in updates.items():
|
310
307
|
set_in_dict(updates_obj, setting.accessor, value)
|
311
308
|
|
@@ -377,7 +374,7 @@ def _warn_on_misconfigured_api_url(settings: "Settings"):
|
|
377
374
|
"`PREFECT_API_URL` uses `/workspace/` but should use `/workspaces/`."
|
378
375
|
),
|
379
376
|
}
|
380
|
-
warnings_list = []
|
377
|
+
warnings_list: list[str] = []
|
381
378
|
|
382
379
|
for misconfig, warning in misconfigured_mappings.items():
|
383
380
|
if misconfig in api_url:
|
@@ -399,7 +396,7 @@ def _warn_on_misconfigured_api_url(settings: "Settings"):
|
|
399
396
|
|
400
397
|
|
401
398
|
def _default_database_connection_url(settings: "Settings") -> SecretStr:
|
402
|
-
value =
|
399
|
+
value: str = f"sqlite+aiosqlite:///{settings.home}/prefect.db"
|
403
400
|
if settings.server.database.driver == "postgresql+asyncpg":
|
404
401
|
required = [
|
405
402
|
"host",
|
@@ -417,7 +414,7 @@ def _default_database_connection_url(settings: "Settings") -> SecretStr:
|
|
417
414
|
|
418
415
|
from sqlalchemy import URL
|
419
416
|
|
420
|
-
|
417
|
+
value = URL(
|
421
418
|
drivername=settings.server.database.driver,
|
422
419
|
host=settings.server.database.host,
|
423
420
|
port=settings.server.database.port or 5432,
|
@@ -443,6 +440,4 @@ def _default_database_connection_url(settings: "Settings") -> SecretStr:
|
|
443
440
|
raise ValueError(
|
444
441
|
f"Unsupported database driver: {settings.server.database.driver}"
|
445
442
|
)
|
446
|
-
|
447
|
-
value = value if value else f"sqlite+aiosqlite:///{settings.home}/prefect.db"
|
448
443
|
return SecretStr(value)
|
@@ -1,8 +1,9 @@
|
|
1
1
|
from typing import ClassVar, Optional
|
2
2
|
|
3
|
-
from pydantic import
|
3
|
+
from pydantic import Field
|
4
|
+
from pydantic_settings import SettingsConfigDict
|
4
5
|
|
5
|
-
from prefect.settings.base import PrefectBaseSettings,
|
6
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
6
7
|
from prefect.types import LogLevel
|
7
8
|
|
8
9
|
|
@@ -11,7 +12,9 @@ class RunnerServerSettings(PrefectBaseSettings):
|
|
11
12
|
Settings for controlling runner server behavior
|
12
13
|
"""
|
13
14
|
|
14
|
-
model_config: ClassVar[
|
15
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
16
|
+
("runner", "server")
|
17
|
+
)
|
15
18
|
|
16
19
|
enable: bool = Field(
|
17
20
|
default=False,
|
@@ -29,7 +32,7 @@ class RunnerServerSettings(PrefectBaseSettings):
|
|
29
32
|
)
|
30
33
|
|
31
34
|
log_level: LogLevel = Field(
|
32
|
-
default="
|
35
|
+
default="ERROR",
|
33
36
|
description="The log level of the runner's webserver.",
|
34
37
|
)
|
35
38
|
|
@@ -44,7 +47,7 @@ class RunnerSettings(PrefectBaseSettings):
|
|
44
47
|
Settings for controlling runner behavior
|
45
48
|
"""
|
46
49
|
|
47
|
-
model_config: ClassVar[
|
50
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(("runner",))
|
48
51
|
|
49
52
|
process_limit: int = Field(
|
50
53
|
default=5,
|
@@ -1,9 +1,10 @@
|
|
1
1
|
from datetime import timedelta
|
2
2
|
from typing import ClassVar, Optional
|
3
3
|
|
4
|
-
from pydantic import AliasChoices, AliasPath,
|
4
|
+
from pydantic import AliasChoices, AliasPath, Field, SecretStr
|
5
|
+
from pydantic_settings import SettingsConfigDict
|
5
6
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings,
|
7
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
7
8
|
|
8
9
|
|
9
10
|
class ServerAPISettings(PrefectBaseSettings):
|
@@ -11,7 +12,9 @@ class ServerAPISettings(PrefectBaseSettings):
|
|
11
12
|
Settings for controlling API server behavior
|
12
13
|
"""
|
13
14
|
|
14
|
-
model_config: ClassVar[
|
15
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
16
|
+
("server", "api")
|
17
|
+
)
|
15
18
|
|
16
19
|
auth_string: Optional[SecretStr] = Field(
|
17
20
|
default=None,
|
@@ -1,18 +1,80 @@
|
|
1
1
|
import warnings
|
2
|
-
from typing import ClassVar, Optional
|
2
|
+
from typing import Any, ClassVar, Optional
|
3
3
|
from urllib.parse import quote_plus
|
4
4
|
|
5
5
|
from pydantic import (
|
6
6
|
AliasChoices,
|
7
7
|
AliasPath,
|
8
|
-
ConfigDict,
|
9
8
|
Field,
|
10
9
|
SecretStr,
|
11
10
|
model_validator,
|
12
11
|
)
|
12
|
+
from pydantic_settings import SettingsConfigDict
|
13
13
|
from typing_extensions import Literal, Self
|
14
14
|
|
15
|
-
from prefect.settings.base import PrefectBaseSettings,
|
15
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
16
|
+
|
17
|
+
|
18
|
+
class SQLAlchemyConnectArgsSettings(PrefectBaseSettings):
|
19
|
+
"""
|
20
|
+
Settings for controlling SQLAlchemy connection behavior; note that these settings only take effect when
|
21
|
+
using a PostgreSQL database.
|
22
|
+
"""
|
23
|
+
|
24
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
25
|
+
("server", "database", "sqlalchemy", "connect_args")
|
26
|
+
)
|
27
|
+
|
28
|
+
application_name: Optional[str] = Field(
|
29
|
+
default=None,
|
30
|
+
description="Controls the application_name field for connections opened from the connection pool when using a PostgreSQL database with the Prefect backend.",
|
31
|
+
)
|
32
|
+
|
33
|
+
|
34
|
+
class SQLAlchemySettings(PrefectBaseSettings):
|
35
|
+
"""
|
36
|
+
Settings for controlling SQLAlchemy behavior; note that these settings only take effect when
|
37
|
+
using a PostgreSQL database.
|
38
|
+
"""
|
39
|
+
|
40
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
41
|
+
("server", "database", "sqlalchemy")
|
42
|
+
)
|
43
|
+
|
44
|
+
connect_args: SQLAlchemyConnectArgsSettings = Field(
|
45
|
+
default_factory=SQLAlchemyConnectArgsSettings,
|
46
|
+
description="Settings for controlling SQLAlchemy connection behavior",
|
47
|
+
)
|
48
|
+
|
49
|
+
pool_size: int = Field(
|
50
|
+
default=5,
|
51
|
+
description="Controls connection pool size of database connection pools from the Prefect backend.",
|
52
|
+
validation_alias=AliasChoices(
|
53
|
+
AliasPath("pool_size"),
|
54
|
+
"prefect_server_database_sqlalchemy_pool_size",
|
55
|
+
"prefect_sqlalchemy_pool_size",
|
56
|
+
),
|
57
|
+
)
|
58
|
+
|
59
|
+
pool_recycle: int = Field(
|
60
|
+
default=3600,
|
61
|
+
description="This setting causes the pool to recycle connections after the given number of seconds has passed; set it to -1 to avoid recycling entirely.",
|
62
|
+
)
|
63
|
+
|
64
|
+
pool_timeout: Optional[float] = Field(
|
65
|
+
default=30.0,
|
66
|
+
description="Number of seconds to wait before giving up on getting a connection from the pool. Defaults to 30 seconds.",
|
67
|
+
)
|
68
|
+
|
69
|
+
max_overflow: int = Field(
|
70
|
+
default=10,
|
71
|
+
description="Controls maximum overflow of the connection pool. To prevent overflow, set to -1.",
|
72
|
+
validation_alias=AliasChoices(
|
73
|
+
AliasPath("max_overflow"),
|
74
|
+
"prefect_server_database_sqlalchemy_max_overflow",
|
75
|
+
"prefect_sqlalchemy_max_overflow",
|
76
|
+
),
|
77
|
+
)
|
16
78
|
|
17
79
|
|
18
80
|
class ServerDatabaseSettings(PrefectBaseSettings):
|
@@ -20,7 +82,14 @@ class ServerDatabaseSettings(PrefectBaseSettings):
|
|
20
82
|
Settings for controlling server database behavior
|
21
83
|
"""
|
22
84
|
|
23
|
-
model_config: ClassVar[
|
85
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
86
|
+
("server", "database")
|
87
|
+
)
|
88
|
+
|
89
|
+
sqlalchemy: SQLAlchemySettings = Field(
|
90
|
+
default_factory=SQLAlchemySettings,
|
91
|
+
description="Settings for controlling SQLAlchemy behavior",
|
92
|
+
)
|
24
93
|
|
25
94
|
connection_url: Optional[SecretStr] = Field(
|
26
95
|
default=None,
|
@@ -128,7 +197,7 @@ class ServerDatabaseSettings(PrefectBaseSettings):
|
|
128
197
|
|
129
198
|
timeout: Optional[float] = Field(
|
130
199
|
default=10.0,
|
131
|
-
description="A statement timeout, in seconds, applied to all database interactions made by the
|
200
|
+
description="A statement timeout, in seconds, applied to all database interactions made by the Prefect backend. Defaults to 10 seconds.",
|
132
201
|
validation_alias=AliasChoices(
|
133
202
|
AliasPath("timeout"),
|
134
203
|
"prefect_server_database_timeout",
|
@@ -146,25 +215,49 @@ class ServerDatabaseSettings(PrefectBaseSettings):
|
|
146
215
|
),
|
147
216
|
)
|
148
217
|
|
149
|
-
|
150
|
-
default=None,
|
151
|
-
description="Controls connection pool size when using a PostgreSQL database with the Prefect API. If not set, the default SQLAlchemy pool size will be used.",
|
152
|
-
validation_alias=AliasChoices(
|
153
|
-
AliasPath("sqlalchemy_pool_size"),
|
154
|
-
"prefect_server_database_sqlalchemy_pool_size",
|
155
|
-
"prefect_sqlalchemy_pool_size",
|
156
|
-
),
|
157
|
-
)
|
218
|
+
# handle deprecated fields
|
158
219
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
"
|
166
|
-
|
167
|
-
|
220
|
+
def __getattribute__(self, name: str) -> Any:
|
221
|
+
if name in ["sqlalchemy_pool_size", "sqlalchemy_max_overflow"]:
|
222
|
+
warnings.warn(
|
223
|
+
f"Setting {name} has been moved to the `sqlalchemy` settings group.",
|
224
|
+
DeprecationWarning,
|
225
|
+
)
|
226
|
+
field_name = name.replace("sqlalchemy_", "")
|
227
|
+
return getattr(super().__getattribute__("sqlalchemy"), field_name)
|
228
|
+
return super().__getattribute__(name)
|
229
|
+
|
230
|
+
# validators
|
231
|
+
|
232
|
+
@model_validator(mode="before")
|
233
|
+
@classmethod
|
234
|
+
def set_deprecated_sqlalchemy_settings_on_child_model_and_warn(
|
235
|
+
cls, values: dict[str, Any]
|
236
|
+
) -> dict[str, Any]:
|
237
|
+
"""
|
238
|
+
Set deprecated settings on the child model.
|
239
|
+
"""
|
240
|
+
# Initialize sqlalchemy settings if not present
|
241
|
+
if "sqlalchemy" not in values:
|
242
|
+
values["sqlalchemy"] = SQLAlchemySettings()
|
243
|
+
|
244
|
+
if "sqlalchemy_pool_size" in values:
|
245
|
+
warnings.warn(
|
246
|
+
"`sqlalchemy_pool_size` has been moved to the `sqlalchemy` settings group as `pool_size`.",
|
247
|
+
DeprecationWarning,
|
248
|
+
)
|
249
|
+
if "pool_size" not in values["sqlalchemy"].model_fields_set:
|
250
|
+
values["sqlalchemy"].pool_size = values["sqlalchemy_pool_size"]
|
251
|
+
|
252
|
+
if "sqlalchemy_max_overflow" in values:
|
253
|
+
warnings.warn(
|
254
|
+
"`sqlalchemy_max_overflow` has been moved to the `sqlalchemy` settings group as `max_overflow`.",
|
255
|
+
DeprecationWarning,
|
256
|
+
)
|
257
|
+
if "max_overflow" not in values["sqlalchemy"].model_fields_set:
|
258
|
+
values["sqlalchemy"].max_overflow = values["sqlalchemy_max_overflow"]
|
259
|
+
|
260
|
+
return values
|
168
261
|
|
169
262
|
@model_validator(mode="after")
|
170
263
|
def emit_warnings(self) -> Self: # noqa: F821
|
@@ -173,7 +266,9 @@ class ServerDatabaseSettings(PrefectBaseSettings):
|
|
173
266
|
return self
|
174
267
|
|
175
268
|
|
176
|
-
def warn_on_database_password_value_without_usage(
|
269
|
+
def warn_on_database_password_value_without_usage(
|
270
|
+
settings: ServerDatabaseSettings,
|
271
|
+
) -> None:
|
177
272
|
"""
|
178
273
|
Validator for settings warning if the database password is set but not used.
|
179
274
|
"""
|
@@ -201,4 +296,4 @@ def warn_on_database_password_value_without_usage(settings: ServerDatabaseSettin
|
|
201
296
|
"PREFECT_SERVER_DATABASE_CONNECTION_URL. "
|
202
297
|
"The provided password will be ignored."
|
203
298
|
)
|
204
|
-
return
|
299
|
+
return None
|
@@ -1,12 +1,13 @@
|
|
1
1
|
from typing import ClassVar
|
2
2
|
|
3
|
-
from pydantic import AliasChoices, AliasPath,
|
3
|
+
from pydantic import AliasChoices, AliasPath, Field
|
4
|
+
from pydantic_settings import SettingsConfigDict
|
4
5
|
|
5
|
-
from prefect.settings.base import PrefectBaseSettings,
|
6
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
6
7
|
|
7
8
|
|
8
9
|
class ServerDeploymentsSettings(PrefectBaseSettings):
|
9
|
-
model_config: ClassVar[
|
10
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
10
11
|
("server", "deployments")
|
11
12
|
)
|
12
13
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
from typing import ClassVar
|
2
2
|
|
3
|
-
from pydantic import AliasChoices, AliasPath,
|
3
|
+
from pydantic import AliasChoices, AliasPath, Field
|
4
|
+
from pydantic_settings import SettingsConfigDict
|
4
5
|
|
5
|
-
from prefect.settings.base import PrefectBaseSettings,
|
6
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
6
7
|
|
7
8
|
|
8
9
|
class ServerEphemeralSettings(PrefectBaseSettings):
|
@@ -10,7 +11,9 @@ class ServerEphemeralSettings(PrefectBaseSettings):
|
|
10
11
|
Settings for controlling ephemeral server behavior
|
11
12
|
"""
|
12
13
|
|
13
|
-
model_config: ClassVar[
|
14
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
15
|
+
("server", "ephemeral")
|
16
|
+
)
|
14
17
|
|
15
18
|
enabled: bool = Field(
|
16
19
|
default=False,
|
@@ -28,6 +31,6 @@ class ServerEphemeralSettings(PrefectBaseSettings):
|
|
28
31
|
default=20,
|
29
32
|
description="""
|
30
33
|
The number of seconds to wait for the server to start when ephemeral mode is enabled.
|
31
|
-
Defaults to `
|
34
|
+
Defaults to `20`.
|
32
35
|
""",
|
33
36
|
)
|
@@ -1,9 +1,10 @@
|
|
1
1
|
from datetime import timedelta
|
2
2
|
from typing import ClassVar
|
3
3
|
|
4
|
-
from pydantic import AliasChoices, AliasPath,
|
4
|
+
from pydantic import AliasChoices, AliasPath, Field
|
5
|
+
from pydantic_settings import SettingsConfigDict
|
5
6
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings,
|
7
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
7
8
|
|
8
9
|
|
9
10
|
class ServerEventsSettings(PrefectBaseSettings):
|
@@ -11,7 +12,9 @@ class ServerEventsSettings(PrefectBaseSettings):
|
|
11
12
|
Settings for controlling behavior of the events subsystem
|
12
13
|
"""
|
13
14
|
|
14
|
-
model_config: ClassVar[
|
15
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
16
|
+
("server", "events")
|
17
|
+
)
|
15
18
|
|
16
19
|
###########################################################################
|
17
20
|
# Events settings
|
@@ -1,8 +1,9 @@
|
|
1
1
|
from typing import ClassVar
|
2
2
|
|
3
|
-
from pydantic import AliasChoices, AliasPath,
|
3
|
+
from pydantic import AliasChoices, AliasPath, Field
|
4
|
+
from pydantic_settings import SettingsConfigDict
|
4
5
|
|
5
|
-
from prefect.settings.base import PrefectBaseSettings,
|
6
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
6
7
|
|
7
8
|
|
8
9
|
class ServerFlowRunGraphSettings(PrefectBaseSettings):
|
@@ -10,7 +11,7 @@ class ServerFlowRunGraphSettings(PrefectBaseSettings):
|
|
10
11
|
Settings for controlling behavior of the flow run graph
|
11
12
|
"""
|
12
13
|
|
13
|
-
model_config: ClassVar[
|
14
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
14
15
|
("server", "flow_run_graph")
|
15
16
|
)
|
16
17
|
|
@@ -1,9 +1,10 @@
|
|
1
1
|
from pathlib import Path
|
2
2
|
from typing import ClassVar, Optional
|
3
3
|
|
4
|
-
from pydantic import AliasChoices, AliasPath,
|
4
|
+
from pydantic import AliasChoices, AliasPath, Field
|
5
|
+
from pydantic_settings import SettingsConfigDict
|
5
6
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings,
|
7
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
7
8
|
from prefect.types import LogLevel
|
8
9
|
|
9
10
|
from .api import ServerAPISettings
|
@@ -22,7 +23,7 @@ class ServerSettings(PrefectBaseSettings):
|
|
22
23
|
Settings for controlling server behavior
|
23
24
|
"""
|
24
25
|
|
25
|
-
model_config: ClassVar[
|
26
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(("server",))
|
26
27
|
|
27
28
|
logging_level: LogLevel = Field(
|
28
29
|
default="WARNING",
|
@@ -1,9 +1,10 @@
|
|
1
1
|
from datetime import timedelta
|
2
2
|
from typing import ClassVar
|
3
3
|
|
4
|
-
from pydantic import AliasChoices, AliasPath,
|
4
|
+
from pydantic import AliasChoices, AliasPath, Field
|
5
|
+
from pydantic_settings import SettingsConfigDict
|
5
6
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings,
|
7
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
7
8
|
|
8
9
|
|
9
10
|
class ServerServicesCancellationCleanupSettings(PrefectBaseSettings):
|
@@ -11,7 +12,7 @@ class ServerServicesCancellationCleanupSettings(PrefectBaseSettings):
|
|
11
12
|
Settings for controlling the cancellation cleanup service
|
12
13
|
"""
|
13
14
|
|
14
|
-
model_config: ClassVar[
|
15
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
15
16
|
("server", "services", "cancellation_cleanup")
|
16
17
|
)
|
17
18
|
|
@@ -41,7 +42,7 @@ class ServerServicesEventPersisterSettings(PrefectBaseSettings):
|
|
41
42
|
Settings for controlling the event persister service
|
42
43
|
"""
|
43
44
|
|
44
|
-
model_config: ClassVar[
|
45
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
45
46
|
("server", "services", "event_persister")
|
46
47
|
)
|
47
48
|
|
@@ -83,7 +84,7 @@ class ServerServicesFlowRunNotificationsSettings(PrefectBaseSettings):
|
|
83
84
|
Settings for controlling the flow run notifications service
|
84
85
|
"""
|
85
86
|
|
86
|
-
model_config: ClassVar[
|
87
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
87
88
|
("server", "services", "flow_run_notifications")
|
88
89
|
)
|
89
90
|
|
@@ -103,7 +104,7 @@ class ServerServicesForemanSettings(PrefectBaseSettings):
|
|
103
104
|
Settings for controlling the foreman service
|
104
105
|
"""
|
105
106
|
|
106
|
-
model_config: ClassVar[
|
107
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
107
108
|
("server", "services", "foreman")
|
108
109
|
)
|
109
110
|
|
@@ -184,7 +185,7 @@ class ServerServicesLateRunsSettings(PrefectBaseSettings):
|
|
184
185
|
Settings for controlling the late runs service
|
185
186
|
"""
|
186
187
|
|
187
|
-
model_config: ClassVar[
|
188
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
188
189
|
("server", "services", "late_runs")
|
189
190
|
)
|
190
191
|
|
@@ -228,7 +229,7 @@ class ServerServicesSchedulerSettings(PrefectBaseSettings):
|
|
228
229
|
Settings for controlling the scheduler service
|
229
230
|
"""
|
230
231
|
|
231
|
-
model_config: ClassVar[
|
232
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
232
233
|
("server", "services", "scheduler")
|
233
234
|
)
|
234
235
|
|
@@ -353,7 +354,7 @@ class ServerServicesPauseExpirationsSettings(PrefectBaseSettings):
|
|
353
354
|
Settings for controlling the pause expiration service
|
354
355
|
"""
|
355
356
|
|
356
|
-
model_config: ClassVar[
|
357
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
357
358
|
("server", "services", "pause_expirations")
|
358
359
|
)
|
359
360
|
|
@@ -389,7 +390,7 @@ class ServerServicesTaskRunRecorderSettings(PrefectBaseSettings):
|
|
389
390
|
Settings for controlling the task run recorder service
|
390
391
|
"""
|
391
392
|
|
392
|
-
model_config: ClassVar[
|
393
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
393
394
|
("server", "services", "task_run_recorder")
|
394
395
|
)
|
395
396
|
|
@@ -409,7 +410,7 @@ class ServerServicesTriggersSettings(PrefectBaseSettings):
|
|
409
410
|
Settings for controlling the triggers service
|
410
411
|
"""
|
411
412
|
|
412
|
-
model_config: ClassVar[
|
413
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
413
414
|
("server", "services", "triggers")
|
414
415
|
)
|
415
416
|
|
@@ -429,7 +430,9 @@ class ServerServicesSettings(PrefectBaseSettings):
|
|
429
430
|
Settings for controlling server services
|
430
431
|
"""
|
431
432
|
|
432
|
-
model_config: ClassVar[
|
433
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
434
|
+
("server", "services")
|
435
|
+
)
|
433
436
|
|
434
437
|
cancellation_cleanup: ServerServicesCancellationCleanupSettings = Field(
|
435
438
|
default_factory=ServerServicesCancellationCleanupSettings,
|
@@ -1,9 +1,10 @@
|
|
1
1
|
from datetime import timedelta
|
2
2
|
from typing import ClassVar
|
3
3
|
|
4
|
-
from pydantic import AliasChoices, AliasPath,
|
4
|
+
from pydantic import AliasChoices, AliasPath, Field
|
5
|
+
from pydantic_settings import SettingsConfigDict
|
5
6
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings,
|
7
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
7
8
|
|
8
9
|
|
9
10
|
class ServerTasksSchedulingSettings(PrefectBaseSettings):
|
@@ -11,7 +12,7 @@ class ServerTasksSchedulingSettings(PrefectBaseSettings):
|
|
11
12
|
Settings for controlling server-side behavior related to task scheduling
|
12
13
|
"""
|
13
14
|
|
14
|
-
model_config: ClassVar[
|
15
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
15
16
|
("server", "tasks", "scheduling")
|
16
17
|
)
|
17
18
|
|
@@ -51,7 +52,9 @@ class ServerTasksSettings(PrefectBaseSettings):
|
|
51
52
|
Settings for controlling server-side behavior related to tasks
|
52
53
|
"""
|
53
54
|
|
54
|
-
model_config: ClassVar[
|
55
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
56
|
+
("server", "tasks")
|
57
|
+
)
|
55
58
|
|
56
59
|
tag_concurrency_slot_wait_seconds: float = Field(
|
57
60
|
default=30,
|
@@ -1,12 +1,13 @@
|
|
1
1
|
from typing import ClassVar, Optional
|
2
2
|
|
3
|
-
from pydantic import AliasChoices, AliasPath,
|
3
|
+
from pydantic import AliasChoices, AliasPath, Field
|
4
|
+
from pydantic_settings import SettingsConfigDict
|
4
5
|
|
5
|
-
from prefect.settings.base import PrefectBaseSettings,
|
6
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
6
7
|
|
7
8
|
|
8
9
|
class ServerUISettings(PrefectBaseSettings):
|
9
|
-
model_config: ClassVar[
|
10
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(("server", "ui"))
|
10
11
|
|
11
12
|
enabled: bool = Field(
|
12
13
|
default=True,
|
prefect/settings/models/tasks.py
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
from typing import ClassVar, Optional, Union
|
2
2
|
|
3
|
-
from pydantic import AliasChoices, AliasPath,
|
3
|
+
from pydantic import AliasChoices, AliasPath, Field
|
4
|
+
from pydantic_settings import SettingsConfigDict
|
4
5
|
|
5
|
-
from prefect.settings.base import PrefectBaseSettings,
|
6
|
+
from prefect.settings.base import PrefectBaseSettings, build_settings_config
|
6
7
|
|
7
8
|
|
8
9
|
class TasksRunnerSettings(PrefectBaseSettings):
|
9
|
-
model_config: ClassVar[
|
10
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
11
|
+
("tasks", "runner")
|
12
|
+
)
|
10
13
|
|
11
14
|
thread_pool_max_workers: Optional[int] = Field(
|
12
15
|
default=None,
|
@@ -21,7 +24,9 @@ class TasksRunnerSettings(PrefectBaseSettings):
|
|
21
24
|
|
22
25
|
|
23
26
|
class TasksSchedulingSettings(PrefectBaseSettings):
|
24
|
-
model_config: ClassVar[
|
27
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(
|
28
|
+
("tasks", "scheduling")
|
29
|
+
)
|
25
30
|
|
26
31
|
default_storage_block: Optional[str] = Field(
|
27
32
|
default=None,
|
@@ -45,7 +50,7 @@ class TasksSchedulingSettings(PrefectBaseSettings):
|
|
45
50
|
|
46
51
|
|
47
52
|
class TasksSettings(PrefectBaseSettings):
|
48
|
-
model_config: ClassVar[
|
53
|
+
model_config: ClassVar[SettingsConfigDict] = build_settings_config(("tasks",))
|
49
54
|
|
50
55
|
refresh_cache: bool = Field(
|
51
56
|
default=False,
|