Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require a PREFECT_API_URL to start a worker #13942

Merged
merged 1 commit into from
Jun 12, 2024
Merged

Conversation

chrisguidry
Copy link
Collaborator

When there's no PREFECT_API_URL set, calls to get_client will start the
ephemeral server transparently for the user. This works amazingly well for
running single flows and tasks for demos and testing. In the default
configuration, you can share a SQLite database across several Prefect processes,
like a server and a worker, and things will generally appear to work.

However, when we start to get into more advanced infrastructure like Worker
and TaskWorker, it doesn't make sense to run these ephemerally without a
Prefect server. Event-driven workflows and background task scheduling require
a running server, and we should be explicit about that fact to avoid the
possibility for confusion (like events not being emitted, or automations not
running as expected).

Fixes #13876

When there's no `PREFECT_API_URL` set, calls to `get_client` will start the
ephemeral server transparently for the user.  This works amazingly well for
running single flows and tasks for demos and testing.  In the default
configuration, you can share a SQLite database across several Prefect processes,
like a server and a worker, and things will generally appear to work.

However, when we start to get into more advanced infrastructure like `Worker`
and `TaskWorker`, it doesn't make sense to run these ephemerally without a
Prefect server.  Event-driven workflows and background task scheduling require
a running server, and we should be explicit about that fact to avoid the
possibility for confusion (like events not being emitted, or automations not
running as expected).

Fixes #13876
@chrisguidry chrisguidry requested a review from a team as a code owner June 11, 2024 20:37
@chrisguidry chrisguidry merged commit 976f84c into main Jun 12, 2024
26 checks passed
@chrisguidry chrisguidry deleted the worker-require-api-url branch June 12, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No flow run state events in OSS except for Scheduled state types
2 participants