qbraid-cli 0.15.3__tar.gz → 0.15.4__tar.gz
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.
- {qbraid_cli-0.15.3/qbraid_cli.egg-info → qbraid_cli-0.15.4}/PKG-INFO +1 -1
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/pyproject.toml +1 -1
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/compute/ssh.py +42 -27
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4/qbraid_cli.egg-info}/PKG-INFO +1 -1
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/LICENSE +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/README.md +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/_build_info.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/_version.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/account/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/account/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/admin/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/admin/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/admin/headers.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/admin/validation.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/agents/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/agents/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/agents/permission_response.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/ai/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/ai/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/ai/token.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/compute/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/compute/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/compute/instances.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/compute/profiles.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/compute/server.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/configure/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/configure/actions.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/configure/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/devices/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/devices/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/devices/validation.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/envs/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/envs/activate.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/envs/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/envs/create.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/envs/data_handling.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/envs/groups.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/envs/publish.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/envs/registry.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/envs/share.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/exceptions.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/handlers.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/jobs/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/jobs/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/jobs/groups.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/kernels/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/kernels/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/lab/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/lab/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/main.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/pip/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/pip/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/pip/hooks.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/projects/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/projects/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/py.typed +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/skills/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/skills/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/troubleshoot/__init__.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli/troubleshoot/app.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli.egg-info/SOURCES.txt +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli.egg-info/dependency_links.txt +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli.egg-info/entry_points.txt +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli.egg-info/requires.txt +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/qbraid_cli.egg-info/top_level.txt +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/setup.cfg +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/tests/test_cli_e2e.py +0 -0
- {qbraid_cli-0.15.3 → qbraid_cli-0.15.4}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.15.
|
|
3
|
+
Version: 0.15.4
|
|
4
4
|
Summary: Command Line Interface for interacting with all parts of the qBraid platform.
|
|
5
5
|
Author-email: qBraid Development Team <contact@qbraid.com>
|
|
6
6
|
License-Expression: LicenseRef-Proprietary
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qbraid-cli"
|
|
7
|
-
version = "0.15.
|
|
7
|
+
version = "0.15.4"
|
|
8
8
|
description = "Command Line Interface for interacting with all parts of the qBraid platform."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "qBraid Development Team", email = "contact@qbraid.com" }]
|
|
@@ -60,9 +60,12 @@ def setup_subscription_ssh(
|
|
|
60
60
|
"""Configure SSH for the subscription (JupyterHub) server.
|
|
61
61
|
|
|
62
62
|
The one implementation for `ssh setup`, `instances ssh subscription` and
|
|
63
|
-
`up --ssh`: checks the server is running,
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
`up --ssh`: checks the server is running, mints a session token, honours
|
|
64
|
+
ssh-only profiles (``ide``), registers the key and prints the connection
|
|
65
|
+
panel. Exits 1 with a message when nothing is up.
|
|
66
|
+
|
|
67
|
+
Re-running this is the supported way to recover from a stale token: each
|
|
68
|
+
call mints a fresh one.
|
|
66
69
|
"""
|
|
67
70
|
# Check if server is running
|
|
68
71
|
console.print("Checking server status...")
|
|
@@ -73,34 +76,46 @@ def setup_subscription_ssh(
|
|
|
73
76
|
console.print("Start a server first: qbraid compute instances launch <profile>")
|
|
74
77
|
raise typer.Exit(code=1)
|
|
75
78
|
|
|
76
|
-
#
|
|
77
|
-
#
|
|
79
|
+
# Mint a session token rather than scraping one out of the status URL.
|
|
80
|
+
#
|
|
81
|
+
# The old path read `?token=` off `status.url`. That query parameter is
|
|
82
|
+
# only present in the handful of flows that hand back a click-through link;
|
|
83
|
+
# the Hub's own record of a running server is just `/user/<name>/`, with no
|
|
84
|
+
# query string at all. So the scrape usually found nothing and the command
|
|
85
|
+
# died with "Could not extract token from server URL" -- which reads like
|
|
86
|
+
# the instance is unhealthy and sends you debugging the wrong thing. It
|
|
87
|
+
# also meant a stale token could never be refreshed: the only supply was a
|
|
88
|
+
# URL that no longer carried one.
|
|
89
|
+
#
|
|
90
|
+
# `get_session_token()` is the supported source, is what `ssh token`
|
|
91
|
+
# already uses, and returns a fresh token on every call.
|
|
78
92
|
console.print("Getting session token...")
|
|
79
|
-
|
|
80
|
-
username = None
|
|
81
|
-
resolved_cluster = status.cluster_id
|
|
82
|
-
hub_host = None
|
|
93
|
+
from qbraid_core.services.compute import parse_lab_url
|
|
83
94
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
parsed = urlparse(status.url)
|
|
89
|
-
token = parse_qs(parsed.query).get("token", [None])[0]
|
|
90
|
-
hub_host = parsed.hostname
|
|
95
|
+
resolved_cluster = status.cluster_id
|
|
96
|
+
parts = parse_lab_url(status.url) if status.url else {}
|
|
97
|
+
hub_host = parts.get("hub_domain")
|
|
91
98
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
try:
|
|
100
|
+
session = client.get_session_token(cluster_id)
|
|
101
|
+
except Exception as err: # pylint: disable=broad-exception-caught
|
|
102
|
+
console.print(f"[red]Could not get a session token for this server:[/red] {err}")
|
|
103
|
+
raise typer.Exit(code=1) from err
|
|
104
|
+
|
|
105
|
+
token = session.token.token
|
|
106
|
+
# The API resolves the account's own cluster; prefer what it reports over
|
|
107
|
+
# whatever the caller guessed, and over the status response.
|
|
108
|
+
resolved_cluster = session.cluster_id or resolved_cluster
|
|
109
|
+
|
|
110
|
+
# Username still comes from the URL, and only falls back to the token's.
|
|
111
|
+
# `parse_lab_url` keeps a named server's session segment attached (
|
|
112
|
+
# "507f1f-kanavs/s-0e146b01"), and that segment is part of the proxy path
|
|
113
|
+
# -- /user/<name>/s-<id>/sshd/. The token reports the bare user, so using
|
|
114
|
+
# it first would silently drop the segment and address the wrong pod.
|
|
115
|
+
username = (
|
|
116
|
+
parts.get("username") or session.token.user or (status.user_info.name if status.user_info else None)
|
|
117
|
+
)
|
|
100
118
|
|
|
101
|
-
if not token:
|
|
102
|
-
console.print("[red]Could not extract token from server URL.[/red]")
|
|
103
|
-
raise typer.Exit(code=1)
|
|
104
119
|
if not username:
|
|
105
120
|
console.print("[red]Could not determine username from server status.[/red]")
|
|
106
121
|
raise typer.Exit(code=1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.15.
|
|
3
|
+
Version: 0.15.4
|
|
4
4
|
Summary: Command Line Interface for interacting with all parts of the qBraid platform.
|
|
5
5
|
Author-email: qBraid Development Team <contact@qbraid.com>
|
|
6
6
|
License-Expression: LicenseRef-Proprietary
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|