Skip to content

Commit

Permalink
Merge pull request #305 from PrefectHQ/ephemeral
Browse files Browse the repository at this point in the history
Use prefect ephemeral mode
  • Loading branch information
jlowin authored Sep 11, 2024
2 parents e489588 + 517dc3e commit adb6600
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/controlflow/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,18 @@ class Settings(ControlFlowSettings):
alias="PREFECT_LOGGING_LEVEL",
)

prefect_api_url: Optional[str] = Field(
default=None,
description="The URL for the Prefect API. Leave unset to use an ephemeral API.",
alias="PREFECT_API_URL",
)

prefect_server_allow_ephemeral_mode: bool = Field(
default=True,
description="If True, ephemeral mode will be allowed for Prefect Server.",
alias="PREFECT_SERVER_ALLOW_EPHEMERAL_MODE",
)

_prefect_context: contextmanager = None

@field_validator("home_path", mode="before")
Expand All @@ -145,7 +157,11 @@ def _apply_prefect_settings(self):
self._prefect_context.__exit__(None, None, None)
self._prefect_context = None

settings_map = {"prefect_log_level": prefect.settings.PREFECT_LOGGING_LEVEL}
settings_map = {
"prefect_log_level": prefect.settings.PREFECT_LOGGING_LEVEL,
"prefect_api_url": prefect.settings.PREFECT_API_URL,
"prefect_server_allow_ephemeral_mode": prefect.settings.PREFECT_SERVER_ALLOW_EPHEMERAL_MODE,
}

prefect_settings = {}

Expand Down

0 comments on commit adb6600

Please sign in to comment.