chutes 0.5.2rc9__py3-none-any.whl → 0.5.3rc0__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.
chutes/_version.py CHANGED
@@ -1 +1 @@
1
- version = "0.5.2.rc9"
1
+ version = "0.5.3.rc0"
chutes/cfsv_v3 CHANGED
Binary file
chutes/cfsv_wrapper.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import os
2
2
  import ctypes
3
3
  import asyncio
4
+ from functools import lru_cache
4
5
  from fastapi import Request
5
6
 
6
7
 
@@ -99,7 +100,10 @@ class CFSVWrapper:
99
100
  return None
100
101
 
101
102
 
102
- CFSV = CFSVWrapper()
103
+ @lru_cache(maxsize=1)
104
+ def get_cfsv():
105
+ """Lazily initialize CFSV wrapper (only works on Linux)."""
106
+ return CFSVWrapper()
103
107
 
104
108
 
105
109
  async def handle_challenge(request: Request):
@@ -109,7 +113,7 @@ async def handle_challenge(request: Request):
109
113
  exclude_path = request.state.decrypted.get("exclude_path", "/app/chute.py")
110
114
  result = await loop.run_in_executor(
111
115
  None,
112
- CFSV.challenge,
116
+ get_cfsv().challenge,
113
117
  salt,
114
118
  mode,
115
119
  "/",
@@ -125,7 +129,7 @@ async def handle_sizetest(request: Request):
125
129
  size_gib = request.state.decrypted.get("size_gib", 10)
126
130
  result = await loop.run_in_executor(
127
131
  None,
128
- CFSV.sizetest,
132
+ get_cfsv().sizetest,
129
133
  test_dir,
130
134
  size_gib,
131
135
  )
@@ -133,4 +137,4 @@ async def handle_sizetest(request: Request):
133
137
 
134
138
 
135
139
  async def handle_version(request: Request):
136
- return {"result": CFSV.version()}
140
+ return {"result": get_cfsv().version()}
chutes/chutes-cfsv.so CHANGED
Binary file
chutes/chutes-runint.so CHANGED
Binary file
chutes/entrypoint/run.py CHANGED
@@ -46,14 +46,13 @@ from chutes.entrypoint._shared import (
46
46
  from chutes.entrypoint.ssh import setup_ssh_access
47
47
  from chutes.chute import ChutePack, Job
48
48
  from chutes.util.context import is_local
49
- from chutes.cfsv_wrapper import CFSVWrapper
49
+ from chutes.cfsv_wrapper import get_cfsv
50
50
  from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
51
51
  from cryptography.hazmat.backends import default_backend
52
52
  from cryptography.hazmat.primitives import padding
53
53
 
54
54
 
55
55
  RUNINT_PATH = os.path.join(os.path.dirname(__file__), "..", "chutes-runint.so")
56
- CFSV_PATH = os.path.join(os.path.dirname(__file__), "..", "chutes-cfsv.so")
57
56
 
58
57
 
59
58
  class _ConnStats:
@@ -592,11 +591,6 @@ async def check_connectivity(request: Request) -> dict[str, Any]:
592
591
  }
593
592
 
594
593
 
595
- @lru_cache(maxsize=1)
596
- def get_cfsv_ref():
597
- return CFSVWrapper(lib_path=CFSV_PATH)
598
-
599
-
600
594
  async def generate_filesystem_hash(salt: str, exclude_file: str, mode: str = "full"):
601
595
  """
602
596
  Generate a hash of the filesystem, in either sparse or full mode.
@@ -605,7 +599,7 @@ async def generate_filesystem_hash(salt: str, exclude_file: str, mode: str = "fu
605
599
  f"Running filesystem verification challenge in {mode=} using {salt=} excluding {exclude_file}"
606
600
  )
607
601
  loop = asyncio.get_event_loop()
608
- cfsv = get_cfsv_ref()
602
+ cfsv = get_cfsv()
609
603
  fsv_hash = await loop.run_in_executor(
610
604
  None,
611
605
  cfsv.challenge,
@@ -969,7 +963,7 @@ async def _gather_devices_and_initialize(
969
963
  disk_gb = token_data.get("disk_gb", 10)
970
964
  logger.info(f"Checking disk space availability: {disk_gb}GB required")
971
965
  try:
972
- cfsv = get_cfsv_ref()
966
+ cfsv = get_cfsv()
973
967
  if not cfsv.sizetest("/tmp", disk_gb):
974
968
  logger.error("Disk space check failed")
975
969
  raise Exception(f"Insufficient disk space: {disk_gb}GB required in /tmp")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chutes
3
- Version: 0.5.2rc9
3
+ Version: 0.5.3rc0
4
4
  Summary: Chutes development kit and CLI.
5
5
  Home-page: https://github.com/rayonlabs/chutes
6
6
  Author: Jon Durbin
@@ -34,7 +34,7 @@ Requires-Dist: aiofiles>=23
34
34
  Requires-Dist: semver
35
35
  Requires-Dist: huggingface-hub
36
36
  Requires-Dist: setproctitle
37
- Requires-Dist: cllmv>=0.0.7
37
+ Requires-Dist: cllmv==0.1.0.rc0
38
38
  Provides-Extra: dev
39
39
  Requires-Dist: black; extra == "dev"
40
40
  Requires-Dist: flake8; extra == "dev"
@@ -1,14 +1,14 @@
1
1
  chutes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- chutes/_version.py,sha256=y_-w3Ob17ky5cD46Cx-O1Pw78VCPbvH5RIEdSFRrFXE,22
2
+ chutes/_version.py,sha256=SxMg5bY5DFPVSr-p9Xroq4lZBfQUANvHc6BCnrAuIDE,22
3
3
  chutes/cfsv,sha256=vkR_q3qB0hkD8Knv8rqqrb4A29y1muHW2-eNYZiuI-g,892932
4
4
  chutes/cfsv_v2,sha256=fa8-WFqaNeD-BXcCayUjCvR0NNizcc6Ewd6vNmFjPc0,893296
5
- chutes/cfsv_v3,sha256=Eg6Knim8qg_ig7y6zs238aLF2z1L3saLHtmUp2I-mZE,1197128
6
- chutes/cfsv_wrapper.py,sha256=rRCp5MlvW4-BcUiP6jd5qkw4hfGfYimkwZTfoqnWeyg,4030
7
- chutes/chutes-cfsv.so,sha256=fhglG-e1AvK8-0EpUtX3zEVdhdvjCkT559yTVqH8G9U,38896
5
+ chutes/cfsv_v3,sha256=SCtUWDjpeC7oQ3wkK0xRQXWLBlkx5kTiWoGDEECve2M,1198400
6
+ chutes/cfsv_wrapper.py,sha256=qpzUuGkpt_8JDpUbSKvw06y_uFYYqAZ2LDsLZPGFwjY,4186
7
+ chutes/chutes-cfsv.so,sha256=KGwC0ZSSbnyYZ1bJUt2DcrAvOQ-SUflupYlQKAM9Hd0,38896
8
8
  chutes/chutes-inspecto.so,sha256=ywWZXE5VDUFgnLD2NSAsQJLXSlbWkB5jZFCVEKTZDv4,2309920
9
9
  chutes/chutes-logintercept.so,sha256=3mYyj1_3Vc5g_2MLrEJPqnB5UiFMVkYy8Tw37BlRwDM,22424
10
10
  chutes/chutes-netnanny.so,sha256=1ZQn-Vdd8Lp8CV5dC6p5sz7u1gGrgtX4rDSejY2t2ec,179624
11
- chutes/chutes-runint.so,sha256=_0TN7m18P1DO-sSh1dg4OaJqA7D-CAizVfwwi6bX2I8,84120
11
+ chutes/chutes-runint.so,sha256=cjJVosu_1nP61l-RQNplqCnNI0BKiNz32r7kEyvkKtc,88216
12
12
  chutes/cli.py,sha256=Ga9Sk4bR2XDGNyfFgPm4Lk51Hk3Zw9Y8ZpJ2MwjHNDI,2011
13
13
  chutes/config.py,sha256=BQyCL-uDXwTxMx98OIihxI8SAT85-QLzjXWvftWkiBk,2777
14
14
  chutes/constants.py,sha256=PVQXULgXyzKpjBPaXIzZvvi3Q2-Cpf7uceoHn682knA,277
@@ -37,7 +37,7 @@ chutes/entrypoint/logger.py,sha256=MGfKmxni_4daAwFWb7JcSBDXTpmBJE8guACz2uYY6fE,9
37
37
  chutes/entrypoint/login.py,sha256=9d_MzS3ZQ884d4NAc8JGwvyNR6SaUazrpseOTAIhWNU,6076
38
38
  chutes/entrypoint/register.py,sha256=jHwZphEZCLpF4BRXT7iaieBZOvmpByCz25UQd804Kp0,9080
39
39
  chutes/entrypoint/report.py,sha256=-AeUFF8DFoaL14C8lAfVqd97aDH7fLDCzxZo-COYINg,1949
40
- chutes/entrypoint/run.py,sha256=33-RzPysOpWAInCjKEjoNY77Gjk-qCstuWZ-N48orsQ,59632
40
+ chutes/entrypoint/run.py,sha256=Z6YWjQ470xtfQAJByqqQL1rvL-0D4byWe4TRzZTjUJo,59458
41
41
  chutes/entrypoint/secret.py,sha256=_mtBXm_YL-nDg9XWmg2S4gGU_OdNBub_zb6jpLV7458,1581
42
42
  chutes/entrypoint/share.py,sha256=_1yIdIMwK5khxNZ8WApTRXx1htMi_dg1_VV7j1IVUjs,1532
43
43
  chutes/entrypoint/ssh.py,sha256=ryBRL_-bREyYpV_cZAhhZBFyIgvdWsNIIRwnM_sX41g,2285
@@ -73,9 +73,9 @@ chutes/util/context.py,sha256=_dHVEM6S6CYwgaxrA0yZCplSDA2HuiyNOmedSsyiDWA,355
73
73
  chutes/util/hf.py,sha256=2XKSqvy0j0QROZ5NagXf3JHyb1uk-NEL34E44ZhjF14,7083
74
74
  chutes/util/schema.py,sha256=b0NX-hWhc0FKnWD6FObBmQxINrJDFNocKsbGJn79D-8,6699
75
75
  chutes/util/user.py,sha256=WBx6vyw0P32wJ2GFYMjO5oQJPA3jn_XsyRglNJx0PhY,423
76
- chutes-0.5.2rc9.dist-info/LICENSE,sha256=9qFhoY0O1XdKOczAAc7vcveZzk32-a0Wq2_diH_hAD8,1067
77
- chutes-0.5.2rc9.dist-info/METADATA,sha256=bg-FwtxJv2FXYcMbfi_9U77GkY-oaaFt0Ue5n0iRGW4,18789
78
- chutes-0.5.2rc9.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
79
- chutes-0.5.2rc9.dist-info/entry_points.txt,sha256=93PU_dKxEGA1hCGaabvRXO9WpyFgon6eqT4wIN91YAU,42
80
- chutes-0.5.2rc9.dist-info/top_level.txt,sha256=oRxU-Kvd5BhaNbBQtqZCp9uzY0FrMBocoL0Q6kokxzA,7
81
- chutes-0.5.2rc9.dist-info/RECORD,,
76
+ chutes-0.5.3rc0.dist-info/LICENSE,sha256=9qFhoY0O1XdKOczAAc7vcveZzk32-a0Wq2_diH_hAD8,1067
77
+ chutes-0.5.3rc0.dist-info/METADATA,sha256=9W0HageRbtlSm65cyLYLHdLtgSEv8r3l1SzMzydDXkc,18793
78
+ chutes-0.5.3rc0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
79
+ chutes-0.5.3rc0.dist-info/entry_points.txt,sha256=93PU_dKxEGA1hCGaabvRXO9WpyFgon6eqT4wIN91YAU,42
80
+ chutes-0.5.3rc0.dist-info/top_level.txt,sha256=oRxU-Kvd5BhaNbBQtqZCp9uzY0FrMBocoL0Q6kokxzA,7
81
+ chutes-0.5.3rc0.dist-info/RECORD,,