lightning-sdk 2025.8.18__py3-none-any.whl → 2025.8.18.post0__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/cloud_account_api.py +5 -0
- lightning_sdk/cli/config/get.py +16 -0
- lightning_sdk/cli/config/set.py +27 -0
- lightning_sdk/cli/studio/create.py +16 -1
- lightning_sdk/cli/studio/start.py +20 -2
- lightning_sdk/studio.py +0 -1
- lightning_sdk/utils/config.py +3 -0
- lightning_sdk/utils/resolve.py +12 -0
- {lightning_sdk-2025.8.18.dist-info → lightning_sdk-2025.8.18.post0.dist-info}/METADATA +1 -1
- {lightning_sdk-2025.8.18.dist-info → lightning_sdk-2025.8.18.post0.dist-info}/RECORD +15 -15
- {lightning_sdk-2025.8.18.dist-info → lightning_sdk-2025.8.18.post0.dist-info}/LICENSE +0 -0
- {lightning_sdk-2025.8.18.dist-info → lightning_sdk-2025.8.18.post0.dist-info}/WHEEL +0 -0
- {lightning_sdk-2025.8.18.dist-info → lightning_sdk-2025.8.18.post0.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-2025.8.18.dist-info → lightning_sdk-2025.8.18.post0.dist-info}/top_level.txt +0 -0
lightning_sdk/__init__.py
CHANGED
|
@@ -181,6 +181,11 @@ class CloudAccountApi:
|
|
|
181
181
|
cloud_provider: Optional[Union["CloudProvider", str]],
|
|
182
182
|
default_cloud_account: Optional[str],
|
|
183
183
|
) -> Optional[str]:
|
|
184
|
+
from lightning_sdk.machine import CloudProvider
|
|
185
|
+
|
|
186
|
+
if cloud_provider and not isinstance(cloud_provider, CloudProvider):
|
|
187
|
+
cloud_provider = CloudProvider(cloud_provider)
|
|
188
|
+
|
|
184
189
|
if cloud_account:
|
|
185
190
|
if cloud_provider:
|
|
186
191
|
cloud_account_resp = self.get_cloud_account_non_org(teamspace_id, cloud_account)
|
lightning_sdk/cli/config/get.py
CHANGED
|
@@ -39,3 +39,19 @@ def get_studio() -> None:
|
|
|
39
39
|
config = Config()
|
|
40
40
|
studio = config.get_value(DefaultConfigKeys.studio)
|
|
41
41
|
click.echo(studio)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@get.command("cloud-account")
|
|
45
|
+
def get_cloud_account() -> None:
|
|
46
|
+
"""Get the default cloud account name from the config."""
|
|
47
|
+
config = Config()
|
|
48
|
+
cloud_account = config.get_value(DefaultConfigKeys.cloud_account)
|
|
49
|
+
click.echo(cloud_account)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@get.command("cloud-provider")
|
|
53
|
+
def get_cloud_provider() -> None:
|
|
54
|
+
"""Get the default cloud provider name from the config."""
|
|
55
|
+
config = Config()
|
|
56
|
+
cloud_provider = config.get_value(DefaultConfigKeys.cloud_provider)
|
|
57
|
+
click.echo(cloud_provider)
|
lightning_sdk/cli/config/set.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import click
|
|
2
2
|
|
|
3
3
|
from lightning_sdk.cli.utils.resolve import resolve_teamspace_owner_name_format
|
|
4
|
+
from lightning_sdk.machine import CloudProvider
|
|
4
5
|
from lightning_sdk.organization import Organization
|
|
5
6
|
from lightning_sdk.studio import Studio
|
|
6
7
|
from lightning_sdk.utils.config import Config, DefaultConfigKeys
|
|
@@ -75,3 +76,29 @@ def set_teamspace(teamspace_name: str) -> None:
|
|
|
75
76
|
setattr(config, DefaultConfigKeys.teamspace_owner_type, "organization")
|
|
76
77
|
else:
|
|
77
78
|
setattr(config, DefaultConfigKeys.teamspace_owner_type, "user")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@set_value.command("cloud-account")
|
|
82
|
+
@click.argument("cloud_account_name")
|
|
83
|
+
def set_cloud_account(cloud_account_name: str) -> None:
|
|
84
|
+
"""Set the default cloud account name in the config."""
|
|
85
|
+
config = Config()
|
|
86
|
+
setattr(config, DefaultConfigKeys.cloud_account, cloud_account_name)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@set_value.command("cloud-provider")
|
|
90
|
+
@click.argument("cloud_provider_name")
|
|
91
|
+
def set_cloud_provider(cloud_provider_name: str) -> None:
|
|
92
|
+
"""Set the default cloud provider name in the config."""
|
|
93
|
+
config = Config()
|
|
94
|
+
|
|
95
|
+
try:
|
|
96
|
+
cloud_provider = CloudProvider(cloud_provider_name)
|
|
97
|
+
except ValueError:
|
|
98
|
+
# TODO: make this a generic CLI error
|
|
99
|
+
raise ValueError(
|
|
100
|
+
f"Could not resolve cloud provider: '{cloud_provider_name}'. "
|
|
101
|
+
f"Supported values are: {', '.join(m.name for m in list(CloudProvider))}"
|
|
102
|
+
) from None
|
|
103
|
+
|
|
104
|
+
setattr(config, DefaultConfigKeys.cloud_provider, cloud_provider.name)
|
|
@@ -18,10 +18,16 @@ from lightning_sdk.studio import Studio
|
|
|
18
18
|
help="The cloud provider to start the studio on. Defaults to teamspace default.",
|
|
19
19
|
type=click.Choice(m.name for m in list(CloudProvider)),
|
|
20
20
|
)
|
|
21
|
+
@click.option(
|
|
22
|
+
"--cloud-account",
|
|
23
|
+
help="The cloud account to create the studio on. Defaults to teamspace default.",
|
|
24
|
+
type=click.STRING,
|
|
25
|
+
)
|
|
21
26
|
def create_studio(
|
|
22
27
|
studio_name: Optional[str] = None,
|
|
23
28
|
teamspace: Optional[str] = None,
|
|
24
29
|
cloud_provider: Optional[str] = None,
|
|
30
|
+
cloud_account: Optional[str] = None,
|
|
25
31
|
) -> None:
|
|
26
32
|
"""Create a new Studio.
|
|
27
33
|
|
|
@@ -42,8 +48,17 @@ def create_studio(
|
|
|
42
48
|
else:
|
|
43
49
|
resolved_teamspace = None
|
|
44
50
|
|
|
51
|
+
if cloud_provider is not None:
|
|
52
|
+
cloud_provider = CloudProvider(cloud_provider)
|
|
53
|
+
|
|
45
54
|
try:
|
|
46
|
-
studio = Studio(
|
|
55
|
+
studio = Studio(
|
|
56
|
+
studio_name,
|
|
57
|
+
teamspace=resolved_teamspace,
|
|
58
|
+
create_ok=True,
|
|
59
|
+
cloud_provider=cloud_provider,
|
|
60
|
+
cloud_account=cloud_account,
|
|
61
|
+
)
|
|
47
62
|
except (RuntimeError, ValueError, ApiException) as e:
|
|
48
63
|
print(e)
|
|
49
64
|
if studio_name:
|
|
@@ -22,9 +22,17 @@ from lightning_sdk.studio import Studio
|
|
|
22
22
|
@click.option("--interruptible", is_flag=True, help="Start the studio on an interruptible instance.")
|
|
23
23
|
@click.option(
|
|
24
24
|
"--cloud-provider",
|
|
25
|
-
help=
|
|
25
|
+
help=(
|
|
26
|
+
"The cloud provider to start the studio on. Defaults to teamspace default. "
|
|
27
|
+
"Only used if --create is specified."
|
|
28
|
+
),
|
|
26
29
|
type=click.Choice(m.name for m in list(CloudProvider)),
|
|
27
30
|
)
|
|
31
|
+
@click.option(
|
|
32
|
+
"--cloud-account",
|
|
33
|
+
help="The cloud account to start the studio on. Defaults to teamspace default. Only used if --create is specified.",
|
|
34
|
+
type=click.STRING,
|
|
35
|
+
)
|
|
28
36
|
def start_studio(
|
|
29
37
|
studio_name: Optional[str] = None,
|
|
30
38
|
teamspace: Optional[str] = None,
|
|
@@ -32,6 +40,7 @@ def start_studio(
|
|
|
32
40
|
machine: Optional[str] = None,
|
|
33
41
|
interruptible: bool = False,
|
|
34
42
|
cloud_provider: Optional[str] = None,
|
|
43
|
+
cloud_account: Optional[str] = None,
|
|
35
44
|
) -> None:
|
|
36
45
|
"""Start a Studio.
|
|
37
46
|
|
|
@@ -52,8 +61,17 @@ def start_studio(
|
|
|
52
61
|
else:
|
|
53
62
|
resolved_teamspace = None
|
|
54
63
|
|
|
64
|
+
if cloud_provider is not None:
|
|
65
|
+
cloud_provider = CloudProvider(cloud_provider)
|
|
66
|
+
|
|
55
67
|
try:
|
|
56
|
-
studio = Studio(
|
|
68
|
+
studio = Studio(
|
|
69
|
+
studio_name,
|
|
70
|
+
teamspace=resolved_teamspace,
|
|
71
|
+
create_ok=create,
|
|
72
|
+
cloud_provider=cloud_provider,
|
|
73
|
+
cloud_account=cloud_account,
|
|
74
|
+
)
|
|
57
75
|
except (RuntimeError, ValueError, ApiException):
|
|
58
76
|
if studio_name:
|
|
59
77
|
raise ValueError(f"Could not start Studio: '{studio_name}'. Does the Studio exist?") from None
|
lightning_sdk/studio.py
CHANGED
|
@@ -81,7 +81,6 @@ class Studio:
|
|
|
81
81
|
raise ValueError("Couldn't resolve teamspace from the provided name, org, or user")
|
|
82
82
|
|
|
83
83
|
self._teamspace = _teamspace
|
|
84
|
-
self._cloud_account = _resolve_deprecated_cluster(cloud_account, cluster)
|
|
85
84
|
|
|
86
85
|
self._setup_done = self._skip_setup
|
|
87
86
|
self._disable_secrets = disable_secrets
|
lightning_sdk/utils/config.py
CHANGED
lightning_sdk/utils/resolve.py
CHANGED
|
@@ -66,6 +66,12 @@ def _resolve_deprecated_provider(
|
|
|
66
66
|
)
|
|
67
67
|
return provider
|
|
68
68
|
|
|
69
|
+
if cloud_provider is None:
|
|
70
|
+
from lightning_sdk.utils.config import Config, DefaultConfigKeys
|
|
71
|
+
|
|
72
|
+
config = Config()
|
|
73
|
+
cloud_provider = config.get_value(DefaultConfigKeys.cloud_provider)
|
|
74
|
+
|
|
69
75
|
return cloud_provider
|
|
70
76
|
|
|
71
77
|
|
|
@@ -84,6 +90,12 @@ def _resolve_deprecated_cluster(cloud_account: Optional[str], cluster: Optional[
|
|
|
84
90
|
)
|
|
85
91
|
return cluster
|
|
86
92
|
|
|
93
|
+
if cloud_account is None:
|
|
94
|
+
from lightning_sdk.utils.config import Config, DefaultConfigKeys
|
|
95
|
+
|
|
96
|
+
config = Config()
|
|
97
|
+
cloud_account = config.get_value(DefaultConfigKeys.cloud_account)
|
|
98
|
+
|
|
87
99
|
return cloud_account
|
|
88
100
|
|
|
89
101
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
docs/source/conf.py,sha256=r8yX20eC-4mHhMTd0SbQb5TlSWHhO6wnJ0VJ_FBFpag,13249
|
|
2
|
-
lightning_sdk/__init__.py,sha256=
|
|
2
|
+
lightning_sdk/__init__.py,sha256=xjqhb1xsoDuv_SHJPA5eoPZ2K78SgqGKcJJYrF7BuMw,1151
|
|
3
3
|
lightning_sdk/agents.py,sha256=ly6Ma1j0ZgGPFyvPvMN28JWiB9dATIstFa5XM8pMi6I,1577
|
|
4
4
|
lightning_sdk/ai_hub.py,sha256=iI1vNhgcz_Ff1c3rN1ogN7dK-r-HXRj6NMtS2cA14UA,6925
|
|
5
5
|
lightning_sdk/base_studio.py,sha256=_Pwwl37R9GRd7t-f2kO5aQXiLNrP4sUtUNht2ZkP8LE,3678
|
|
@@ -14,14 +14,14 @@ lightning_sdk/plugin.py,sha256=f3P5-xZY6x-MX0Fs2z_Q2erSxPSiHZARO0BVkCezHw4,15192
|
|
|
14
14
|
lightning_sdk/sandbox.py,sha256=_NvnWotEXW2rBiVFZZ4krKXxVjuAqfNh04qELSM0-Pg,5786
|
|
15
15
|
lightning_sdk/serve.py,sha256=uW7zLhQ3X90ifetpxzTb8FNxifv5vIs7qZlgfEjVKzk,11794
|
|
16
16
|
lightning_sdk/status.py,sha256=lLGAuSvXBoXQFEEsEYwdCi0RcSNatUn5OPjJVjDtoM0,386
|
|
17
|
-
lightning_sdk/studio.py,sha256=
|
|
17
|
+
lightning_sdk/studio.py,sha256=l3l-TYExmnJnAQIPA6_8R2u1ynT-ewzW-q8hV_nY7nE,27138
|
|
18
18
|
lightning_sdk/teamspace.py,sha256=Ikg3LwGhskD_wAW3GfUOuMgiyEXOV8khleBeIMtN8wA,20751
|
|
19
19
|
lightning_sdk/user.py,sha256=vdn8pZqkAZO0-LoRsBdg0TckRKtd_H3QF4gpiZcl4iY,1130
|
|
20
20
|
lightning_sdk/api/__init__.py,sha256=Qn2VVRvir_gO7w4yxGLkZY-R3T7kdiTPKgQ57BhIA9k,413
|
|
21
21
|
lightning_sdk/api/agents_api.py,sha256=G47TbFo9kYqnBMqdw2RW-lfS1VAUBSXDmzs6fpIEMUs,4059
|
|
22
22
|
lightning_sdk/api/ai_hub_api.py,sha256=azqDZ-PzasVAcoQHno7k7OO_xFOHQ4NDozxF8jEh83Y,7864
|
|
23
23
|
lightning_sdk/api/base_studio_api.py,sha256=3R8tucZX2e9yKHBcY2rWFRP4dxqLrC6H75vdBDkH0ck,3617
|
|
24
|
-
lightning_sdk/api/cloud_account_api.py,sha256=
|
|
24
|
+
lightning_sdk/api/cloud_account_api.py,sha256=b_Egg5yhDh5G39g1cqA3ZxBDmU9iuDs2PlBMmW0HVnA,8417
|
|
25
25
|
lightning_sdk/api/deployment_api.py,sha256=v2AfoTDkQ-1CBh75FOjFkRpf6yc3U_edDy43uYSn19I,24852
|
|
26
26
|
lightning_sdk/api/job_api.py,sha256=7spFPyotlSQ0Krx6WymslnpSQaaeOmFkydvhtg6p0Ic,16410
|
|
27
27
|
lightning_sdk/api/license_api.py,sha256=XV3RhefyPQDYjwY9AaBZe4rByZTEAnsvLDxcdm9q0Wo,2438
|
|
@@ -38,8 +38,8 @@ lightning_sdk/cli/__init__.py,sha256=lksw08t_ZIuHOH47LCIqSVHeZ8cUXI2aJWHYhyujYHM
|
|
|
38
38
|
lightning_sdk/cli/entrypoint.py,sha256=85icG0fmUqXuFErkD2v_kOlqnr18veD8oxe7gPBWHE8,4556
|
|
39
39
|
lightning_sdk/cli/groups.py,sha256=sgKG2z4xJG7lJ1LphSez-cSnntJReSJxJgBp3Z8htUc,951
|
|
40
40
|
lightning_sdk/cli/config/__init__.py,sha256=_aJ7uZZOdjomZ-ABmz8Cu3fLmnSujnQK4hKAEKM4aF4,395
|
|
41
|
-
lightning_sdk/cli/config/get.py,sha256=
|
|
42
|
-
lightning_sdk/cli/config/set.py,sha256=
|
|
41
|
+
lightning_sdk/cli/config/get.py,sha256=JXGRNVGxELS6Es2RESgStzTKnjg5rr-M6yOmx2ty9A8,1606
|
|
42
|
+
lightning_sdk/cli/config/set.py,sha256=B2EXzdpXN8knVLLV-nzSg6I7i3hP1IdYlMssxTr7eMk,3657
|
|
43
43
|
lightning_sdk/cli/config/show.py,sha256=rcarLUSAmbqyEBMFQ9PPHquURFbUCaxoMeBTG1DOpGs,167
|
|
44
44
|
lightning_sdk/cli/job/__init__.py,sha256=HxkswumuGqBnrSHjBElO2CXn9kvH_zVfQEQqd0nwkNU,145
|
|
45
45
|
lightning_sdk/cli/legacy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -73,11 +73,11 @@ lightning_sdk/cli/legacy/deploy/devbox.py,sha256=SdOtYdGefzldn-WCa6sz31zysyf2nP5
|
|
|
73
73
|
lightning_sdk/cli/legacy/deploy/serve.py,sha256=bxN04mHlArjHtxR_QkCM0S_RPmL3WIPsgnPgFadSXwI,15478
|
|
74
74
|
lightning_sdk/cli/mmt/__init__.py,sha256=CLgr-ZHHLS6Db_JGqpxbn4G2pYrKi4Qn-uhi8e0kFNc,145
|
|
75
75
|
lightning_sdk/cli/studio/__init__.py,sha256=Reb5a0iHJfNMxmnP30DAmYqpJ-YDQoJcgyVrD2cYDNo,823
|
|
76
|
-
lightning_sdk/cli/studio/create.py,sha256=
|
|
76
|
+
lightning_sdk/cli/studio/create.py,sha256=o1NkEn5H-SNdpE4yC7KyikTkQM14AVGYMRZlT3iEAfA,2343
|
|
77
77
|
lightning_sdk/cli/studio/delete.py,sha256=33IrIsQC4IwsZYRrys4ZxqNbVC2CwWvy6D6ilYXrLuU,1670
|
|
78
78
|
lightning_sdk/cli/studio/list.py,sha256=LxY5R1aQ4OJbo4TWepK7ugrJIju9iq3Z7m2oq3U9Zcc,2387
|
|
79
79
|
lightning_sdk/cli/studio/ssh.py,sha256=0p1DqKPBkrPRNN2AFlhRK9hnuEX3-33ujiBKh24jB_c,3812
|
|
80
|
-
lightning_sdk/cli/studio/start.py,sha256=
|
|
80
|
+
lightning_sdk/cli/studio/start.py,sha256=h3AQE5RCgLIcT4XoPJI6-kNVr3J1D6KjY2cUAAPjMdk,2975
|
|
81
81
|
lightning_sdk/cli/studio/stop.py,sha256=pYkS1G-XYLWTxTFEIgEg7xcihzviB_gHNqgBLaW3OwQ,1635
|
|
82
82
|
lightning_sdk/cli/studio/switch.py,sha256=uKuAv4J7qozS6YzPqz-45_ccfVWNkyWF5Pij_xDcG0M,1994
|
|
83
83
|
lightning_sdk/cli/utils/__init__.py,sha256=0gHdWY3bqrIyiFiEh_uSBuxWpOykCjqUc8fPEV0z3no,186
|
|
@@ -1131,13 +1131,13 @@ lightning_sdk/services/finetune_llm.py,sha256=5ewjo_bsk5hwvhGoLRdHBv1nP6LeoXDm5_
|
|
|
1131
1131
|
lightning_sdk/services/license.py,sha256=Nav9I6nLIwV-iRZRhZR0iSpyzWPyK-AumIl32hX8nmE,17065
|
|
1132
1132
|
lightning_sdk/services/utilities.py,sha256=WlzKDGqUrQFcT85lnLgHvexf7AB1ppxS4_RBkS9Dbg8,4686
|
|
1133
1133
|
lightning_sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1134
|
-
lightning_sdk/utils/config.py,sha256=
|
|
1134
|
+
lightning_sdk/utils/config.py,sha256=DkH5e4ljBLjOVWwEBSHsF6EMBf-akSwFjHAZKHpqVbE,5369
|
|
1135
1135
|
lightning_sdk/utils/dynamic.py,sha256=glUTO1JC9APtQ6Gr9SO02a3zr56-sPAXM5C3NrTpgyQ,1959
|
|
1136
1136
|
lightning_sdk/utils/enum.py,sha256=h2JRzqoBcSlUdanFHmkj_j5DleBHAu1esQYUsdNI-hU,4106
|
|
1137
|
-
lightning_sdk/utils/resolve.py,sha256=
|
|
1138
|
-
lightning_sdk-2025.8.18.dist-info/LICENSE,sha256=uFIuZwj5z-4TeF2UuacPZ1o17HkvKObT8fY50qN84sg,1064
|
|
1139
|
-
lightning_sdk-2025.8.18.dist-info/METADATA,sha256=
|
|
1140
|
-
lightning_sdk-2025.8.18.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
1141
|
-
lightning_sdk-2025.8.18.dist-info/entry_points.txt,sha256=msB9PJWIJ784dX-OP8by51d4IbKYH3Fj1vCuA9oXjHY,68
|
|
1142
|
-
lightning_sdk-2025.8.18.dist-info/top_level.txt,sha256=ps8doKILFXmN7F1mHncShmnQoTxKBRPIcchC8TpoBw4,19
|
|
1143
|
-
lightning_sdk-2025.8.18.dist-info/RECORD,,
|
|
1137
|
+
lightning_sdk/utils/resolve.py,sha256=r7sh5FvVAqb8Ax_TXED0JR3QJawom6w1wgOjAQFJ-MA,10060
|
|
1138
|
+
lightning_sdk-2025.8.18.post0.dist-info/LICENSE,sha256=uFIuZwj5z-4TeF2UuacPZ1o17HkvKObT8fY50qN84sg,1064
|
|
1139
|
+
lightning_sdk-2025.8.18.post0.dist-info/METADATA,sha256=S52xMvuWPtO5fS2BIflCw3x9nfkpvqPs28M6wp-GMW0,4136
|
|
1140
|
+
lightning_sdk-2025.8.18.post0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
1141
|
+
lightning_sdk-2025.8.18.post0.dist-info/entry_points.txt,sha256=msB9PJWIJ784dX-OP8by51d4IbKYH3Fj1vCuA9oXjHY,68
|
|
1142
|
+
lightning_sdk-2025.8.18.post0.dist-info/top_level.txt,sha256=ps8doKILFXmN7F1mHncShmnQoTxKBRPIcchC8TpoBw4,19
|
|
1143
|
+
lightning_sdk-2025.8.18.post0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{lightning_sdk-2025.8.18.dist-info → lightning_sdk-2025.8.18.post0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|