diracx-cli 0.0.1a10__py3-none-any.whl → 0.0.1a12__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.
- diracx/cli/__init__.py +2 -2
- diracx/cli/config.py +33 -0
- diracx/cli/internal/legacy.py +3 -3
- diracx/cli/jobs.py +3 -2
- {diracx_cli-0.0.1a10.dist-info → diracx_cli-0.0.1a12.dist-info}/METADATA +1 -1
- diracx_cli-0.0.1a12.dist-info/RECORD +13 -0
- {diracx_cli-0.0.1a10.dist-info → diracx_cli-0.0.1a12.dist-info}/WHEEL +1 -1
- diracx_cli-0.0.1a10.dist-info/RECORD +0 -12
- {diracx_cli-0.0.1a10.dist-info → diracx_cli-0.0.1a12.dist-info}/entry_points.txt +0 -0
- {diracx_cli-0.0.1a10.dist-info → diracx_cli-0.0.1a12.dist-info}/top_level.txt +0 -0
diracx/cli/__init__.py
CHANGED
|
@@ -11,7 +11,7 @@ from diracx.client.models import DeviceFlowErrorResponse
|
|
|
11
11
|
from diracx.core.preferences import get_diracx_preferences
|
|
12
12
|
from diracx.core.utils import write_credentials
|
|
13
13
|
|
|
14
|
-
from . import internal, jobs
|
|
14
|
+
from . import config, internal, jobs
|
|
15
15
|
from .utils import AsyncTyper
|
|
16
16
|
|
|
17
17
|
app = AsyncTyper()
|
|
@@ -54,7 +54,6 @@ async def login(
|
|
|
54
54
|
async with DiracClient() as api:
|
|
55
55
|
data = await api.auth.initiate_device_flow(
|
|
56
56
|
client_id=api.client_id,
|
|
57
|
-
audience="Dirac server",
|
|
58
57
|
scope=" ".join(scopes),
|
|
59
58
|
)
|
|
60
59
|
print("Now go to:", data.verification_uri_complete)
|
|
@@ -116,6 +115,7 @@ def callback(output_format: Optional[str] = None):
|
|
|
116
115
|
|
|
117
116
|
|
|
118
117
|
app.add_typer(jobs.app, name="jobs")
|
|
118
|
+
app.add_typer(config.app, name="config")
|
|
119
119
|
app.add_typer(internal.app, name="internal", hidden=True)
|
|
120
120
|
|
|
121
121
|
|
diracx/cli/config.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Can't using PEP-604 with typer: https://github.com/tiangolo/typer/issues/348
|
|
2
|
+
# from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
__all__ = ("dump",)
|
|
5
|
+
|
|
6
|
+
import json
|
|
7
|
+
|
|
8
|
+
from rich import print_json
|
|
9
|
+
|
|
10
|
+
from diracx.client.aio import DiracClient
|
|
11
|
+
from diracx.core.preferences import OutputFormats, get_diracx_preferences
|
|
12
|
+
|
|
13
|
+
from .utils import AsyncTyper
|
|
14
|
+
|
|
15
|
+
app = AsyncTyper()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@app.async_command()
|
|
19
|
+
async def dump():
|
|
20
|
+
async with DiracClient() as api:
|
|
21
|
+
config = await api.config.serve_config()
|
|
22
|
+
display(config)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def display(data):
|
|
26
|
+
output_format = get_diracx_preferences().output_format
|
|
27
|
+
match output_format:
|
|
28
|
+
case OutputFormats.JSON:
|
|
29
|
+
print(json.dumps(data, indent=2))
|
|
30
|
+
case OutputFormats.RICH:
|
|
31
|
+
print_json(data=data)
|
|
32
|
+
case _:
|
|
33
|
+
raise NotImplementedError(output_format)
|
diracx/cli/internal/legacy.py
CHANGED
|
@@ -289,9 +289,9 @@ def generate_helm_values(
|
|
|
289
289
|
# Sandboxstore settings
|
|
290
290
|
# TODO: Integrate minio for production use (ingress, etc)
|
|
291
291
|
# By default, take the server hostname and prepend "sandboxes"
|
|
292
|
-
diracx_settings[
|
|
293
|
-
"
|
|
294
|
-
|
|
292
|
+
diracx_settings["DIRACX_SANDBOX_STORE_BUCKET_NAME"] = (
|
|
293
|
+
f"{diracx_hostname.split('.')[0]}-sandboxes"
|
|
294
|
+
)
|
|
295
295
|
diracx_settings["DIRACX_SANDBOX_STORE_S3_CLIENT_KWARGS"] = json.dumps(
|
|
296
296
|
{
|
|
297
297
|
"endpoint_url": "FILL ME",
|
diracx/cli/jobs.py
CHANGED
|
@@ -62,13 +62,14 @@ async def search(
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
def display(data, unit: str):
|
|
65
|
-
|
|
65
|
+
output_format = get_diracx_preferences().output_format
|
|
66
|
+
match output_format:
|
|
66
67
|
case OutputFormats.JSON:
|
|
67
68
|
print(json.dumps(data, indent=2))
|
|
68
69
|
case OutputFormats.RICH:
|
|
69
70
|
display_rich(data, unit)
|
|
70
71
|
case _:
|
|
71
|
-
raise NotImplementedError(
|
|
72
|
+
raise NotImplementedError(output_format)
|
|
72
73
|
|
|
73
74
|
|
|
74
75
|
def display_rich(data, unit: str) -> None:
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
diracx/cli/__init__.py,sha256=o1QUsW_KBdEc06o7QlxUggDMXrdDeitgWKSf93pAcr4,3989
|
|
2
|
+
diracx/cli/__main__.py,sha256=SM9tEc-fiW7cDHTKQRwgKobe5FfijHLYiAWfWaIM_zg,56
|
|
3
|
+
diracx/cli/config.py,sha256=r5Lq_SN-1t3IzGAeS57ZzS-ukLhP6PMnmTXNld2pZXU,818
|
|
4
|
+
diracx/cli/jobs.py,sha256=wTkp_MUnyrq-AFpfN3A42M-INRfI21qdnMHvXE7F8FQ,3165
|
|
5
|
+
diracx/cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
diracx/cli/utils.py,sha256=m04ADEsXuE2D1-R_-arGAv6JH6mlREFfBqY3KJOnGYc,488
|
|
7
|
+
diracx/cli/internal/__init__.py,sha256=17PDFFNhppYPPq6KPmMxnOG3N6sP3apewpk8VjjHTYY,6041
|
|
8
|
+
diracx/cli/internal/legacy.py,sha256=qiO73vIh2LPM6jma6G2RcLINwX6ZP5i1rhYBVMMYOuE,10849
|
|
9
|
+
diracx_cli-0.0.1a12.dist-info/METADATA,sha256=2Lyhr-8s30h--Mml9ZCPQZjK7B8rlXA5537ABPhi7iM,792
|
|
10
|
+
diracx_cli-0.0.1a12.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
11
|
+
diracx_cli-0.0.1a12.dist-info/entry_points.txt,sha256=pKKS950WHHoO6teZZXkWztX2XZFZSH6uh9BKY1PA-jg,41
|
|
12
|
+
diracx_cli-0.0.1a12.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
|
|
13
|
+
diracx_cli-0.0.1a12.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
diracx/cli/__init__.py,sha256=VJNGMc9-zVB6xgHPPxvjpMy9mGf5hytQCPUnjp309_Q,3977
|
|
2
|
-
diracx/cli/__main__.py,sha256=SM9tEc-fiW7cDHTKQRwgKobe5FfijHLYiAWfWaIM_zg,56
|
|
3
|
-
diracx/cli/jobs.py,sha256=QqU4A1Bdyw3P9rm0YhoG7NmF2BKVx67eO-HSmp_BhVU,3124
|
|
4
|
-
diracx/cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
diracx/cli/utils.py,sha256=m04ADEsXuE2D1-R_-arGAv6JH6mlREFfBqY3KJOnGYc,488
|
|
6
|
-
diracx/cli/internal/__init__.py,sha256=17PDFFNhppYPPq6KPmMxnOG3N6sP3apewpk8VjjHTYY,6041
|
|
7
|
-
diracx/cli/internal/legacy.py,sha256=U1OdqpzY-8DuSDTNESjqKmab7i16G6UEFpap4n1B6XA,10847
|
|
8
|
-
diracx_cli-0.0.1a10.dist-info/METADATA,sha256=m6xhkqFMpXc3sbKUfhxPiyaj1ZCYRQzm9PJC2S1MCVs,792
|
|
9
|
-
diracx_cli-0.0.1a10.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
10
|
-
diracx_cli-0.0.1a10.dist-info/entry_points.txt,sha256=pKKS950WHHoO6teZZXkWztX2XZFZSH6uh9BKY1PA-jg,41
|
|
11
|
-
diracx_cli-0.0.1a10.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
|
|
12
|
-
diracx_cli-0.0.1a10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|