chore(setup): removed pre-built images step

This commit is contained in:
sharath 2025-05-17 21:58:49 +00:00
parent 3756b0b0aa
commit 05c8145072
No known key found for this signature in database
1 changed files with 40 additions and 36 deletions

View File

@ -743,42 +743,46 @@ def start_suna():
print_info("Starting Suna with Docker Compose...") print_info("Starting Suna with Docker Compose...")
try: try:
# TODO: uncomment when we have pre-built images on Docker Hub or GHCR
# GitHub repository environment variable setup # GitHub repository environment variable setup
github_repo = None # github_repo = None
print(f"\n{Colors.CYAN}Do you want to use pre-built images or build locally?{Colors.ENDC}") # print(f"\n{Colors.CYAN}Do you want to use pre-built images or build locally?{Colors.ENDC}")
print(f"{Colors.CYAN}[1] {Colors.GREEN}Pre-built images{Colors.ENDC} {Colors.CYAN}(faster){Colors.ENDC}") # print(f"{Colors.CYAN}[1] {Colors.GREEN}Pre-built images{Colors.ENDC} {Colors.CYAN}(faster){Colors.ENDC}")
print(f"{Colors.CYAN}[2] {Colors.GREEN}Build locally{Colors.ENDC} {Colors.CYAN}(customizable){Colors.ENDC}\n") # print(f"{Colors.CYAN}[2] {Colors.GREEN}Build locally{Colors.ENDC} {Colors.CYAN}(customizable){Colors.ENDC}\n")
while True: # while True:
build_choice = input("Enter your choice (1 or 2): ") # build_choice = input("Enter your choice (1 or 2): ")
if build_choice in ["1", "2"]: # if build_choice in ["1", "2"]:
break # break
print_error("Invalid selection. Please enter '1' for pre-built images or '2' for building locally.") # print_error("Invalid selection. Please enter '1' for pre-built images or '2' for building locally.")
use_prebuilt = build_choice == "1" # use_prebuilt = build_choice == "1"
if use_prebuilt: # if use_prebuilt:
# Get GitHub repository name from user # # Get GitHub repository name from user
print_info("For pre-built images, you need to specify a GitHub repository name") # print_info("For pre-built images, you need to specify a GitHub repository name")
print_info("Example format: your-github-username/repo-name") # print_info("Example format: your-github-username/repo-name")
github_repo = input("Enter GitHub repository name: ") # github_repo = input("Enter GitHub repository name: ")
if not github_repo or "/" not in github_repo: # if not github_repo or "/" not in github_repo:
print_warning("Invalid GitHub repository format. Using a default value.") # print_warning("Invalid GitHub repository format. Using a default value.")
# Create a random GitHub repository name as fallback # # Create a random GitHub repository name as fallback
random_name = ''.join(random.choices(string.ascii_lowercase, k=8)) # random_name = ''.join(random.choices(string.ascii_lowercase, k=8))
github_repo = f"user/{random_name}" # github_repo = f"user/{random_name}"
# Set the environment variable # # Set the environment variable
os.environ["GITHUB_REPOSITORY"] = github_repo # os.environ["GITHUB_REPOSITORY"] = github_repo
print_info(f"Using GitHub repository: {github_repo}") # print_info(f"Using GitHub repository: {github_repo}")
# # Start with pre-built images
# print_info("Using pre-built images...")
# subprocess.run(['docker', 'compose', '-f', 'docker-compose.ghcr.yaml', 'up', '-d'], check=True)
# else:
# # Start with docker-compose (build images locally)
# print_info("Building images locally...")
# subprocess.run(['docker', 'compose', 'up', '-d'], check=True)
# Start with pre-built images
print_info("Using pre-built images...")
subprocess.run(['docker', 'compose', '-f', 'docker-compose.ghcr.yaml', 'up', '-d'], check=True)
else:
# Start with docker-compose (build images locally)
print_info("Building images locally...") print_info("Building images locally...")
subprocess.run(['docker', 'compose', 'up', '-d'], check=True) subprocess.run(['docker', 'compose', 'up', '-d'], check=True)