Fix chrome user data dir problem (#2503)
This commit is contained in:
@@ -40,6 +40,7 @@ def update_or_add_env_var(key: str, value: str) -> None:
|
||||
"BROWSER_ACTION_TIMEOUT_MS": "5000",
|
||||
"MAX_STEPS_PER_RUN": "50",
|
||||
"LOG_LEVEL": "INFO",
|
||||
"LITELLM_LOG": "CRITICAL",
|
||||
"DATABASE_STRING": "postgresql+psycopg://skyvern@localhost/skyvern",
|
||||
"PORT": "8000",
|
||||
"ANALYTICS_ID": "anonymous",
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import asyncio
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import typer
|
||||
from rich.panel import Panel
|
||||
@@ -11,6 +10,7 @@ from rich.progress import Progress, SpinnerColumn, TextColumn
|
||||
# Import console after skyvern.cli to ensure proper initialization
|
||||
from skyvern.cli.console import console
|
||||
from skyvern.cli.init_command import init # init is used directly
|
||||
from skyvern.cli.utils import start_services
|
||||
|
||||
quickstart_app = typer.Typer(help="Quickstart command to set up and run Skyvern with one command.")
|
||||
|
||||
@@ -29,40 +29,6 @@ def check_docker() -> bool:
|
||||
return False
|
||||
|
||||
|
||||
async def start_services(server_only: bool = False) -> None:
|
||||
"""Start Skyvern services in the background.
|
||||
|
||||
Args:
|
||||
server_only: If True, only start the server, not the UI.
|
||||
"""
|
||||
try:
|
||||
# Start server in the background
|
||||
server_process = await asyncio.create_subprocess_exec(
|
||||
sys.executable, "-m", "skyvern.cli.commands", "run", "server"
|
||||
)
|
||||
|
||||
# Give server a moment to start
|
||||
await asyncio.sleep(2)
|
||||
|
||||
if not server_only:
|
||||
# Start UI in the background
|
||||
ui_process = await asyncio.create_subprocess_exec(sys.executable, "-m", "skyvern.cli.commands", "run", "ui")
|
||||
|
||||
console.print("\n🎉 [bold green]Skyvern is now running![/bold green]")
|
||||
console.print("🌐 [bold]Access the UI at:[/bold] [cyan]http://localhost:8080[/cyan]")
|
||||
console.print("🔑 [bold]Your API key is in your .env file as SKYVERN_API_KEY[/bold]")
|
||||
|
||||
# Wait for processes to complete (they won't unless killed)
|
||||
if not server_only:
|
||||
await asyncio.gather(server_process.wait(), ui_process.wait())
|
||||
else:
|
||||
await server_process.wait()
|
||||
|
||||
except Exception as e:
|
||||
console.print(f"[bold red]Error starting services: {str(e)}[/bold red]")
|
||||
raise typer.Exit(1)
|
||||
|
||||
|
||||
@quickstart_app.callback(invoke_without_command=True)
|
||||
def quickstart(
|
||||
ctx: typer.Context,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
@@ -12,6 +13,7 @@ from mcp.server.fastmcp import FastMCP
|
||||
from rich.panel import Panel
|
||||
from rich.prompt import Confirm
|
||||
|
||||
from skyvern.cli.utils import start_services
|
||||
from skyvern.config import settings
|
||||
from skyvern.library.skyvern import Skyvern
|
||||
from skyvern.utils import detect_os
|
||||
@@ -153,6 +155,12 @@ def run_ui() -> None:
|
||||
return
|
||||
|
||||
|
||||
@run_app.command(name="all")
|
||||
def run_all() -> None:
|
||||
"""Run the Skyvern API server and UI server in parallel."""
|
||||
asyncio.run(start_services())
|
||||
|
||||
|
||||
@run_app.command(name="mcp")
|
||||
def run_mcp() -> None:
|
||||
"""Run the MCP server."""
|
||||
|
||||
40
skyvern/cli/utils.py
Normal file
40
skyvern/cli/utils.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import asyncio
|
||||
import sys
|
||||
|
||||
import typer
|
||||
|
||||
from skyvern.cli.console import console
|
||||
|
||||
|
||||
async def start_services(server_only: bool = False) -> None:
|
||||
"""Start Skyvern services in the background.
|
||||
|
||||
Args:
|
||||
server_only: If True, only start the server, not the UI.
|
||||
"""
|
||||
try:
|
||||
# Start server in the background
|
||||
server_process = await asyncio.create_subprocess_exec(
|
||||
sys.executable, "-m", "skyvern.cli.commands", "run", "server"
|
||||
)
|
||||
|
||||
# Give server a moment to start
|
||||
await asyncio.sleep(2)
|
||||
|
||||
if not server_only:
|
||||
# Start UI in the background
|
||||
ui_process = await asyncio.create_subprocess_exec(sys.executable, "-m", "skyvern.cli.commands", "run", "ui")
|
||||
|
||||
console.print("\n🎉 [bold green]Skyvern is now running![/bold green]")
|
||||
console.print("🌐 [bold]Access the UI at:[/bold] [cyan]http://localhost:8080[/cyan]")
|
||||
console.print("🔑 [bold]Your API key is in your .env file as SKYVERN_API_KEY[/bold]")
|
||||
|
||||
# Wait for processes to complete (they won't unless killed)
|
||||
if not server_only:
|
||||
await asyncio.gather(server_process.wait(), ui_process.wait())
|
||||
else:
|
||||
await server_process.wait()
|
||||
|
||||
except Exception as e:
|
||||
console.print(f"[bold red]Error starting services: {str(e)}[/bold red]")
|
||||
raise typer.Exit(1)
|
||||
Reference in New Issue
Block a user