lightning-sdk 0.2.13__py3-none-any.whl → 0.2.15__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.
- lightning_sdk/__init__.py +1 -1
- lightning_sdk/api/base_studio_api.py +73 -0
- lightning_sdk/api/license_api.py +48 -0
- lightning_sdk/api/llm_api.py +61 -8
- lightning_sdk/api/studio_api.py +47 -1
- lightning_sdk/base_studio.py +70 -0
- lightning_sdk/cli/delete.py +6 -8
- lightning_sdk/cli/download.py +25 -0
- lightning_sdk/cli/serve.py +82 -30
- lightning_sdk/cli/teamspace_menu.py +9 -1
- lightning_sdk/cli/upload.py +0 -1
- lightning_sdk/lightning_cloud/openapi/__init__.py +11 -0
- lightning_sdk/lightning_cloud/openapi/api/__init__.py +1 -0
- lightning_sdk/lightning_cloud/openapi/api/billing_service_api.py +9 -1
- lightning_sdk/lightning_cloud/openapi/api/cloud_space_service_api.py +121 -0
- lightning_sdk/lightning_cloud/openapi/api/file_system_service_api.py +178 -0
- lightning_sdk/lightning_cloud/openapi/api/jobs_service_api.py +243 -2
- lightning_sdk/lightning_cloud/openapi/api/product_license_service_api.py +525 -0
- lightning_sdk/lightning_cloud/openapi/configuration.py +1 -1
- lightning_sdk/lightning_cloud/openapi/models/__init__.py +10 -0
- lightning_sdk/lightning_cloud/openapi/models/assistant_id_conversations_body.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/endpoints_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/model_id_versions_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/orgs_id_body.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/pipelines_id_body.py +6 -6
- lightning_sdk/lightning_cloud/openapi/models/project_id_storage_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/projects_id_body.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/storage_complete_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/update.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/uploads_upload_id_body1.py +55 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_aws_direct_v1.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_provider.py +3 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_environment_config.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_environment_template_config.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_environment_type.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cloudflare_v1.py +66 -66
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_spec.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_upload.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_complete_upload.py +55 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_conversation.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_create_cloud_space_environment_template_request.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_api.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_state.py +4 -4
- lightning_sdk/lightning_cloud/openapi/models/v1_endpoint.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_external_search_user.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_ge_list_deployment_routing_telemetry_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_job_stats_response.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_get_project_balance_response.py +1 -27
- lightning_sdk/lightning_cloud/openapi/models/v1_get_user_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_job_type.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_product_licenses_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_managed_model.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_membership.py +17 -17
- lightning_sdk/lightning_cloud/openapi/models/v1_modify_filesystem_volume_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_organization.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_pipeline.py +6 -6
- lightning_sdk/lightning_cloud/openapi/models/v1_pipeline_state.py +111 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_presigned_url.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_product_license.py +409 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_product_license_check_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_project_membership.py +17 -17
- lightning_sdk/lightning_cloud/openapi/models/v1_project_settings.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_r2_data_connection.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_secret_type.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_server_alert_type.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_trigger_filesystem_upgrade_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_user_request.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_upload_project_artifact_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_usage_report.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +295 -113
- lightning_sdk/lightning_cloud/rest_client.py +4 -0
- lightning_sdk/llm/llm.py +120 -30
- lightning_sdk/services/__init__.py +1 -1
- lightning_sdk/services/license.py +236 -0
- lightning_sdk/studio.py +30 -0
- {lightning_sdk-0.2.13.dist-info → lightning_sdk-0.2.15.dist-info}/METADATA +1 -1
- {lightning_sdk-0.2.13.dist-info → lightning_sdk-0.2.15.dist-info}/RECORD +83 -68
- /lightning_sdk/services/{finetune/__init__.py → finetune_llm.py} +0 -0
- {lightning_sdk-0.2.13.dist-info → lightning_sdk-0.2.15.dist-info}/LICENSE +0 -0
- {lightning_sdk-0.2.13.dist-info → lightning_sdk-0.2.15.dist-info}/WHEEL +0 -0
- {lightning_sdk-0.2.13.dist-info → lightning_sdk-0.2.15.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-0.2.13.dist-info → lightning_sdk-0.2.15.dist-info}/top_level.txt +0 -0
lightning_sdk/cli/serve.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import concurrent.futures
|
|
2
2
|
import os
|
|
3
|
+
import re
|
|
3
4
|
import socket
|
|
4
5
|
import subprocess
|
|
5
6
|
import time
|
|
@@ -8,13 +9,14 @@ from datetime import datetime
|
|
|
8
9
|
from enum import Enum
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
from threading import Thread
|
|
11
|
-
from typing import Dict, List, Optional, TypedDict, Union
|
|
12
|
+
from typing import Any, Dict, List, Optional, TypedDict, Union
|
|
12
13
|
from urllib.parse import urlencode
|
|
13
14
|
|
|
14
15
|
import click
|
|
15
16
|
from rich.console import Console
|
|
16
17
|
from rich.progress import Progress, SpinnerColumn, TextColumn, TimeElapsedColumn
|
|
17
18
|
from rich.prompt import Confirm
|
|
19
|
+
from rich.syntax import Syntax
|
|
18
20
|
|
|
19
21
|
from lightning_sdk import Machine, Teamspace
|
|
20
22
|
from lightning_sdk.api import UserApi
|
|
@@ -53,12 +55,12 @@ def deploy() -> None:
|
|
|
53
55
|
"""Deploy a LitServe model.
|
|
54
56
|
|
|
55
57
|
Example:
|
|
56
|
-
lightning deploy server.py
|
|
58
|
+
lightning deploy server.py --cloud # deploy to the cloud
|
|
57
59
|
|
|
58
60
|
Example:
|
|
59
|
-
lightning deploy server.py
|
|
61
|
+
lightning deploy server.py # run locally
|
|
60
62
|
|
|
61
|
-
You can deploy the API to the cloud by running `lightning deploy server.py`.
|
|
63
|
+
You can deploy the API to the cloud by running `lightning deploy server.py --cloud`.
|
|
62
64
|
This will build a docker container for the server.py script and deploy it to the Lightning AI platform.
|
|
63
65
|
"""
|
|
64
66
|
|
|
@@ -73,11 +75,11 @@ def deploy() -> None:
|
|
|
73
75
|
help="Generate a client for the model",
|
|
74
76
|
)
|
|
75
77
|
@click.option(
|
|
76
|
-
"--
|
|
78
|
+
"--cloud",
|
|
77
79
|
is_flag=True,
|
|
78
80
|
default=False,
|
|
79
81
|
flag_value=True,
|
|
80
|
-
help="Run the model
|
|
82
|
+
help="Run the model on cloud",
|
|
81
83
|
)
|
|
82
84
|
@click.option("--name", default=None, help="Name of the deployed API (e.g., 'classification-api', 'Llama-api')")
|
|
83
85
|
@click.option(
|
|
@@ -133,7 +135,7 @@ def deploy() -> None:
|
|
|
133
135
|
@click.option("--port", default=8000, help="The port to expose the API on.")
|
|
134
136
|
@click.option("--min_replica", "--min-replica", default=0, help="Number of replicas to start with.")
|
|
135
137
|
@click.option("--max_replica", "--max-replica", default=1, help="Number of replicas to scale up to.")
|
|
136
|
-
@click.option("--replicas",
|
|
138
|
+
@click.option("--replicas", default=1, help="Deployment will start with this many replicas.")
|
|
137
139
|
@click.option(
|
|
138
140
|
"--no_credentials",
|
|
139
141
|
"--no-credentials",
|
|
@@ -145,7 +147,7 @@ def deploy() -> None:
|
|
|
145
147
|
def api(
|
|
146
148
|
script_path: str,
|
|
147
149
|
easy: bool,
|
|
148
|
-
|
|
150
|
+
cloud: bool,
|
|
149
151
|
name: Optional[str],
|
|
150
152
|
non_interactive: bool,
|
|
151
153
|
machine: Optional[str],
|
|
@@ -165,7 +167,7 @@ def api(
|
|
|
165
167
|
return api_impl(
|
|
166
168
|
script_path=script_path,
|
|
167
169
|
easy=easy,
|
|
168
|
-
|
|
170
|
+
cloud=cloud,
|
|
169
171
|
name=name,
|
|
170
172
|
non_interactive=non_interactive,
|
|
171
173
|
machine=machine,
|
|
@@ -186,7 +188,7 @@ def api(
|
|
|
186
188
|
def api_impl(
|
|
187
189
|
script_path: Union[str, Path],
|
|
188
190
|
easy: bool = False,
|
|
189
|
-
|
|
191
|
+
cloud: bool = False,
|
|
190
192
|
name: Optional[str] = None,
|
|
191
193
|
tag: Optional[str] = None,
|
|
192
194
|
non_interactive: bool = False,
|
|
@@ -217,7 +219,7 @@ def api_impl(
|
|
|
217
219
|
timestr = datetime.now().strftime("%b-%d-%H_%M")
|
|
218
220
|
name = f"litserve-{timestr}".lower()
|
|
219
221
|
|
|
220
|
-
if
|
|
222
|
+
if not cloud:
|
|
221
223
|
try:
|
|
222
224
|
subprocess.run(
|
|
223
225
|
["python", str(script_path)],
|
|
@@ -253,16 +255,26 @@ def api_impl(
|
|
|
253
255
|
)
|
|
254
256
|
|
|
255
257
|
|
|
258
|
+
class _AuthMode(Enum):
|
|
259
|
+
DEVBOX = "dev"
|
|
260
|
+
DEPLOY = "deploy"
|
|
261
|
+
|
|
262
|
+
|
|
256
263
|
class _AuthServer(AuthServer):
|
|
264
|
+
def __init__(self, mode: _AuthMode, *args: Any, **kwargs: Any) -> None:
|
|
265
|
+
self._mode = mode
|
|
266
|
+
super().__init__(*args, **kwargs)
|
|
267
|
+
|
|
257
268
|
def get_auth_url(self, port: int) -> str:
|
|
258
269
|
redirect_uri = f"http://localhost:{port}/login-complete"
|
|
259
|
-
params = urlencode({"redirectTo": redirect_uri, "okbhrt": LITSERVE_CODE})
|
|
270
|
+
params = urlencode({"redirectTo": redirect_uri, "mode": self._mode.value, "okbhrt": LITSERVE_CODE})
|
|
260
271
|
return f"{env.LIGHTNING_CLOUD_URL}/sign-in?{params}"
|
|
261
272
|
|
|
262
273
|
|
|
263
274
|
class _Auth(Auth):
|
|
264
|
-
def __init__(self, shall_confirm: bool = False) -> None:
|
|
275
|
+
def __init__(self, mode: _AuthMode, shall_confirm: bool = False) -> None:
|
|
265
276
|
super().__init__()
|
|
277
|
+
self._mode = mode
|
|
266
278
|
self._shall_confirm = shall_confirm
|
|
267
279
|
|
|
268
280
|
def _run_server(self) -> None:
|
|
@@ -278,11 +290,11 @@ class _Auth(Auth):
|
|
|
278
290
|
print("Opening browser for authentication...")
|
|
279
291
|
print("Please come back to the terminal after logging in.")
|
|
280
292
|
time.sleep(3)
|
|
281
|
-
_AuthServer().login_with_browser(self)
|
|
293
|
+
_AuthServer(self._mode).login_with_browser(self)
|
|
282
294
|
|
|
283
295
|
|
|
284
|
-
def authenticate(shall_confirm: bool = True) -> None:
|
|
285
|
-
auth = _Auth(shall_confirm)
|
|
296
|
+
def authenticate(mode: _AuthMode, shall_confirm: bool = True) -> None:
|
|
297
|
+
auth = _Auth(mode, shall_confirm)
|
|
286
298
|
auth.authenticate()
|
|
287
299
|
|
|
288
300
|
|
|
@@ -485,12 +497,23 @@ class _LitServeDevbox:
|
|
|
485
497
|
progress.update(upload_task, advance=1)
|
|
486
498
|
|
|
487
499
|
|
|
500
|
+
def _detect_port(script_path: Path) -> int:
|
|
501
|
+
with open(script_path) as f:
|
|
502
|
+
content = f.read()
|
|
503
|
+
|
|
504
|
+
# Try to match server.run first and then any variable name and then default port=8000
|
|
505
|
+
match = re.search(r"server\.run\s*\([^)]*port\s*=\s*(\d+)", content) or re.search(
|
|
506
|
+
r"\w+\.run\s*\([^)]*port\s*=\s*(\d+)", content
|
|
507
|
+
)
|
|
508
|
+
return int(match.group(1)) if match else 8000
|
|
509
|
+
|
|
510
|
+
|
|
488
511
|
def _handle_devbox(
|
|
489
512
|
name: str,
|
|
490
513
|
script_path: Path,
|
|
491
514
|
console: Console,
|
|
492
515
|
non_interactive: bool = False,
|
|
493
|
-
devbox: Machine =
|
|
516
|
+
devbox: Union[Machine, str] = Machine.CPU,
|
|
494
517
|
interruptible: bool = False,
|
|
495
518
|
teamspace: Optional[str] = None,
|
|
496
519
|
org: Optional[str] = None,
|
|
@@ -500,46 +523,75 @@ def _handle_devbox(
|
|
|
500
523
|
console.print("❌ Error: Only Python files (.py) are supported for development servers", style="red")
|
|
501
524
|
return
|
|
502
525
|
|
|
503
|
-
|
|
526
|
+
authenticate(_AuthMode.DEVBOX, shall_confirm=not non_interactive)
|
|
527
|
+
user_status = poll_verified_status()
|
|
528
|
+
if not user_status["verified"]:
|
|
529
|
+
console.print("❌ Verify phone number to continue. Visit lightning.ai.", style="red")
|
|
530
|
+
return
|
|
531
|
+
if not user_status["onboarded"]:
|
|
532
|
+
console.print("onboarding user")
|
|
533
|
+
onboarding = _Onboarding(console)
|
|
534
|
+
resolved_teamspace = onboarding.select_teamspace(teamspace, org, user)
|
|
535
|
+
else:
|
|
536
|
+
resolved_teamspace = select_teamspace(teamspace, org, user)
|
|
504
537
|
studio = Studio(name=name, teamspace=resolved_teamspace)
|
|
538
|
+
studio.install_plugin("custom-port")
|
|
505
539
|
lit_devbox = _LitServeDevbox()
|
|
506
540
|
|
|
507
541
|
studio_url = _get_studio_url(studio, turn_on=True)
|
|
508
542
|
pathlib_path = Path(script_path).resolve()
|
|
509
|
-
|
|
543
|
+
browser_opened = False
|
|
510
544
|
studio_path = f"{studio.owner.name}/{studio.teamspace.name}/{studio.name}"
|
|
511
545
|
|
|
512
546
|
console.print("\n=== Lightning Studio Setup ===")
|
|
513
547
|
console.print(f"🔧 [bold]Setting up Studio:[/bold] {studio_path}")
|
|
514
548
|
console.print(f"📁 [bold]Local project:[/bold] {pathlib_path.parent}")
|
|
515
549
|
|
|
516
|
-
upload_state = lit_devbox.resolve_previous_upload(studio, pathlib_path.parent)
|
|
550
|
+
upload_state = lit_devbox.resolve_previous_upload(studio, str(pathlib_path.parent))
|
|
517
551
|
if non_interactive:
|
|
518
552
|
console.print(f"🌐 [bold]Opening Studio:[/bold] [link={studio_url}]{studio_url}[/link]")
|
|
519
|
-
|
|
553
|
+
browser_opened = webbrowser.open(studio_url)
|
|
520
554
|
else:
|
|
521
555
|
if Confirm.ask("Would you like to open your Studio in the browser?", default=True):
|
|
522
556
|
console.print(f"🌐 [bold]Opening Studio:[/bold] [link={studio_url}]{studio_url}[/link]")
|
|
523
|
-
|
|
557
|
+
browser_opened = webbrowser.open(studio_url)
|
|
524
558
|
|
|
525
|
-
if not
|
|
559
|
+
if not browser_opened:
|
|
526
560
|
console.print(f"🔗 [bold]Access Studio:[/bold] [link={studio_url}]{studio_url}[/link]")
|
|
527
561
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
studio.
|
|
531
|
-
|
|
532
|
-
studio.run_plugin("custom-port", port=8000) # TODO: Remove hardcoded port and fetch from LitServe
|
|
562
|
+
# Start the Studio in the background and return immediately using threading
|
|
563
|
+
console.print("\n⚡ Initializing Studio in the background...")
|
|
564
|
+
studio_thread = Thread(target=studio.start, args=(devbox, interruptible))
|
|
565
|
+
studio_thread.start()
|
|
533
566
|
|
|
534
567
|
console.print("📤 Syncing project files to Studio...")
|
|
535
568
|
lit_devbox.upload_folder(studio, pathlib_path.parent, upload_state)
|
|
536
569
|
|
|
570
|
+
# Wait for the Studio to start
|
|
571
|
+
console.print("⚡ Waiting for Studio to start...")
|
|
572
|
+
studio_thread.join()
|
|
573
|
+
|
|
574
|
+
try:
|
|
575
|
+
console.print("🚀 Starting server...")
|
|
576
|
+
studio.run_and_detach(f"python {script_path}", timeout=10)
|
|
577
|
+
except Exception as e:
|
|
578
|
+
console.print("❌ Error while starting server", style="red")
|
|
579
|
+
syntax = Syntax(f"{e}", "bash", theme="monokai")
|
|
580
|
+
console.print(syntax)
|
|
581
|
+
console.print(f"\n🔄 [bold]To fix:[/bold] Edit your code in Studio and run with: [u]python {script_path}[/u]")
|
|
582
|
+
return
|
|
583
|
+
|
|
584
|
+
port = _detect_port(pathlib_path)
|
|
585
|
+
console.print("🔌 Configuring server port...")
|
|
586
|
+
port_url = studio.run_plugin("custom-port", port=port)
|
|
587
|
+
|
|
537
588
|
# Add completion message with next steps
|
|
538
589
|
console.print("\n✅ Studio ready!")
|
|
539
590
|
console.print("\n📋 [bold]Next steps:[/bold]")
|
|
540
591
|
console.print(" [bold]1.[/bold] Server code will be available in the Studio")
|
|
541
592
|
console.print(" [bold]2.[/bold] The Studio is now running with the specified configuration")
|
|
542
593
|
console.print(" [bold]3.[/bold] Modify and run your server directly in the Studio")
|
|
594
|
+
console.print(f" [bold]4.[/bold] Your server will be accessible on [link={port_url}]{port_url}[/link]")
|
|
543
595
|
# TODO: Once server running is implemented
|
|
544
596
|
|
|
545
597
|
|
|
@@ -563,7 +615,7 @@ def _handle_cloud(
|
|
|
563
615
|
) -> None:
|
|
564
616
|
if not is_connected():
|
|
565
617
|
console.print("❌ Internet connection required to deploy to the cloud.", style="red")
|
|
566
|
-
console.print("To run locally instead, use: `lightning serve [SCRIPT | server.py]
|
|
618
|
+
console.print("To run locally instead, use: `lightning serve [SCRIPT | server.py]`")
|
|
567
619
|
return
|
|
568
620
|
|
|
569
621
|
deployment_name = os.path.basename(repository)
|
|
@@ -605,7 +657,7 @@ def _handle_cloud(
|
|
|
605
657
|
# Push the container to the registry
|
|
606
658
|
console.print("\nPushing container to registry. It may take a while...", style="bold")
|
|
607
659
|
# Authenticate with LitServe affiliate
|
|
608
|
-
authenticate(shall_confirm=not non_interactive)
|
|
660
|
+
authenticate(_AuthMode.DEPLOY, shall_confirm=not non_interactive)
|
|
609
661
|
user_status = poll_verified_status()
|
|
610
662
|
cloudspace_id: Optional[str] = None
|
|
611
663
|
from_onboarding = False
|
|
@@ -22,7 +22,15 @@ class _TeamspacesMenu:
|
|
|
22
22
|
def _get_teamspace_from_name(
|
|
23
23
|
self, teamspace: str, possible_teamspaces: Dict[str, Dict[str, str]]
|
|
24
24
|
) -> Dict[str, str]:
|
|
25
|
-
|
|
25
|
+
try:
|
|
26
|
+
owner, name = teamspace.split("/", maxsplit=1)
|
|
27
|
+
except ValueError as e:
|
|
28
|
+
raise ValueError(
|
|
29
|
+
f"Invalid teamspace format: '{teamspace}'. "
|
|
30
|
+
"Teamspace should be specified as '{teamspace_owner}/{teamspace_name}' "
|
|
31
|
+
"(e.g., 'my-org/my-teamspace')."
|
|
32
|
+
) from e
|
|
33
|
+
|
|
26
34
|
for _, ts in possible_teamspaces.items():
|
|
27
35
|
if ts["name"] == name and (ts["user"] == owner or ts["org"] == owner):
|
|
28
36
|
return ts
|
lightning_sdk/cli/upload.py
CHANGED
|
@@ -125,7 +125,6 @@ def file(path: str, studio: Optional[str] = None, remote_path: Optional[str] = N
|
|
|
125
125
|
help="The name of the cloud account to store the Container in.",
|
|
126
126
|
)
|
|
127
127
|
@click.option(
|
|
128
|
-
"--platform",
|
|
129
128
|
"--platform",
|
|
130
129
|
default="linux/amd64",
|
|
131
130
|
help="This is the platform the container pulled and push to Lightning AI will run on.",
|
|
@@ -49,6 +49,7 @@ from lightning_sdk.lightning_cloud.openapi.api.models_store_api import ModelsSto
|
|
|
49
49
|
from lightning_sdk.lightning_cloud.openapi.api.organizations_service_api import OrganizationsServiceApi
|
|
50
50
|
from lightning_sdk.lightning_cloud.openapi.api.pipeline_templates_service_api import PipelineTemplatesServiceApi
|
|
51
51
|
from lightning_sdk.lightning_cloud.openapi.api.pipelines_service_api import PipelinesServiceApi
|
|
52
|
+
from lightning_sdk.lightning_cloud.openapi.api.product_license_service_api import ProductLicenseServiceApi
|
|
52
53
|
from lightning_sdk.lightning_cloud.openapi.api.profiler_service_api import ProfilerServiceApi
|
|
53
54
|
from lightning_sdk.lightning_cloud.openapi.api.projects_service_api import ProjectsServiceApi
|
|
54
55
|
from lightning_sdk.lightning_cloud.openapi.api.quest_service_api import QuestServiceApi
|
|
@@ -281,8 +282,10 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_code_version_st
|
|
|
281
282
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_cold_start_metrics import V1CloudSpaceColdStartMetrics
|
|
282
283
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_cold_start_metrics_stats import V1CloudSpaceColdStartMetricsStats
|
|
283
284
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_engagement_response import V1CloudSpaceEngagementResponse
|
|
285
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_environment_config import V1CloudSpaceEnvironmentConfig
|
|
284
286
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_environment_template import V1CloudSpaceEnvironmentTemplate
|
|
285
287
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_environment_template_config import V1CloudSpaceEnvironmentTemplateConfig
|
|
288
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_environment_type import V1CloudSpaceEnvironmentType
|
|
286
289
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_instance_collab_status import V1CloudSpaceInstanceCollabStatus
|
|
287
290
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_instance_config import V1CloudSpaceInstanceConfig
|
|
288
291
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cloud_space_instance_startup_status import V1CloudSpaceInstanceStartupStatus
|
|
@@ -310,6 +313,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_state import V1Clus
|
|
|
310
313
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_status import V1ClusterStatus
|
|
311
314
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_tagging_options import V1ClusterTaggingOptions
|
|
312
315
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_type import V1ClusterType
|
|
316
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_upload import V1ClusterUpload
|
|
313
317
|
from lightning_sdk.lightning_cloud.openapi.models.v1_cluster_usage_restriction import V1ClusterUsageRestriction
|
|
314
318
|
from lightning_sdk.lightning_cloud.openapi.models.v1_collab_action import V1CollabAction
|
|
315
319
|
from lightning_sdk.lightning_cloud.openapi.models.v1_collab_session import V1CollabSession
|
|
@@ -496,6 +500,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_gallery_app import V1Galler
|
|
|
496
500
|
from lightning_sdk.lightning_cloud.openapi.models.v1_gallery_component import V1GalleryComponent
|
|
497
501
|
from lightning_sdk.lightning_cloud.openapi.models.v1_gcp_data_connection import V1GcpDataConnection
|
|
498
502
|
from lightning_sdk.lightning_cloud.openapi.models.v1_gcp_data_connection_setup import V1GcpDataConnectionSetup
|
|
503
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_ge_list_deployment_routing_telemetry_response import V1GeListDeploymentRoutingTelemetryResponse
|
|
499
504
|
from lightning_sdk.lightning_cloud.openapi.models.v1_generate_ssh_key_pair_request import V1GenerateSSHKeyPairRequest
|
|
500
505
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_affiliate_link_response import V1GetAffiliateLinkResponse
|
|
501
506
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_agent_job_env_response import V1GetAgentJobEnvResponse
|
|
@@ -660,6 +665,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_list_org_roles_response imp
|
|
|
660
665
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_organization_cluster_encryption_keys_response import V1ListOrganizationClusterEncryptionKeysResponse
|
|
661
666
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_organizations_response import V1ListOrganizationsResponse
|
|
662
667
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_pipelines_response import V1ListPipelinesResponse
|
|
668
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_list_product_licenses_response import V1ListProductLicensesResponse
|
|
663
669
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_profiler_captures_response import V1ListProfilerCapturesResponse
|
|
664
670
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_project_artifacts_response import V1ListProjectArtifactsResponse
|
|
665
671
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_project_cluster_accelerators_response import V1ListProjectClusterAcceleratorsResponse
|
|
@@ -716,6 +722,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_metrics_tracker import V1Me
|
|
|
716
722
|
from lightning_sdk.lightning_cloud.openapi.models.v1_model import V1Model
|
|
717
723
|
from lightning_sdk.lightning_cloud.openapi.models.v1_model_file import V1ModelFile
|
|
718
724
|
from lightning_sdk.lightning_cloud.openapi.models.v1_model_version_archive import V1ModelVersionArchive
|
|
725
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_modify_filesystem_volume_response import V1ModifyFilesystemVolumeResponse
|
|
719
726
|
from lightning_sdk.lightning_cloud.openapi.models.v1_mount_target import V1MountTarget
|
|
720
727
|
from lightning_sdk.lightning_cloud.openapi.models.v1_multi_machine_job import V1MultiMachineJob
|
|
721
728
|
from lightning_sdk.lightning_cloud.openapi.models.v1_multi_machine_job_event import V1MultiMachineJobEvent
|
|
@@ -749,6 +756,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_pipeline_parameter import V
|
|
|
749
756
|
from lightning_sdk.lightning_cloud.openapi.models.v1_pipeline_parameter_placement import V1PipelineParameterPlacement
|
|
750
757
|
from lightning_sdk.lightning_cloud.openapi.models.v1_pipeline_parameter_placement_type import V1PipelineParameterPlacementType
|
|
751
758
|
from lightning_sdk.lightning_cloud.openapi.models.v1_pipeline_parameter_type import V1PipelineParameterType
|
|
759
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_pipeline_state import V1PipelineState
|
|
752
760
|
from lightning_sdk.lightning_cloud.openapi.models.v1_pipeline_step import V1PipelineStep
|
|
753
761
|
from lightning_sdk.lightning_cloud.openapi.models.v1_pipeline_step_status import V1PipelineStepStatus
|
|
754
762
|
from lightning_sdk.lightning_cloud.openapi.models.v1_pipeline_step_type import V1PipelineStepType
|
|
@@ -758,6 +766,8 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_plugin import V1Plugin
|
|
|
758
766
|
from lightning_sdk.lightning_cloud.openapi.models.v1_plugins_list_response import V1PluginsListResponse
|
|
759
767
|
from lightning_sdk.lightning_cloud.openapi.models.v1_post_cloud_space_artifact_events_response import V1PostCloudSpaceArtifactEventsResponse
|
|
760
768
|
from lightning_sdk.lightning_cloud.openapi.models.v1_presigned_url import V1PresignedUrl
|
|
769
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_product_license import V1ProductLicense
|
|
770
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_product_license_check_response import V1ProductLicenseCheckResponse
|
|
761
771
|
from lightning_sdk.lightning_cloud.openapi.models.v1_profiler_capture import V1ProfilerCapture
|
|
762
772
|
from lightning_sdk.lightning_cloud.openapi.models.v1_profiler_enabled_response import V1ProfilerEnabledResponse
|
|
763
773
|
from lightning_sdk.lightning_cloud.openapi.models.v1_project import V1Project
|
|
@@ -867,6 +877,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_transfer_org_balance_respon
|
|
|
867
877
|
from lightning_sdk.lightning_cloud.openapi.models.v1_transfer_project_balance_response import V1TransferProjectBalanceResponse
|
|
868
878
|
from lightning_sdk.lightning_cloud.openapi.models.v1_transfer_user_balance_request import V1TransferUserBalanceRequest
|
|
869
879
|
from lightning_sdk.lightning_cloud.openapi.models.v1_transfer_user_balance_response import V1TransferUserBalanceResponse
|
|
880
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_trigger_filesystem_upgrade_response import V1TriggerFilesystemUpgradeResponse
|
|
870
881
|
from lightning_sdk.lightning_cloud.openapi.models.v1_unpublish_cloud_space_response import V1UnpublishCloudSpaceResponse
|
|
871
882
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_agent_status_request import V1UpdateAgentStatusRequest
|
|
872
883
|
from lightning_sdk.lightning_cloud.openapi.models.v1_update_agent_status_response import V1UpdateAgentStatusResponse
|
|
@@ -30,6 +30,7 @@ from lightning_sdk.lightning_cloud.openapi.api.models_store_api import ModelsSto
|
|
|
30
30
|
from lightning_sdk.lightning_cloud.openapi.api.organizations_service_api import OrganizationsServiceApi
|
|
31
31
|
from lightning_sdk.lightning_cloud.openapi.api.pipeline_templates_service_api import PipelineTemplatesServiceApi
|
|
32
32
|
from lightning_sdk.lightning_cloud.openapi.api.pipelines_service_api import PipelinesServiceApi
|
|
33
|
+
from lightning_sdk.lightning_cloud.openapi.api.product_license_service_api import ProductLicenseServiceApi
|
|
33
34
|
from lightning_sdk.lightning_cloud.openapi.api.profiler_service_api import ProfilerServiceApi
|
|
34
35
|
from lightning_sdk.lightning_cloud.openapi.api.projects_service_api import ProjectsServiceApi
|
|
35
36
|
from lightning_sdk.lightning_cloud.openapi.api.quest_service_api import QuestServiceApi
|
|
@@ -942,6 +942,8 @@ class BillingServiceApi(object):
|
|
|
942
942
|
:param datetime to:
|
|
943
943
|
:param str user_id:
|
|
944
944
|
:param str time_zone:
|
|
945
|
+
:param int limit:
|
|
946
|
+
:param datetime search_after:
|
|
945
947
|
:return: V1UsageReport
|
|
946
948
|
If the method is called asynchronously,
|
|
947
949
|
returns the request thread.
|
|
@@ -971,12 +973,14 @@ class BillingServiceApi(object):
|
|
|
971
973
|
:param datetime to:
|
|
972
974
|
:param str user_id:
|
|
973
975
|
:param str time_zone:
|
|
976
|
+
:param int limit:
|
|
977
|
+
:param datetime search_after:
|
|
974
978
|
:return: V1UsageReport
|
|
975
979
|
If the method is called asynchronously,
|
|
976
980
|
returns the request thread.
|
|
977
981
|
"""
|
|
978
982
|
|
|
979
|
-
all_params = ['org_id', 'project_id', 'cluster_id', 'resource_type', 'resource_id', '_from', 'to', 'user_id', 'time_zone'] # noqa: E501
|
|
983
|
+
all_params = ['org_id', 'project_id', 'cluster_id', 'resource_type', 'resource_id', '_from', 'to', 'user_id', 'time_zone', 'limit', 'search_after'] # noqa: E501
|
|
980
984
|
all_params.append('async_req')
|
|
981
985
|
all_params.append('_return_http_data_only')
|
|
982
986
|
all_params.append('_preload_content')
|
|
@@ -1015,6 +1019,10 @@ class BillingServiceApi(object):
|
|
|
1015
1019
|
query_params.append(('userId', params['user_id'])) # noqa: E501
|
|
1016
1020
|
if 'time_zone' in params:
|
|
1017
1021
|
query_params.append(('timeZone', params['time_zone'])) # noqa: E501
|
|
1022
|
+
if 'limit' in params:
|
|
1023
|
+
query_params.append(('limit', params['limit'])) # noqa: E501
|
|
1024
|
+
if 'search_after' in params:
|
|
1025
|
+
query_params.append(('searchAfter', params['search_after'])) # noqa: E501
|
|
1018
1026
|
|
|
1019
1027
|
header_params = {}
|
|
1020
1028
|
|
|
@@ -6122,6 +6122,127 @@ class CloudSpaceServiceApi(object):
|
|
|
6122
6122
|
_request_timeout=params.get('_request_timeout'),
|
|
6123
6123
|
collection_formats=collection_formats)
|
|
6124
6124
|
|
|
6125
|
+
def cloud_space_service_list_cloud_spaces_bulk(self, **kwargs) -> 'V1ListCloudSpacesResponse': # noqa: E501
|
|
6126
|
+
"""cloud_space_service_list_cloud_spaces_bulk # noqa: E501
|
|
6127
|
+
|
|
6128
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
6129
|
+
asynchronous HTTP request, please pass async_req=True
|
|
6130
|
+
>>> thread = api.cloud_space_service_list_cloud_spaces_bulk(async_req=True)
|
|
6131
|
+
>>> result = thread.get()
|
|
6132
|
+
|
|
6133
|
+
:param async_req bool
|
|
6134
|
+
:param str project_id:
|
|
6135
|
+
:param str cluster_id:
|
|
6136
|
+
:param str page_token:
|
|
6137
|
+
:param str limit:
|
|
6138
|
+
:param str name:
|
|
6139
|
+
:param str user_id:
|
|
6140
|
+
:param bool active_only:
|
|
6141
|
+
:param bool is_favorite:
|
|
6142
|
+
:param bool is_locked:
|
|
6143
|
+
:return: V1ListCloudSpacesResponse
|
|
6144
|
+
If the method is called asynchronously,
|
|
6145
|
+
returns the request thread.
|
|
6146
|
+
"""
|
|
6147
|
+
kwargs['_return_http_data_only'] = True
|
|
6148
|
+
if kwargs.get('async_req'):
|
|
6149
|
+
return self.cloud_space_service_list_cloud_spaces_bulk_with_http_info(**kwargs) # noqa: E501
|
|
6150
|
+
else:
|
|
6151
|
+
(data) = self.cloud_space_service_list_cloud_spaces_bulk_with_http_info(**kwargs) # noqa: E501
|
|
6152
|
+
return data
|
|
6153
|
+
|
|
6154
|
+
def cloud_space_service_list_cloud_spaces_bulk_with_http_info(self, **kwargs) -> 'V1ListCloudSpacesResponse': # noqa: E501
|
|
6155
|
+
"""cloud_space_service_list_cloud_spaces_bulk # noqa: E501
|
|
6156
|
+
|
|
6157
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
6158
|
+
asynchronous HTTP request, please pass async_req=True
|
|
6159
|
+
>>> thread = api.cloud_space_service_list_cloud_spaces_bulk_with_http_info(async_req=True)
|
|
6160
|
+
>>> result = thread.get()
|
|
6161
|
+
|
|
6162
|
+
:param async_req bool
|
|
6163
|
+
:param str project_id:
|
|
6164
|
+
:param str cluster_id:
|
|
6165
|
+
:param str page_token:
|
|
6166
|
+
:param str limit:
|
|
6167
|
+
:param str name:
|
|
6168
|
+
:param str user_id:
|
|
6169
|
+
:param bool active_only:
|
|
6170
|
+
:param bool is_favorite:
|
|
6171
|
+
:param bool is_locked:
|
|
6172
|
+
:return: V1ListCloudSpacesResponse
|
|
6173
|
+
If the method is called asynchronously,
|
|
6174
|
+
returns the request thread.
|
|
6175
|
+
"""
|
|
6176
|
+
|
|
6177
|
+
all_params = ['project_id', 'cluster_id', 'page_token', 'limit', 'name', 'user_id', 'active_only', 'is_favorite', 'is_locked'] # noqa: E501
|
|
6178
|
+
all_params.append('async_req')
|
|
6179
|
+
all_params.append('_return_http_data_only')
|
|
6180
|
+
all_params.append('_preload_content')
|
|
6181
|
+
all_params.append('_request_timeout')
|
|
6182
|
+
|
|
6183
|
+
params = locals()
|
|
6184
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
6185
|
+
if key not in all_params:
|
|
6186
|
+
raise TypeError(
|
|
6187
|
+
"Got an unexpected keyword argument '%s'"
|
|
6188
|
+
" to method cloud_space_service_list_cloud_spaces_bulk" % key
|
|
6189
|
+
)
|
|
6190
|
+
params[key] = val
|
|
6191
|
+
del params['kwargs']
|
|
6192
|
+
|
|
6193
|
+
collection_formats = {}
|
|
6194
|
+
|
|
6195
|
+
path_params = {}
|
|
6196
|
+
|
|
6197
|
+
query_params = []
|
|
6198
|
+
if 'project_id' in params:
|
|
6199
|
+
query_params.append(('projectId', params['project_id'])) # noqa: E501
|
|
6200
|
+
if 'cluster_id' in params:
|
|
6201
|
+
query_params.append(('clusterId', params['cluster_id'])) # noqa: E501
|
|
6202
|
+
if 'page_token' in params:
|
|
6203
|
+
query_params.append(('pageToken', params['page_token'])) # noqa: E501
|
|
6204
|
+
if 'limit' in params:
|
|
6205
|
+
query_params.append(('limit', params['limit'])) # noqa: E501
|
|
6206
|
+
if 'name' in params:
|
|
6207
|
+
query_params.append(('name', params['name'])) # noqa: E501
|
|
6208
|
+
if 'user_id' in params:
|
|
6209
|
+
query_params.append(('userId', params['user_id'])) # noqa: E501
|
|
6210
|
+
if 'active_only' in params:
|
|
6211
|
+
query_params.append(('activeOnly', params['active_only'])) # noqa: E501
|
|
6212
|
+
if 'is_favorite' in params:
|
|
6213
|
+
query_params.append(('isFavorite', params['is_favorite'])) # noqa: E501
|
|
6214
|
+
if 'is_locked' in params:
|
|
6215
|
+
query_params.append(('isLocked', params['is_locked'])) # noqa: E501
|
|
6216
|
+
|
|
6217
|
+
header_params = {}
|
|
6218
|
+
|
|
6219
|
+
form_params = []
|
|
6220
|
+
local_var_files = {}
|
|
6221
|
+
|
|
6222
|
+
body_params = None
|
|
6223
|
+
# HTTP header `Accept`
|
|
6224
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
6225
|
+
['application/json']) # noqa: E501
|
|
6226
|
+
|
|
6227
|
+
# Authentication setting
|
|
6228
|
+
auth_settings = [] # noqa: E501
|
|
6229
|
+
|
|
6230
|
+
return self.api_client.call_api(
|
|
6231
|
+
'/v1/cloudspaces', 'GET',
|
|
6232
|
+
path_params,
|
|
6233
|
+
query_params,
|
|
6234
|
+
header_params,
|
|
6235
|
+
body=body_params,
|
|
6236
|
+
post_params=form_params,
|
|
6237
|
+
files=local_var_files,
|
|
6238
|
+
response_type='V1ListCloudSpacesResponse', # noqa: E501
|
|
6239
|
+
auth_settings=auth_settings,
|
|
6240
|
+
async_req=params.get('async_req'),
|
|
6241
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
6242
|
+
_preload_content=params.get('_preload_content', True),
|
|
6243
|
+
_request_timeout=params.get('_request_timeout'),
|
|
6244
|
+
collection_formats=collection_formats)
|
|
6245
|
+
|
|
6125
6246
|
def cloud_space_service_list_installed_plugins(self, project_id: 'str', id: 'str', **kwargs) -> 'V1PluginsListResponse': # noqa: E501
|
|
6126
6247
|
"""cloud_space_service_list_installed_plugins # noqa: E501
|
|
6127
6248
|
|