truefoundry 0.7.0rc5__py3-none-any.whl → 0.7.1__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.

Potentially problematic release.


This version of truefoundry might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: truefoundry
3
- Version: 0.7.0rc5
3
+ Version: 0.7.1
4
4
  Summary: TrueFoundry CLI
5
5
  Author-email: TrueFoundry Team <abhishek@truefoundry.com>
6
6
  Requires-Python: <3.14,>=3.8.1
@@ -14,9 +14,10 @@ Requires-Dist: gitpython<4.0.0,>=3.1.43
14
14
  Requires-Dist: importlib-metadata<9.0.0,>=4.11.3
15
15
  Requires-Dist: importlib-resources<7.0.0,>=5.2.0
16
16
  Requires-Dist: mako<2.0.0,>=1.1.6
17
+ Requires-Dist: mcp==1.6.0; python_version >= '3.10'
17
18
  Requires-Dist: numpy<3.0.0,>=1.23.0
18
19
  Requires-Dist: openai<2.0.0,>=1.16.2
19
- Requires-Dist: packaging<25.0,>=20.0
20
+ Requires-Dist: packaging<26.0,>=20.0
20
21
  Requires-Dist: pydantic<3.0.0,>=1.8.2
21
22
  Requires-Dist: pygments<3.0.0,>=2.12.0
22
23
  Requires-Dist: pyjwt<3.0.0,>=2.0.0
@@ -30,7 +31,7 @@ Requires-Dist: requirements-parser<0.12.0,>=0.11.0
30
31
  Requires-Dist: rich-click<2.0.0,>=1.2.1
31
32
  Requires-Dist: rich<14.0.0,>=13.7.1
32
33
  Requires-Dist: tqdm<5.0.0,>=4.0.0
33
- Requires-Dist: truefoundry-sdk==0.0.14
34
+ Requires-Dist: truefoundry-sdk==0.0.16
34
35
  Requires-Dist: typing-extensions>=4.0
35
36
  Requires-Dist: urllib3<3,>=1.26.18
36
37
  Requires-Dist: yq<4.0.0,>=3.1.0
@@ -28,15 +28,15 @@ truefoundry/autodeploy/utils/client.py,sha256=PvbSkfgAjAogGjisinqmh4mP4svowxAC0I
28
28
  truefoundry/autodeploy/utils/diff.py,sha256=Ef8Y-VffDKel_-q-GxRam6gqiv8qTLMcqVg6iifXfcA,5358
29
29
  truefoundry/autodeploy/utils/pydantic_compat.py,sha256=hEAUy5kLjhPdzw7yGZ2iXGMXbbMVXVlGzIofmyHafXQ,412
30
30
  truefoundry/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
- truefoundry/cli/__main__.py,sha256=oJgbKUQbT5SDhqdtvhGw-WG6s0Kg3jiMiO0oz7bgOrc,3525
32
- truefoundry/cli/config.py,sha256=tf8w4UfVzcC6eYkENvuuCPYt_V3sqVpO1bclORV9tAk,206
31
+ truefoundry/cli/__main__.py,sha256=DUEAL34G8EHchlgJ38pXyVvXa-AmHu498s2JRK0m1xY,3980
32
+ truefoundry/cli/config.py,sha256=f7z0_gmYZiNImB7Bxz0AnOlrxY2X4lFnX4jYW1I7NHQ,139
33
33
  truefoundry/cli/console.py,sha256=9-dMy4YPisCJQziRKTg8Qa0UJnOGl1soiUnJjsnLDvE,242
34
34
  truefoundry/cli/const.py,sha256=dVHPo1uAiDSSMXwXoT2mR5kNQjExT98QNVRz98Hz_Ts,510
35
- truefoundry/cli/display_util.py,sha256=8ZXfm_Z00CBe0C8CzC-d-6B_dgib5nK8Ge2ci9S3o0E,3129
36
- truefoundry/cli/util.py,sha256=gLSKts2js8ThKXV19p2ENv5seSf12PrUemUsveNmcGY,3717
35
+ truefoundry/cli/display_util.py,sha256=s0_eWUUAK1dbmqW5h_qAG93roH81dh-g1nLjuQVFm6k,5130
36
+ truefoundry/cli/util.py,sha256=BjDUG4WU8iF540YdrBtBQI2WqfNAYyk9iuMiKq7b6jk,3705
37
37
  truefoundry/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  truefoundry/common/auth_service_client.py,sha256=N3YxKlx63r6cPZqbgb2lqBOPI69ShB7D7RCIq4FSCjc,7949
39
- truefoundry/common/constants.py,sha256=rXWVNhy2j8UVmkPxpjaftL6mWRYILLzKLyCAAXKJy6Q,3247
39
+ truefoundry/common/constants.py,sha256=eWcElAYIVb0jnHUAcsHvgnkdKf2E1nCg_Ybbi8ibxF0,4365
40
40
  truefoundry/common/credential_file_manager.py,sha256=1yEk1Zm2xS4G0VDFwKSZ4w0VUrcPWQ1nJnoBaz9xyKA,4251
41
41
  truefoundry/common/credential_provider.py,sha256=_OhJ2XFlDaVsrUO-FyywxctcGGqDdC2pgcvwEKqQD0Q,4071
42
42
  truefoundry/common/entities.py,sha256=ko33kesGy3vI9NJ5Ganq8HpnaURTOHictr6h75764no,3893
@@ -46,7 +46,7 @@ truefoundry/common/servicefoundry_client.py,sha256=2fYhdVPSvLXz5C5tosOq86JD8WM3I
46
46
  truefoundry/common/session.py,sha256=d9l3TEBpqVP4mr4mTGY1qVxc815skzMlNNdw14otg34,2923
47
47
  truefoundry/common/storage_provider_utils.py,sha256=yURhMw8k0FLFvaviRHDiifhvc6GnuQwGMC9Qd2uM440,10934
48
48
  truefoundry/common/types.py,sha256=BMJFCsR1lPJAw66IQBSvLyV4I6o_x5oj78gVsUa9si8,188
49
- truefoundry/common/utils.py,sha256=yEQtJW2fT9xbNpRhfRoD9hvhGw-FgGS3agh1oZptmjg,6379
49
+ truefoundry/common/utils.py,sha256=j3QP0uOsaGD_VmDDR68JTwoYE1okkAq6OqpVkzVf48Q,6424
50
50
  truefoundry/common/warnings.py,sha256=rs6BHwk7imQYedo07iwh3TWEOywAR3Lqhj0AY4khByg,504
51
51
  truefoundry/deploy/__init__.py,sha256=6D22iiCgd5xlzBaG34q9Cx4rGgwf5qIAKQrOCgaCXYY,2746
52
52
  truefoundry/deploy/python_deploy_codegen.py,sha256=AainOFR20XvhNeztJkLPWGZ40lAT_nwc-ZmG77Kum4o,6525
@@ -62,26 +62,24 @@ truefoundry/deploy/builder/builders/tfy_notebook_buildpack/dockerfile_template.p
62
62
  truefoundry/deploy/builder/builders/tfy_python_buildpack/__init__.py,sha256=wnPwIIArn1H_g4CeTNl5W7EaqRq5FbWDnJpd6E4RSDY,1864
63
63
  truefoundry/deploy/builder/builders/tfy_python_buildpack/dockerfile_template.py,sha256=2KnYTL6yhy0KdiTjSkRfEj_gyCYtmDa2ZsnB06tOpT8,8973
64
64
  truefoundry/deploy/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
- truefoundry/deploy/cli/commands/__init__.py,sha256=wn_TsmrImj9pER16O5aK3aW2mfqbRgrhv-jn4x3_2oM,1278
65
+ truefoundry/deploy/cli/commands/__init__.py,sha256=f7sXiQK9UuxDJmvBa-QCFNyumUpGGMhZbCxdwJzWXwQ,1116
66
66
  truefoundry/deploy/cli/commands/apply_command.py,sha256=Y2e_C8HVpo8CssVod-3JRz-89qStC5JRaNzJ7O2mRlY,2039
67
+ truefoundry/deploy/cli/commands/ask_command.py,sha256=9TDZVKEKhBvNx3NVz51bbkbbeeEMI3Xc85THnOGHM1g,5970
67
68
  truefoundry/deploy/cli/commands/build_command.py,sha256=zJBywMatbpUlXx5O2aqpEVmPeBIJ9RNnG9abSc8C8CE,1234
68
- truefoundry/deploy/cli/commands/create_command.py,sha256=rCajvQvAfZU10nDZOYpRACbAATH1zj52ihTWrhnLLUc,1829
69
- truefoundry/deploy/cli/commands/delete_command.py,sha256=8SriRwg5mEHL4zP0mdDjJ0cKWJTU_1Pjq3450zMr9tk,3889
69
+ truefoundry/deploy/cli/commands/delete_command.py,sha256=i_lr_MocTEPKF2VwLe8B7oZWsgXK06EX_43_xdM5DIs,3875
70
70
  truefoundry/deploy/cli/commands/deploy_command.py,sha256=8aTBvzPaT9xg6KPmpcpqJlmdj4yXzWUfAy6slcoPN74,4123
71
71
  truefoundry/deploy/cli/commands/deploy_init_command.py,sha256=g-jBfrEmhZ0TDWsyqPDn4K6q33EqJSGmBTt1eMYig-w,600
72
72
  truefoundry/deploy/cli/commands/get_command.py,sha256=bR8tAjQQhimzaTQ57L6BPJwcxQ_SGWCF5CqHDpxgG90,837
73
73
  truefoundry/deploy/cli/commands/k8s_exec_credential_command.py,sha256=EknpdufMAEnjSGMG7a-Jj7tkoiS5zmbJRREafb14Alw,2160
74
- truefoundry/deploy/cli/commands/kubeconfig_command.py,sha256=3u3A_scsdd1UnqxKQgGg8ivZArZKQYVV0Z-ATotbPPc,4176
75
- truefoundry/deploy/cli/commands/list_command.py,sha256=zKu_JWY35eMIzgSNFYtmwi2uezZ4k-8yk3C1Vqsvshc,4470
76
- truefoundry/deploy/cli/commands/login_command.py,sha256=EHZH3cDQdbVWMkuFxd7JfB0B0Dr89sUmt214ICBmspY,1024
74
+ truefoundry/deploy/cli/commands/kubeconfig_command.py,sha256=v6LmDyf2YQPxPrueGlzIq_leN6kKi1ks2zyWb4FmbXU,3150
75
+ truefoundry/deploy/cli/commands/login_command.py,sha256=kbEs4leyMYK2kz7L9ql2PXVgLVmCYo-LWtnntVVYLFY,1065
77
76
  truefoundry/deploy/cli/commands/logout_command.py,sha256=u3kfrEp0ETbrz40KjD4GCC3XEZ5YRAlrca_Df4U_mk0,536
78
77
  truefoundry/deploy/cli/commands/logs_command.py,sha256=osl2z5VaIceB9sYa6GtwsuyAPZKcw-A0oVEt3g1f62Q,4140
79
78
  truefoundry/deploy/cli/commands/patch_application_command.py,sha256=YdTlkWGI2gCMoVAgPJtybjuvRFqZq9tp6TqbCpwgXUY,2443
80
79
  truefoundry/deploy/cli/commands/patch_command.py,sha256=wA95khMO9uVz8SaJlgYMUwaX7HagtchjyxXXATq83Bk,1665
81
- truefoundry/deploy/cli/commands/redeploy_command.py,sha256=JNeSK3itsirrKYJh3q-Cc10pCtYR9bojsvI8up6_0wI,1018
82
80
  truefoundry/deploy/cli/commands/terminate_comand.py,sha256=UKhOdbAej8ubX3q44vpLrOotAcvH4vHpRZJQrRf_AfM,1077
83
81
  truefoundry/deploy/cli/commands/trigger_command.py,sha256=_qSl-AShepZpbGUGTfLfJGd74VJJ_wd3eXYt2DfxIFo,4716
84
- truefoundry/deploy/cli/commands/utils.py,sha256=Fftlayq5PbLV7lqFVIoMy_uBoIKe2_XpX4BEyQnliC4,3670
82
+ truefoundry/deploy/cli/commands/utils.py,sha256=44XkNPxGK1wUEHfUTAn9pHZXosvUlby4PVy2cY3yBNc,4723
85
83
  truefoundry/deploy/core/__init__.py,sha256=j61bMWj4BkWihdssKMSFhieo7afJDtpc7qO7zk1rDB4,140
86
84
  truefoundry/deploy/core/login.py,sha256=N2VrW3nlBzoyoYulkipxwQvCpjBhi3sfsmhxK1ktWhg,236
87
85
  truefoundry/deploy/core/logout.py,sha256=TpWLq4_DsxYS5GX2OJQGDhekNOfiOLb-vO5khQueHXw,80
@@ -97,6 +95,8 @@ truefoundry/deploy/lib/session.py,sha256=fLdgR6ZDp8-hFl5NTON4ngnWLsMzGxvKtfpDOOw
97
95
  truefoundry/deploy/lib/util.py,sha256=J7r8San2wKo48A7-BlH2-OKTlBO67zlPjLEhMsL8os0,1059
98
96
  truefoundry/deploy/lib/win32.py,sha256=1RcvPTdlOAJ48rt8rCbE2Ufha2ztRqBAE9dueNXArrY,5009
99
97
  truefoundry/deploy/lib/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
+ truefoundry/deploy/lib/clients/_mcp_streamable_http.py,sha256=oO_pdgVy0BkksLDZo-arcnaJ4gSaTJmMMZF9u-uF7Mk,10851
99
+ truefoundry/deploy/lib/clients/ask_client.py,sha256=PINeyjZF9IMkphU6ln6JVKlFJrHPhkkE5wolFBrp_f8,13589
100
100
  truefoundry/deploy/lib/clients/servicefoundry_client.py,sha256=fmRlPYCimk1ZLbMgdzfJVCbcKRCVnFYL5T3j2uJA0Tc,27037
101
101
  truefoundry/deploy/lib/dao/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
102
  truefoundry/deploy/lib/dao/application.py,sha256=oMszpueXPUfTUuN_XdKwoRjQyqAgWHhZ-10cbprCVdM,9226
@@ -108,7 +108,7 @@ truefoundry/deploy/lib/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
108
108
  truefoundry/deploy/lib/model/entity.py,sha256=Bp9sLB-M5INCpw5lPmFdygHWS1zvnLicnSiSCi2iqhQ,8591
109
109
  truefoundry/deploy/v2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
110
110
  truefoundry/deploy/v2/lib/__init__.py,sha256=WEiVMZXOVljzEE3tpGJil14liIn_PCDoACJ6b3tZ6sI,188
111
- truefoundry/deploy/v2/lib/deploy.py,sha256=Og7P6S3Gc8pXRudf2luk2IOb_5oMGoz-h0rQcLWaw7M,11708
111
+ truefoundry/deploy/v2/lib/deploy.py,sha256=EOqVQTCMrvs_Kwp8Ft0FZYlRErPuFq4eDBDR1qEZ7_E,11767
112
112
  truefoundry/deploy/v2/lib/deploy_workflow.py,sha256=G5BzMIbap8pgDX1eY-TITruUxQdkKhYtBmRwLL6lDeY,14342
113
113
  truefoundry/deploy/v2/lib/deployable_patched_models.py,sha256=xbHFD3pURflvCm8EODPvjfvRrv67mlSrjPUknY8SMB8,4060
114
114
  truefoundry/deploy/v2/lib/models.py,sha256=ogc1UYs1Z2nBdGSKCrde9sk8d0GxFKMkem99uqO5CmM,1148
@@ -125,7 +125,7 @@ truefoundry/ml/logger.py,sha256=VT-BF3BnBYTWVq87O58F0c8uXMu94gYzsiFlGY3_7Ao,458
125
125
  truefoundry/ml/mlfoundry_api.py,sha256=WiIVpJRylBn8NrcAmXClQnavffqI9fhY5h-8Vwx4RKo,59872
126
126
  truefoundry/ml/mlfoundry_run.py,sha256=34yyQqgpG6EfrAJd37vkbCjrFoHkhvbOAxxSQcSWPtY,44320
127
127
  truefoundry/ml/model_framework.py,sha256=nVbKTtKDRBdLzt7Wrg5_vJKZ-awHbISGvL73s-V9egU,18975
128
- truefoundry/ml/prompt_utils.py,sha256=muN0P9OTKtm9SLr25e0U0W1vx_v9vWxV3tvAUUC-8HE,2514
128
+ truefoundry/ml/prompt_utils.py,sha256=8FueyElVTXLnLtC3O6hKsW_snocArr_B8KG3Qv6eFIQ,2651
129
129
  truefoundry/ml/run_utils.py,sha256=0W208wSLUrbdfk2pjNcZlkUi9bNxG2JORqoe-5rVqHI,2423
130
130
  truefoundry/ml/session.py,sha256=2v8JjFyrcKzKQ8qsTaZaQTqlxl-in9odIMyWWMEqWNY,4436
131
131
  truefoundry/ml/validation_utils.py,sha256=rmIBNcpmnwq2jeje6uFg8uY-rL4JG_RV6mc6BlujVWg,12150
@@ -366,7 +366,7 @@ truefoundry/ml/log_types/image/constants.py,sha256=wLtGEOA4T5fZHSlOXPuNDLX3lpbCt
366
366
  truefoundry/ml/log_types/image/image.py,sha256=sa0tBHdyluC8bELXY16E0HgFrUDnDBxHrteix4BFXcs,12479
367
367
  truefoundry/ml/log_types/image/image_normalizer.py,sha256=vrzfuSpVGgIxw_Q2sbFe7kQ_JpAndX0bMwC7wtfi41g,3104
368
368
  truefoundry/ml/log_types/image/types.py,sha256=inFQlyAyDvZtfliFpENirNCm1XO9beyZ8DNn97DoDKs,1568
369
- truefoundry/workflow/__init__.py,sha256=XY83vqtLAclI82atZXyBtF9ZgLROXaaXO5p60XH5hJA,1493
369
+ truefoundry/workflow/__init__.py,sha256=MNxnOh5fzAmDaK-cJy9qwtA-zH2CdOEP2h0q9lEiLgY,1588
370
370
  truefoundry/workflow/container_task.py,sha256=8arieePsX4__OnG337hOtCiNgJwtKJJCsZcmFmCBJtk,402
371
371
  truefoundry/workflow/map_task.py,sha256=f9vcAPRQy0Ttw6bvdZBKUVJMSm4eGQrbE1GHWhepHIU,1864
372
372
  truefoundry/workflow/python_task.py,sha256=SRXRLC4vdBqGjhkwuaY39LEWN6iPCpJAuW17URRdWTY,1128
@@ -376,7 +376,7 @@ truefoundry/workflow/remote_filesystem/__init__.py,sha256=LQ95ViEjJ7Ts4JcCGOxMPs
376
376
  truefoundry/workflow/remote_filesystem/logger.py,sha256=em2l7D6sw7xTLDP0kQSLpgfRRCLpN14Qw85TN7ujQcE,1022
377
377
  truefoundry/workflow/remote_filesystem/tfy_signed_url_client.py,sha256=xcT0wQmQlgzcj0nP3tJopyFSVWT1uv3nhiTIuwfXYeg,12342
378
378
  truefoundry/workflow/remote_filesystem/tfy_signed_url_fs.py,sha256=nSGPZu0Gyd_jz0KsEE-7w_BmnTD8CVF1S8cUJoxaCbc,13305
379
- truefoundry-0.7.0rc5.dist-info/METADATA,sha256=qY09MnUMrEQSVOCK9FYPjgcRNiK8UzEr4U1wp0xE35c,2410
380
- truefoundry-0.7.0rc5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
381
- truefoundry-0.7.0rc5.dist-info/entry_points.txt,sha256=xVjn7RMN-MW2-9f7YU-bBdlZSvvrwzhpX1zmmRmsNPU,98
382
- truefoundry-0.7.0rc5.dist-info/RECORD,,
379
+ truefoundry-0.7.1.dist-info/METADATA,sha256=4KsZYBQ-LTd9M5DCjkvwMBjFr1bA61NJl14L5IiwsuI,2459
380
+ truefoundry-0.7.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
381
+ truefoundry-0.7.1.dist-info/entry_points.txt,sha256=xVjn7RMN-MW2-9f7YU-bBdlZSvvrwzhpX1zmmRmsNPU,98
382
+ truefoundry-0.7.1.dist-info/RECORD,,
@@ -1,75 +0,0 @@
1
- from typing import Optional
2
-
3
- import rich_click as click
4
-
5
- from truefoundry.cli.const import COMMAND_CLS, GROUP_CLS
6
- from truefoundry.cli.display_util import print_obj
7
- from truefoundry.cli.util import handle_exception_wrapper
8
- from truefoundry.deploy.lib.dao import workspace as workspace_lib
9
-
10
-
11
- @click.group(name="create", cls=GROUP_CLS)
12
- def create_command():
13
- # TODO (chiragjn): Figure out a way to update supported resources based on ENABLE_* flags
14
- """
15
- Create TrueFoundry resources
16
-
17
- \b
18
- Supported resources:
19
- - Workspace
20
- """
21
- pass
22
-
23
-
24
- @click.command(name="workspace", cls=COMMAND_CLS, help="Create a new Workspace")
25
- @click.argument("name", type=click.STRING)
26
- @click.option(
27
- "-c",
28
- "--cluster-name",
29
- "--cluster_name",
30
- type=click.STRING,
31
- required=True,
32
- help="Cluster to create this workspace in",
33
- )
34
- @click.option(
35
- "--cpu-limit",
36
- "--cpu_limit",
37
- type=click.FLOAT,
38
- default=None,
39
- help="CPU Limit",
40
- )
41
- @click.option(
42
- "--memory-limit",
43
- "--memory_limit",
44
- type=click.INT,
45
- default=None,
46
- help="Memory Limit in MB",
47
- )
48
- @click.option(
49
- "--ephemeral-storage-limit",
50
- "--ephemeral_storage_limit",
51
- type=click.INT,
52
- default=None,
53
- help="Ephemeral Storage Limit in GB",
54
- )
55
- @handle_exception_wrapper
56
- def create_workspace(
57
- name: str,
58
- cluster_name: str,
59
- cpu_limit: Optional[float],
60
- memory_limit: Optional[int],
61
- ephemeral_storage_limit: Optional[int],
62
- ):
63
- workspace = workspace_lib.create_workspace(
64
- name=name,
65
- cpu_limit=cpu_limit,
66
- memory_limit=memory_limit,
67
- ephemeral_storage_limit=ephemeral_storage_limit,
68
- cluster_name=cluster_name,
69
- )
70
- print_obj("Workspace", workspace.dict())
71
-
72
-
73
- def get_create_command():
74
- create_command.add_command(create_workspace)
75
- return create_command
@@ -1,171 +0,0 @@
1
- import rich_click as click
2
-
3
- from truefoundry.cli.config import CliConfig
4
- from truefoundry.cli.const import COMMAND_CLS, GROUP_CLS
5
- from truefoundry.cli.display_util import print_entity_list, print_json
6
- from truefoundry.cli.util import handle_exception_wrapper
7
- from truefoundry.deploy.io.rich_output_callback import RichOutputCallBack
8
- from truefoundry.deploy.lib.dao import application as application_lib
9
- from truefoundry.deploy.lib.dao import version as version_lib
10
- from truefoundry.deploy.lib.dao import workspace as workspace_lib
11
- from truefoundry.deploy.lib.messages import (
12
- PROMPT_NO_APPLICATIONS,
13
- PROMPT_NO_VERSIONS,
14
- PROMPT_NO_WORKSPACES,
15
- )
16
-
17
- # TODO (chiragjn): --json should disable all non json console prints
18
-
19
-
20
- @click.group(name="list", cls=GROUP_CLS)
21
- def list_command():
22
- # TODO (chiragjn): Figure out a way to update supported resources based on ENABLE_* flags
23
- """
24
- List TrueFoundry resources
25
-
26
- \b
27
- Supported resources:
28
- - Workspace
29
- - Application
30
- - Application Version
31
- """
32
-
33
-
34
- @click.command(name="workspaces", cls=COMMAND_CLS, help="List Workspaces")
35
- @click.option(
36
- "-c",
37
- "--cluster-name",
38
- "--cluster_name",
39
- type=click.STRING,
40
- default=None,
41
- help="Cluster name",
42
- )
43
- @handle_exception_wrapper
44
- def list_workspaces(cluster_name):
45
- workspaces = workspace_lib.list_workspaces(
46
- cluster_name=cluster_name,
47
- )
48
- if not workspaces:
49
- output_hook = RichOutputCallBack()
50
- output_hook.print_line(PROMPT_NO_WORKSPACES)
51
- else:
52
- workspaces.sort(key=lambda s: s.createdAt, reverse=True)
53
-
54
- print_entity_list(
55
- "Workspaces",
56
- workspaces,
57
- )
58
-
59
-
60
- @click.command(name="applications", cls=COMMAND_CLS, help="List Applications")
61
- @click.option(
62
- "-w",
63
- "--workspace-fqn",
64
- "--workspace_fqn",
65
- type=click.STRING,
66
- default=None,
67
- help="FQN of the Workspace",
68
- )
69
- @click.option(
70
- "--application-type",
71
- "--application_type",
72
- type=click.Choice(
73
- [
74
- "service",
75
- "job",
76
- "model-deployment",
77
- "volume",
78
- "notebook",
79
- "intercept",
80
- "helm",
81
- "all",
82
- ]
83
- ),
84
- default="all",
85
- help="Application Type",
86
- )
87
- @handle_exception_wrapper
88
- def list_applications(workspace_fqn, application_type):
89
- applications = application_lib.list_applications(
90
- workspace_fqn=workspace_fqn, application_type=application_type
91
- )
92
- if not applications:
93
- output_hook = RichOutputCallBack()
94
- output_hook.print_line(PROMPT_NO_APPLICATIONS)
95
- else:
96
- applications.sort(key=lambda s: s.createdAt, reverse=True)
97
-
98
- print_entity_list(
99
- "Applications",
100
- applications,
101
- )
102
-
103
-
104
- @click.command(
105
- name="application-versions", cls=COMMAND_CLS, help="List Application Versions"
106
- )
107
- @click.option(
108
- "--application-fqn",
109
- "--application_fqn",
110
- type=click.STRING,
111
- default=None,
112
- help="FQN of the application",
113
- required=True,
114
- )
115
- @handle_exception_wrapper
116
- def list_versions(application_fqn):
117
- versions = version_lib.list_versions(
118
- application_fqn=application_fqn,
119
- )
120
- if not versions:
121
- output_hook = RichOutputCallBack()
122
- output_hook.print_line(PROMPT_NO_VERSIONS)
123
- else:
124
- versions.sort(key=lambda s: s.createdAt, reverse=True)
125
-
126
- print_entity_list(
127
- "Application Versions",
128
- versions,
129
- )
130
-
131
-
132
- @click.command(name="job-run", cls=COMMAND_CLS, help="List Job Runs")
133
- @click.option(
134
- "--application-fqn",
135
- "--application_fqn",
136
- type=click.STRING,
137
- default=None,
138
- help="FQN of the application",
139
- required=True,
140
- )
141
- @click.option(
142
- "--max-results",
143
- "--max_results",
144
- type=click.STRING,
145
- default=None,
146
- help="Maximum number of Runs to fetch",
147
- )
148
- @click.option(
149
- "--offset",
150
- type=click.STRING,
151
- default=None,
152
- help="Number of Runs to skip",
153
- )
154
- @handle_exception_wrapper
155
- def list_job_runs(application_fqn, max_results, offset):
156
- job_runs = application_lib.list_job_runs(
157
- application_fqn=application_fqn, max_results=max_results, offset=offset
158
- )
159
- if CliConfig.get("json"):
160
- print_json(data=job_runs.dict())
161
- else:
162
- print_entity_list("Job Runs", job_runs)
163
-
164
-
165
- def get_list_command():
166
- list_command.add_command(list_workspaces)
167
- list_command.add_command(list_applications)
168
- list_command.add_command(list_versions)
169
- list_command.add_command(list_job_runs)
170
-
171
- return list_command
@@ -1,41 +0,0 @@
1
- import rich_click as click
2
-
3
- from truefoundry.cli.const import COMMAND_CLS
4
- from truefoundry.cli.util import handle_exception_wrapper
5
- from truefoundry.deploy.lib.dao import application as application_lib
6
-
7
-
8
- @click.command(name="redeploy", cls=COMMAND_CLS)
9
- @click.option(
10
- "--application-fqn",
11
- type=click.STRING,
12
- default=None,
13
- help="Application fqn",
14
- required=True,
15
- )
16
- @click.option(
17
- "--version",
18
- type=click.STRING,
19
- default=None,
20
- help="Application deployment version",
21
- required=True,
22
- )
23
- @click.option(
24
- "--wait/--no-wait",
25
- is_flag=True,
26
- show_default=True,
27
- default=True,
28
- help="wait and tail the deployment progress",
29
- )
30
- @handle_exception_wrapper
31
- def redeploy_command(application_fqn: str, version: int, wait: bool):
32
- """
33
- Redeploy specific version of an application
34
- """
35
- _deployment = application_lib.redeploy_application(
36
- application_fqn=application_fqn, version=version, wait=wait
37
- )
38
-
39
-
40
- def get_redeploy_command():
41
- return redeploy_command