PrefectHQ / prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
https://prefect.io
Apache License 2.0
15.36k stars 1.5k forks source link

CLI "prefect server start --no-ui" does not disable UI for started server #14476

Open GalLadislav opened 4 days ago

GalLadislav commented 4 days ago

First check

Bug summary

CLI command prefect server start starts the Prefect UI regardles of --no-ui parameter. More precisely, the parameter does not overload the setting PREFECT_UI_ENABLED.

The parameter sets environment variable PREFECT_API_SERVICES_UI, but in prefect.server.api.server:create_api_app the condition for mounting UI is based on PREFECT_UI_ENABLED setting.

I guess the same applies for prefect dev api (judging based on used PREFECT_API_SERVICES_UI, not tested)

The bug is present both in Prefect v2 and v3.

Reproduction

> prefect server start --no-ui

 ___ ___ ___ ___ ___ ___ _____ 
| _ \ _ \ __| __| __/ __|_   _| 
|  _/   / _|| _|| _| (__  | |  
|_| |_|_\___|_| |___\___| |_|  

Configure Prefect to communicate with the server with:

    prefect config set PREFECT_API_URL=http://127.0.0.1:4200/api

View the API reference documentation at http://127.0.0.1:4200/docs

The dashboard is disabled. Set `PREFECT_UI_ENABLED=1` to re-enable it.

> curl http://localhost:4200/

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="apple-touch-icon" sizes="180x180" href="/ico/apple-touch-icon.png">

    <link rel="icon" id="favicon-32" type="image/png" sizes="32x32" href="/ico/favicon-32x32.png" media="(prefers-color-scheme:light)">
    <link rel="icon" id="favicon-16" type="image/png" sizes="16x16" href="/ico/favicon-16x16.png" media="(prefers-color-scheme:light)">

    <link rel="icon" id="favicon-32-dark" type="image/png" sizes="32x32" href="/ico/favicon-32x32-dark.png" media="(prefers-color-scheme:dark)">
    <link rel="icon" id="favicon-16-dark" type="image/png" sizes="16x16" href="/ico/favicon-16x16-dark.png" media="(prefers-color-scheme:dark)">

    <link rel="icon" href="/favicon.ico" media="(prefers-color-scheme:no-preference)">
    <link rel="icon" href="/favicon.ico" media="(prefers-color-scheme:light)">
    <link rel="icon" href="/favicon-dark.ico" media="(prefers-color-scheme:dark)">

    <link rel="manifest" href="/ico/site.webmanifest">
    <link rel="mask-icon" href="/ico/safari-pinned-tab.svg" color="#5bbad5">

    <meta name="msapplication-TileColor" content="#da532c">
    <meta name="theme-color" content="#ffffff">

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Prefect Server</title>
    <script type="module" crossorigin src="/assets/index-BPVFo_AK.js"></script>
    <link rel="stylesheet" crossorigin href="/assets/index-CUH_Bzgw.css">
  </head>
  <body>
    <div id="app"></div>
  </body>
</html>

Error

No response

Versions (prefect version output)

Version:             3.0.0rc9
API version:         0.8.4
Python version:      3.12.4
Git commit:          b75631a7
Built:               Mon, Jun 24, 2024 5:50 PM
OS/Arch:             linux/x86_64
Profile:             default
Server type:         ephemeral
Pydantic version:    2.8.0
Server:
  Database:          sqlite
  SQLite version:    3.37.2

Additional context

No response

serinamarie commented 3 days ago

Hi @GalLadislav thanks for creating an issue! We've added this to our backlog.