File size: 1,647 Bytes
a7b73d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""
Simple test app for Hugging Face Spaces - will be replaced by full app
"""
import gradio as gr
import subprocess
import os
import time

def get_status():
    """Check if services are running"""
    try:
        # Check if nginx is running
        nginx_status = "βœ… Nginx is configured" if os.path.exists('/etc/nginx/sites-enabled/default') else "❌ Nginx not configured"
        
        # Check if backend directory exists
        backend_status = "βœ… Backend code present" if os.path.exists('/app/backend/app/main.py') else "❌ Backend code missing"
        
        # Check if frontend was built
        frontend_status = "βœ… Frontend built" if os.path.exists('/usr/share/nginx/html/index.html') else "❌ Frontend not built"
        
        return f"""
        # FastVLM Screen Observer Status
        
        {nginx_status}
        {backend_status}
        {frontend_status}
        
        The full application is being deployed. Please check back in a few moments.
        
        Visit: http://localhost:7860 once services are running.
        """
    except Exception as e:
        return f"Error checking status: {str(e)}"

# Create simple Gradio interface for testing
demo = gr.Interface(
    fn=get_status,
    inputs=None,
    outputs="markdown",
    title="FastVLM Screen Observer - Deployment Status",
    description="Checking deployment status..."
)

if __name__ == "__main__":
    # Try to start supervisor in background
    try:
        subprocess.Popen(["/app/start.sh"])
        time.sleep(2)
    except:
        pass
    
    # Launch Gradio on port 7860
    demo.launch(server_name="0.0.0.0", server_port=7860)