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

Fix ephemeral server start command for Windows #15421

Merged
merged 1 commit into from
Sep 18, 2024
Merged
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
9 changes: 4 additions & 5 deletions src/prefect/server/api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import socket
import sqlite3
import subprocess
import sys
import time
from contextlib import asynccontextmanager
from functools import partial, wraps
Expand Down Expand Up @@ -60,7 +61,6 @@
get_current_settings,
)
from prefect.utilities.hashing import hash_objects
from prefect.utilities.processutils import get_sys_executable

TITLE = "Prefect Server"
API_TITLE = "Prefect Prefect REST API"
Expand Down Expand Up @@ -821,18 +821,17 @@ def start(self, timeout: Optional[int] = None):
raise

def _run_uvicorn_command(self) -> subprocess.Popen:
# used to turn off background services
# used to turn off serving the UI
server_env = {
"PREFECT_UI_ENABLED": "0",
}
return subprocess.Popen(
args=[
get_sys_executable(),
sys.executable,
"-m",
"uvicorn",
"--app-dir",
# quote wrapping needed for windows paths with spaces
f'"{prefect.__module_path__.parent}"',
str(prefect.__module_path__.parent),
"--factory",
"prefect.server.api.server:create_app",
"--host",
Expand Down
Loading