Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 0 additions & 62 deletions src/runpod_flash/cli/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
import typer
from rich.console import Console

try:
import tomllib # Python 3.11+
except ImportError:
import tomli as tomllib # Python 3.10

from runpod_flash.cli.utils.formatting import print_error, print_warning
from runpod_flash.core.resources.constants import MAX_TARBALL_SIZE_MB

Expand Down Expand Up @@ -167,52 +162,6 @@ def _bundle_runpod_flash(build_dir: Path, flash_pkg: Path) -> None:
logger.debug("bundled runpod_flash from %s", flash_pkg)


def _extract_runpod_flash_dependencies(flash_pkg_dir: Path) -> list[str]:
"""Extract runtime dependencies from runpod_flash's pyproject.toml.

When bundling local runpod_flash source, we need to also install its dependencies
so they're available in the build environment.

Args:
flash_pkg_dir: Path to runpod_flash package directory (src/runpod_flash)

Returns:
List of dependency strings, empty list if parsing fails
"""
try:
# Navigate from runpod_flash package to project root
# flash_pkg_dir is src/runpod_flash, need to go up 2 levels to reach project root
project_root = flash_pkg_dir.parent.parent
pyproject_path = project_root / "pyproject.toml"

if not pyproject_path.exists():
console.print(
"[yellow]⚠ runpod_flash pyproject.toml not found, "
"dependencies may be missing[/yellow]"
)
return []

# Parse TOML
with open(pyproject_path, "rb") as f:
data = tomllib.load(f)

# Extract dependencies from [project.dependencies]
dependencies = data.get("project", {}).get("dependencies", [])

if dependencies:
console.print(
f"[dim]Found {len(dependencies)} runpod_flash dependencies to install[/dim]"
)

return dependencies

except Exception as e:
console.print(
f"[yellow]⚠ Failed to parse runpod_flash dependencies: {e}[/yellow]"
)
return []


def _normalize_package_name(name: str) -> str:
"""Normalize a package name for comparison (PEP 503: lowercase, hyphens to underscores)."""
return name.lower().replace("-", "_")
Expand Down Expand Up @@ -1085,17 +1034,6 @@ def _is_excluded_top_dir(top_dir: str) -> bool:
tar.add(str(item), arcname=arcname)


def cleanup_build_directory(build_base: Path) -> None:
"""
Remove build directory.

Args:
build_base: .build directory to remove
"""
if build_base.exists():
shutil.rmtree(build_base)


def _display_build_summary(
archive_path: Path,
app_name: str,
Expand Down
43 changes: 0 additions & 43 deletions src/runpod_flash/cli/commands/build_utils/manifest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"""Builder for flash_manifest.json."""

import importlib.util
import json
import logging
import sys
from dataclasses import dataclass
from datetime import datetime, timezone
from pathlib import Path
from typing import Any, Dict, List, Optional
Expand Down Expand Up @@ -43,41 +41,6 @@ def _serialize_network_volume(nv) -> dict:
return nv_config


@dataclass
class ManifestFunction:
"""Function entry in manifest."""

name: str
module: str
is_async: bool
is_class: bool
http_method: Optional[str] = None # HTTP method for LB endpoints (GET, POST, etc.)
http_path: Optional[str] = None # HTTP path for LB endpoints (/api/process)
is_load_balanced: bool = False # Determined by isinstance() at scan time
is_live_resource: bool = False # LiveLoadBalancer vs LoadBalancerSlsResource
config_variable: Optional[str] = None # Variable name like "gpu_config"


@dataclass
class ManifestResource:
"""Resource config entry in manifest."""

resource_type: str
functions: List[ManifestFunction]
is_load_balanced: bool = False # Determined by isinstance() at scan time
is_live_resource: bool = False # LiveLoadBalancer vs LoadBalancerSlsResource
config_variable: Optional[str] = None # Variable name for config discovery
is_load_balanced_endpoint: bool = False # Flag for load-balanced endpoint
is_explicit: bool = False # Flag indicating explicit load balancer configuration
main_file: Optional[str] = None # Filename of main entry point
app_variable: Optional[str] = None # Variable name of FastAPI app
imageName: Optional[str] = None # Docker image name for auto-provisioning
templateId: Optional[str] = None # RunPod template ID for auto-provisioning
gpuIds: Optional[list] = None # GPU types/IDs for auto-provisioning
workersMin: Optional[int] = None # Min worker count for auto-provisioning
workersMax: Optional[int] = None # Max worker count for auto-provisioning


class ManifestBuilder:
"""Builds flash_manifest.json from discovered remote functions."""

Expand Down Expand Up @@ -571,9 +534,3 @@ def build(self) -> Dict[str, Any]:
manifest["routes"] = routes_dict

return manifest

def write_to_file(self, output_path: Path) -> Path:
"""Write manifest to file."""
manifest = self.build()
output_path.write_text(json.dumps(manifest, indent=2))
return output_path
94 changes: 0 additions & 94 deletions src/runpod_flash/cli/commands/resource.py

This file was deleted.

1 change: 0 additions & 1 deletion src/runpod_flash/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def get_version() -> str:
app.command("login")(login.login_command)
app.command("deploy")(deploy.deploy_command)
app.command("update")(update.update_command)
# app.command("report")(resource.report_command)


# command: flash env <subcommand>
Expand Down
127 changes: 0 additions & 127 deletions src/runpod_flash/cli/utils/conda.py

This file was deleted.

Loading
Loading