xenfra 0.3.8__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xenfra/commands/deployments.py +28 -5
- {xenfra-0.3.8.dist-info → xenfra-0.4.0.dist-info}/METADATA +1 -1
- {xenfra-0.3.8.dist-info → xenfra-0.4.0.dist-info}/RECORD +5 -5
- {xenfra-0.3.8.dist-info → xenfra-0.4.0.dist-info}/WHEEL +0 -0
- {xenfra-0.3.8.dist-info → xenfra-0.4.0.dist-info}/entry_points.txt +0 -0
xenfra/commands/deployments.py
CHANGED
|
@@ -65,7 +65,7 @@ def show_patch_preview(patch_data: dict):
|
|
|
65
65
|
console.print()
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
def _stream_deployment(client: XenfraClient, project_name: str, git_repo: str, branch: str, framework: str, region: str, size: str):
|
|
68
|
+
def _stream_deployment(client: XenfraClient, project_name: str, git_repo: str, branch: str, framework: str, region: str, size: str, is_dockerized: bool = True):
|
|
69
69
|
"""
|
|
70
70
|
Creates deployment with real-time SSE streaming (no polling needed).
|
|
71
71
|
|
|
@@ -90,6 +90,7 @@ def _stream_deployment(client: XenfraClient, project_name: str, git_repo: str, b
|
|
|
90
90
|
framework=framework,
|
|
91
91
|
region=region,
|
|
92
92
|
size_slug=size,
|
|
93
|
+
is_dockerized=is_dockerized,
|
|
93
94
|
):
|
|
94
95
|
event_type = event.get("event", "message")
|
|
95
96
|
data = event.get("data", "")
|
|
@@ -355,6 +356,7 @@ def deploy(project_name, git_repo, branch, framework, region, size, no_heal):
|
|
|
355
356
|
# Resolve values with precedence: 1. CLI Flag, 2. xenfra.yaml, 3. Default
|
|
356
357
|
project_name = project_name or config.get("name") or os.path.basename(os.getcwd())
|
|
357
358
|
framework = framework or config.get("framework")
|
|
359
|
+
is_dockerized = config.get("is_dockerized", True)
|
|
358
360
|
region = region or config.get("region") or "nyc3"
|
|
359
361
|
|
|
360
362
|
# Resolve size slug (complex mapping)
|
|
@@ -429,10 +431,30 @@ def deploy(project_name, git_repo, branch, framework, region, size, no_heal):
|
|
|
429
431
|
else:
|
|
430
432
|
console.print("[cyan]Creating deployment...[/cyan]")
|
|
431
433
|
|
|
432
|
-
# Detect framework if not provided
|
|
434
|
+
# Detect framework if not provided (AI-powered Zen Mode)
|
|
433
435
|
if not framework:
|
|
434
|
-
console.print("[
|
|
435
|
-
|
|
436
|
+
console.print("[cyan]🔍 AI Auto-detecting project type...[/cyan]")
|
|
437
|
+
try:
|
|
438
|
+
from ..utils.codebase import scan_codebase
|
|
439
|
+
code_snippets = scan_codebase()
|
|
440
|
+
if code_snippets:
|
|
441
|
+
analysis = client.intelligence.analyze_codebase(code_snippets)
|
|
442
|
+
framework = analysis.framework
|
|
443
|
+
is_dockerized = analysis.is_dockerized
|
|
444
|
+
# Override port and size if AI has strong recommendations
|
|
445
|
+
if not size and analysis.instance_size:
|
|
446
|
+
size = "s-1vcpu-1gb" if analysis.instance_size == "basic" else "s-2vcpu-4gb"
|
|
447
|
+
|
|
448
|
+
mode_str = "Docker" if is_dockerized else "Bare Metal"
|
|
449
|
+
console.print(f"[green]✓ Detected {framework.upper()} project ({mode_str} Mode)[/green] (Port: {analysis.port})")
|
|
450
|
+
else:
|
|
451
|
+
console.print("[yellow]⚠ No code files found for AI analysis. Defaulting to 'fastapi'[/yellow]")
|
|
452
|
+
framework = "fastapi"
|
|
453
|
+
is_dockerized = True
|
|
454
|
+
except Exception as e:
|
|
455
|
+
console.print(f"[yellow]⚠ AI detection failed: {e}. Defaulting to 'fastapi'[/yellow]")
|
|
456
|
+
framework = "fastapi"
|
|
457
|
+
is_dockerized = True
|
|
436
458
|
|
|
437
459
|
# Create deployment with real-time streaming
|
|
438
460
|
try:
|
|
@@ -443,7 +465,8 @@ def deploy(project_name, git_repo, branch, framework, region, size, no_heal):
|
|
|
443
465
|
branch=branch,
|
|
444
466
|
framework=framework,
|
|
445
467
|
region=region,
|
|
446
|
-
|
|
468
|
+
size_slug=size,
|
|
469
|
+
is_dockerized=is_dockerized,
|
|
447
470
|
)
|
|
448
471
|
|
|
449
472
|
if status_result == "FAILED" and not no_heal:
|
|
@@ -2,7 +2,7 @@ xenfra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
xenfra/commands/__init__.py,sha256=kTTwVnTvoxikyPUhQiyTAbnw4PYafktuE1----TqQoA,43
|
|
3
3
|
xenfra/commands/auth.py,sha256=ecReVCGl7Ys2d77mv_e4mCbs4ug6FLIb3S9dl2FUhr4,4178
|
|
4
4
|
xenfra/commands/auth_device.py,sha256=caD2UdveEZtAFjgjmnA-l5bjbbPONFjXJXgeJN7mhbk,6710
|
|
5
|
-
xenfra/commands/deployments.py,sha256=
|
|
5
|
+
xenfra/commands/deployments.py,sha256=XWvVMKzjSwVnqA2CHKJnHd3OlpJPV7yn6zJ-ajM67Dk,39480
|
|
6
6
|
xenfra/commands/intelligence.py,sha256=_H0t9OJwPbd9E0r1tcMACrt6-UBPrrTII8M47kC_iHA,17496
|
|
7
7
|
xenfra/commands/projects.py,sha256=SAxF_pOr95K6uz35U-zENptKndKxJNZn6bcD45PHcpI,6696
|
|
8
8
|
xenfra/commands/security_cmd.py,sha256=EI5sjX2lcMxgMH-LCFmPVkc9YqadOrcoSgTiKknkVRY,7327
|
|
@@ -14,7 +14,7 @@ xenfra/utils/config.py,sha256=K2k7hxz94dzbxvCw_PDXtq4o1VlmJMTFktlL-F2g5rY,14786
|
|
|
14
14
|
xenfra/utils/errors.py,sha256=6G91YzzDDNkKHANTgfAMiOiMElEyi57wo6-FzRa4VuQ,4211
|
|
15
15
|
xenfra/utils/security.py,sha256=EA8CIPLt8Y-QP5uZ7c5NuC6ZLRV1aZS8NapS9ix_vok,11479
|
|
16
16
|
xenfra/utils/validation.py,sha256=cvuL_AEFJ2oCoP0abCqoOIABOwz79Gkf-jh_dcFIQlM,6912
|
|
17
|
-
xenfra-0.
|
|
18
|
-
xenfra-0.
|
|
19
|
-
xenfra-0.
|
|
20
|
-
xenfra-0.
|
|
17
|
+
xenfra-0.4.0.dist-info/WHEEL,sha256=KSLUh82mDPEPk0Bx0ScXlWL64bc8KmzIPNcpQZFV-6E,79
|
|
18
|
+
xenfra-0.4.0.dist-info/entry_points.txt,sha256=a_2cGhYK__X6eW05Ba8uB6RIM_61c2sHtXsPY8N0mic,45
|
|
19
|
+
xenfra-0.4.0.dist-info/METADATA,sha256=ZAtPUg5OZxLVoXGmffkNN8dvSl3yNUiubD563wW8zTo,3898
|
|
20
|
+
xenfra-0.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|