-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick_cloud_setup.py
More file actions
123 lines (106 loc) · 3.94 KB
/
Copy pathquick_cloud_setup.py
File metadata and controls
123 lines (106 loc) · 3.94 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/env python3
"""
🌊 OCEAN Chess - Quick Cloud Setup
==================================
This script helps you set up all cloud services quickly.
"""
import os
import webbrowser
from pathlib import Path
def open_url(url):
"""Open URL in default browser."""
try:
webbrowser.open(url)
return True
except:
return False
def main():
"""Main setup function."""
print("🌊 OCEAN Chess - Quick Cloud Setup")
print("=" * 50)
# Create .env file if it doesn't exist
env_file = Path(".env")
if not env_file.exists():
print("📝 Creating .env file...")
env_content = """# OCEAN Chess Cloud Configuration
# Replace these with your actual credentials
# Neon PostgreSQL Database
NEON_DATABASE_URL=postgresql://username:password@ep-xxx.us-east-1.aws.neon.tech/ocean_chess?sslmode=require
# Redis Cache (Upstash)
REDIS_URL=redis://default:password@hostname:port
# AWS S3 Configuration
AWS_ACCESS_KEY_ID=AKIA...
AWS_SECRET_ACCESS_KEY=...
S3_BUCKET=ocean-chess-models-[your-name]
# Environment
ENVIRONMENT=development
LOG_LEVEL=INFO
"""
with open(env_file, 'w') as f:
f.write(env_content)
print("✅ Created .env file")
else:
print("✅ .env file already exists")
print("\n🚀 Let's set up your cloud services!")
print("I'll open the setup pages for you.\n")
# Service setup
services = [
{
"name": "Neon PostgreSQL Database",
"url": "https://neon.tech",
"description": "Serverless PostgreSQL database for persistent learning",
"free_tier": "0.5GB storage, 10GB transfer"
},
{
"name": "AWS S3 Storage",
"url": "https://aws.amazon.com/s3",
"description": "Model storage and backups",
"free_tier": "5GB storage, 20,000 requests"
},
{
"name": "Upstash Redis Cache",
"url": "https://upstash.com",
"description": "Serverless Redis for caching and sessions",
"free_tier": "10,000 requests/day"
},
{
"name": "Vercel Deployment",
"url": "https://vercel.com",
"description": "Serverless functions and hosting",
"free_tier": "100GB bandwidth, 1000 function invocations"
},
{
"name": "Cloudflare CDN",
"url": "https://cloudflare.com",
"description": "Global CDN and security (optional)",
"free_tier": "Unlimited bandwidth"
}
]
for i, service in enumerate(services, 1):
print(f"{i}. {service['name']}")
print(f" {service['description']}")
print(f" Free tier: {service['free_tier']}")
response = input(f" Open {service['name']} setup page? (y/n): ").lower()
if response in ['y', 'yes']:
if open_url(service['url']):
print(f" ✅ Opened {service['url']}")
else:
print(f" ❌ Could not open browser. Please visit: {service['url']}")
print()
print("📋 Setup Checklist:")
print("=" * 30)
print("□ Neon: Create project 'ocean-chess', copy connection string")
print("□ AWS: Create S3 bucket, create IAM user with S3 access")
print("□ Upstash: Create Redis database, copy connection URL")
print("□ Vercel: Import GitHub repo, add environment variables")
print("□ Cloudflare: Add domain, configure DNS (optional)")
print()
print("🔧 After setting up services:")
print("1. Update .env file with your credentials")
print("2. Run: python -c \"from ocean_cloud_database import initialize_cloud_database; import asyncio; asyncio.run(initialize_cloud_database())\"")
print("3. Deploy: vercel --prod")
print()
print("📚 For detailed instructions, see: CLOUD_SETUP_GUIDE.md")
print("🎉 Happy coding! Your AI chess opponent awaits!")
if __name__ == "__main__":
main()