mirror of https://github.com/kortix-ai/suna.git
Merge branch 'main' into refactor-xml-tools
This commit is contained in:
commit
1b075658ba
|
@ -1,17 +0,0 @@
|
||||||
name: Fly Deploy Production
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- PRODUCTION
|
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
name: Deploy production app
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
concurrency: deploy-group # optional: ensure only one action runs at a time
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: superfly/flyctl-actions/setup-flyctl@master
|
|
||||||
- run: cd backend && flyctl deploy --remote-only --config fly.production.toml
|
|
||||||
env:
|
|
||||||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
|
|
@ -1,17 +0,0 @@
|
||||||
name: Fly Deploy Staging
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
name: Deploy staging app
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
concurrency: deploy-group # optional: ensure only one action runs at a time
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: superfly/flyctl-actions/setup-flyctl@master
|
|
||||||
- run: cd backend && flyctl deploy --remote-only --config fly.staging.toml
|
|
||||||
env:
|
|
||||||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
|
|
@ -2,6 +2,9 @@ name: Update PRODUCTION Branch
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-production:
|
update-production:
|
||||||
name: Rebase PRODUCTION to main
|
name: Rebase PRODUCTION to main
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
# fly.toml app configuration file generated for backend-production-ogog on 2025-04-21T00:36:09+01:00
|
|
||||||
#
|
|
||||||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
|
|
||||||
#
|
|
||||||
|
|
||||||
app = 'backend-production-ogog'
|
|
||||||
primary_region = 'bos'
|
|
||||||
|
|
||||||
[build]
|
|
||||||
dockerfile = 'Dockerfile'
|
|
||||||
|
|
||||||
[http_service]
|
|
||||||
internal_port = 8000
|
|
||||||
force_https = true
|
|
||||||
auto_stop_machines = 'stop'
|
|
||||||
auto_start_machines = true
|
|
||||||
max_machines_count = 1
|
|
||||||
processes = ['app']
|
|
||||||
|
|
||||||
[[vm]]
|
|
||||||
memory = '16gb'
|
|
||||||
cpu_kind = 'performance'
|
|
||||||
cpus = 8
|
|
||||||
|
|
||||||
[env]
|
|
||||||
ENV_MODE = "production"
|
|
|
@ -1,26 +0,0 @@
|
||||||
# fly.toml app configuration file generated for backend-staging-icy-mountain-363 on 2025-04-21T00:32:15+01:00
|
|
||||||
#
|
|
||||||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
|
|
||||||
#
|
|
||||||
|
|
||||||
app = 'backend-staging-icy-mountain-363'
|
|
||||||
primary_region = 'cdg'
|
|
||||||
|
|
||||||
[build]
|
|
||||||
dockerfile = 'Dockerfile'
|
|
||||||
|
|
||||||
[http_service]
|
|
||||||
internal_port = 8000
|
|
||||||
force_https = true
|
|
||||||
auto_stop_machines = 'stop'
|
|
||||||
auto_start_machines = true
|
|
||||||
max_machines_count = 1
|
|
||||||
processes = ['app']
|
|
||||||
|
|
||||||
[[vm]]
|
|
||||||
memory = '1gb'
|
|
||||||
cpu_kind = 'shared'
|
|
||||||
cpus = 1
|
|
||||||
|
|
||||||
[env]
|
|
||||||
ENV_MODE = "staging"
|
|
43
setup.py
43
setup.py
|
@ -7,6 +7,8 @@ import subprocess
|
||||||
from getpass import getpass
|
from getpass import getpass
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
IS_WINDOWS = platform.system() == 'Windows'
|
||||||
|
|
||||||
# ANSI colors for pretty output
|
# ANSI colors for pretty output
|
||||||
class Colors:
|
class Colors:
|
||||||
HEADER = '\033[95m'
|
HEADER = '\033[95m'
|
||||||
|
@ -81,7 +83,8 @@ def check_requirements():
|
||||||
[cmd_to_check, '--version'],
|
[cmd_to_check, '--version'],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
check=True
|
check=True,
|
||||||
|
shell=IS_WINDOWS
|
||||||
)
|
)
|
||||||
print_success(f"{cmd} is installed")
|
print_success(f"{cmd} is installed")
|
||||||
except (subprocess.SubprocessError, FileNotFoundError):
|
except (subprocess.SubprocessError, FileNotFoundError):
|
||||||
|
@ -103,7 +106,8 @@ def check_docker_running():
|
||||||
['docker', 'info'],
|
['docker', 'info'],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
check=True
|
check=True,
|
||||||
|
shell=IS_WINDOWS
|
||||||
)
|
)
|
||||||
print_success("Docker is running")
|
print_success("Docker is running")
|
||||||
return True
|
return True
|
||||||
|
@ -550,7 +554,8 @@ def setup_supabase():
|
||||||
['supabase', '--version'],
|
['supabase', '--version'],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
check=True
|
check=True,
|
||||||
|
shell=IS_WINDOWS
|
||||||
)
|
)
|
||||||
except (subprocess.SubprocessError, FileNotFoundError):
|
except (subprocess.SubprocessError, FileNotFoundError):
|
||||||
print_error("Supabase CLI is not installed.")
|
print_error("Supabase CLI is not installed.")
|
||||||
|
@ -592,19 +597,25 @@ def setup_supabase():
|
||||||
try:
|
try:
|
||||||
# Login to Supabase CLI (interactive)
|
# Login to Supabase CLI (interactive)
|
||||||
print_info("Logging into Supabase CLI...")
|
print_info("Logging into Supabase CLI...")
|
||||||
subprocess.run(['supabase', 'login'], check=True)
|
subprocess.run(['supabase', 'login'], check=True, shell=IS_WINDOWS)
|
||||||
|
|
||||||
# Link to project
|
# Link to project
|
||||||
print_info(f"Linking to Supabase project {project_ref}...")
|
print_info(f"Linking to Supabase project {project_ref}...")
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
['supabase', 'link', '--project-ref', project_ref],
|
['supabase', 'link', '--project-ref', project_ref],
|
||||||
cwd=backend_dir,
|
cwd=backend_dir,
|
||||||
check=True
|
check=True,
|
||||||
|
shell=IS_WINDOWS
|
||||||
)
|
)
|
||||||
|
|
||||||
# Push database migrations
|
# Push database migrations
|
||||||
print_info("Pushing database migrations...")
|
print_info("Pushing database migrations...")
|
||||||
subprocess.run(['supabase', 'db', 'push'], cwd=backend_dir, check=True)
|
subprocess.run(
|
||||||
|
['supabase', 'db', 'push'],
|
||||||
|
cwd=backend_dir,
|
||||||
|
check=True,
|
||||||
|
shell=IS_WINDOWS
|
||||||
|
)
|
||||||
|
|
||||||
print_success("Supabase database setup completed")
|
print_success("Supabase database setup completed")
|
||||||
|
|
||||||
|
@ -628,7 +639,8 @@ def install_dependencies():
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
['npm', 'install'],
|
['npm', 'install'],
|
||||||
cwd='frontend',
|
cwd='frontend',
|
||||||
check=True
|
check=True,
|
||||||
|
shell=IS_WINDOWS
|
||||||
)
|
)
|
||||||
print_success("Frontend dependencies installed successfully")
|
print_success("Frontend dependencies installed successfully")
|
||||||
|
|
||||||
|
@ -637,14 +649,16 @@ def install_dependencies():
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
['poetry', 'lock'],
|
['poetry', 'lock'],
|
||||||
cwd='backend',
|
cwd='backend',
|
||||||
check=True
|
check=True,
|
||||||
|
shell=IS_WINDOWS
|
||||||
)
|
)
|
||||||
# Install backend dependencies
|
# Install backend dependencies
|
||||||
print_info("Installing backend dependencies...")
|
print_info("Installing backend dependencies...")
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
['poetry', 'install'],
|
['poetry', 'install'],
|
||||||
cwd='backend',
|
cwd='backend',
|
||||||
check=True
|
check=True,
|
||||||
|
shell=IS_WINDOWS
|
||||||
)
|
)
|
||||||
print_success("Backend dependencies installed successfully")
|
print_success("Backend dependencies installed successfully")
|
||||||
|
|
||||||
|
@ -715,7 +729,7 @@ def start_suna():
|
||||||
# subprocess.run(['docker', 'compose', 'up', '-d'], check=True)
|
# subprocess.run(['docker', 'compose', 'up', '-d'], check=True)
|
||||||
|
|
||||||
print_info("Building images locally...")
|
print_info("Building images locally...")
|
||||||
subprocess.run(['docker', 'compose', 'up', '-d'], check=True)
|
subprocess.run(['docker', 'compose', 'up', '-d', '--build'], check=True, shell=IS_WINDOWS)
|
||||||
|
|
||||||
# Wait for services to be ready
|
# Wait for services to be ready
|
||||||
print_info("Waiting for services to start...")
|
print_info("Waiting for services to start...")
|
||||||
|
@ -723,11 +737,10 @@ def start_suna():
|
||||||
|
|
||||||
# Check if services are running
|
# Check if services are running
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
['docker', 'compose', 'ps'],
|
['docker', 'compose', 'ps', '-q'],
|
||||||
stdout=subprocess.PIPE,
|
capture_output=True,
|
||||||
stderr=subprocess.PIPE,
|
text=True,
|
||||||
check=True,
|
shell=IS_WINDOWS
|
||||||
text=True
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if "backend" in result.stdout and "frontend" in result.stdout:
|
if "backend" in result.stdout and "frontend" in result.stdout:
|
||||||
|
|
10
start.py
10
start.py
|
@ -2,12 +2,16 @@
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import platform
|
||||||
|
|
||||||
|
IS_WINDOWS = platform.system() == 'Windows'
|
||||||
|
|
||||||
def check_docker_compose_up():
|
def check_docker_compose_up():
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
["docker", "compose", "ps", "-q"],
|
["docker", "compose", "ps", "-q"],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True
|
text=True,
|
||||||
|
shell=IS_WINDOWS
|
||||||
)
|
)
|
||||||
return len(result.stdout.strip()) > 0
|
return len(result.stdout.strip()) > 0
|
||||||
|
|
||||||
|
@ -47,9 +51,9 @@ def main():
|
||||||
return
|
return
|
||||||
|
|
||||||
if action == "stop":
|
if action == "stop":
|
||||||
subprocess.run(["docker", "compose", "down"])
|
subprocess.run(["docker", "compose", "down"], shell=IS_WINDOWS)
|
||||||
else:
|
else:
|
||||||
subprocess.run(["docker", "compose", "up", "-d"])
|
subprocess.run(["docker", "compose", "up", "-d"], shell=IS_WINDOWS)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in New Issue