|
1 | 1 | import os |
2 | 2 | import warnings |
3 | | -from typing import Optional |
4 | | -from pathlib import Path |
5 | 3 | import typer |
6 | 4 | import uvicorn |
7 | 5 | from typing_extensions import Annotated |
| 6 | +from typing import Optional |
| 7 | +from pathlib import Path |
8 | 8 |
|
9 | 9 | from .version import VERSION |
10 | 10 | from .._docker import ( |
@@ -59,22 +59,37 @@ def ui( |
59 | 59 | rebuild_docker: bool, optional: Rebuild the docker images. Defaults to False. |
60 | 60 | """ |
61 | 61 |
|
| 62 | + typer.echo(typer.style("Starting Magentic-UI", fg=typer.colors.GREEN, bold=True)) |
| 63 | + |
62 | 64 | # Set things up for Docker |
| 65 | + typer.echo("Checking if Docker is running...", nl=False) |
| 66 | + |
63 | 67 | if not check_docker_running(): |
| 68 | + typer.echo(typer.style("Failed\n", fg=typer.colors.RED, bold=True)) |
64 | 69 | typer.echo("Docker is not running. Please start Docker and try again.") |
65 | 70 | raise typer.Exit(1) |
| 71 | + else: |
| 72 | + typer.echo(typer.style("OK", fg=typer.colors.GREEN, bold=True)) |
66 | 73 |
|
| 74 | + typer.echo("Checking Docker vnc browser image...", nl=False) |
67 | 75 | if not check_browser_image() or rebuild_docker: |
68 | | - typer.echo( |
69 | | - "Docker image for vnc browser not found. Building the image (this may take a few minutes)..." |
70 | | - ) |
| 76 | + typer.echo(typer.style("Update\n", fg=typer.colors.YELLOW, bold=True)) |
| 77 | + typer.echo("Building Docker vnc image (this WILL take a few minutes)") |
71 | 78 | build_browser_image() |
| 79 | + typer.echo("\n") |
| 80 | + else: |
| 81 | + typer.echo(typer.style("OK", fg=typer.colors.GREEN, bold=True)) |
72 | 82 |
|
| 83 | + typer.echo("Checking Docker python image...", nl=False) |
73 | 84 | if not check_python_image() or rebuild_docker: |
74 | | - typer.echo( |
75 | | - "Docker image for python not found. Building the image (this may take a few minutes)..." |
76 | | - ) |
| 85 | + typer.echo(typer.style("Update\n", fg=typer.colors.YELLOW, bold=True)) |
| 86 | + typer.echo("Building Docker python image (this WILL take a few minutes)") |
77 | 87 | build_python_image() |
| 88 | + typer.echo("\n") |
| 89 | + else: |
| 90 | + typer.echo(typer.style("OK", fg=typer.colors.GREEN, bold=True)) |
| 91 | + |
| 92 | + typer.echo("Launching Web Application...") |
78 | 93 |
|
79 | 94 | # Write configuration |
80 | 95 | env_vars = { |
|
0 commit comments