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 some interpolation of config in Prefect server dev commands #2299

Merged
merged 4 commits into from Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -21,6 +21,7 @@ These changes are available in the [master branch](https://github.com/PrefectHQ/
- Fix possible subprocess deadlocks when sending stdout to `subprocess.PIPE` - [#2293](https://github.com/PrefectHQ/prefect/pull/2293), [#2295](https://github.com/PrefectHQ/prefect/pull/2295)
- Fix issue with Flow registration to non-standard Cloud backends - [#2292](https://github.com/PrefectHQ/prefect/pull/2292)
- Fix issue with registering Flows with Server that have required scheduled Parameters - [#2296](https://github.com/PrefectHQ/prefect/issues/2296)
- Fix interpolation of config for dev services CLI for Apollo - [#2299](https://github.com/PrefectHQ/prefect/pull/2299)

### Deprecations

Expand Down
14 changes: 7 additions & 7 deletions server/src/prefect_server/cli/dev.py
Expand Up @@ -30,7 +30,7 @@ def dev():
"""


def make_env(fname=None):
def make_dev_env(fname=None):

# replace localhost with postgres to use docker-compose dns
PREFECT_ENV = dict(
Expand All @@ -40,10 +40,10 @@ def make_env(fname=None):
)

APOLLO_ENV = dict(
HASURA_API_URL=f"http://hasura:{config.hasura.port}/v1alpha1/graphql",
HASURA_WS_URL=f"ws://hasura:{config.hasura.port}/v1alpha1/graphql",
PREFECT_API_URL=f"http://graphql:{config.services.graphql.port}{config.services.graphql.path}",
PREFECT_API_HEALTH_URL=f"http://graphql:{config.services.graphql.port}/health",
HASURA_API_URL=f"http://{config.hasura.host}:{config.hasura.port}/v1alpha1/graphql",
HASURA_WS_URL=f"ws://{config.hasura.host}:{config.hasura.port}/v1alpha1/graphql",
PREFECT_API_URL=f"http://{config.services.graphql.host}:{config.services.graphql.port}{config.services.graphql.path}",
PREFECT_API_HEALTH_URL=f"http://{config.services.graphql.host}:{config.services.graphql.port}/health",
)

POSTGRES_ENV = dict(
Expand Down Expand Up @@ -83,7 +83,7 @@ def infrastructure(tag, skip_pull):
"""
docker_dir = Path(prefect_server.__file__).parents[2] / "docker"

env = make_env()
env = make_dev_env()

proc = None
try:
Expand Down Expand Up @@ -229,7 +229,7 @@ def services(include, exclude):
procs.append(
subprocess.Popen(
["prefect-server", "services", service],
env=make_env(),
env=make_dev_env(),
preexec_fn=os.setsid,
)
)
Expand Down
2 changes: 2 additions & 0 deletions server/src/prefect_server/cli/services.py
Expand Up @@ -58,6 +58,8 @@ def ui():
or root_dir.parent / "server-web-ui"
)

ui_path = Path(ui_path)

if not ui_path.exists():
raise RuntimeError(
"Cannot find server-web-ui repository path. Please set PREFECT_SERVER_WEB_UI_PATH environment variable."
Expand Down