chutes 0.5.2rc9__py3-none-any.whl → 0.5.2rc10__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 +1 -1
- chutes/cfsv_wrapper.py +8 -4
- chutes/entrypoint/run.py +3 -9
- {chutes-0.5.2rc9.dist-info → chutes-0.5.2rc10.dist-info}/METADATA +1 -1
- {chutes-0.5.2rc9.dist-info → chutes-0.5.2rc10.dist-info}/RECORD +9 -9
- {chutes-0.5.2rc9.dist-info → chutes-0.5.2rc10.dist-info}/LICENSE +0 -0
- {chutes-0.5.2rc9.dist-info → chutes-0.5.2rc10.dist-info}/WHEEL +0 -0
- {chutes-0.5.2rc9.dist-info → chutes-0.5.2rc10.dist-info}/entry_points.txt +0 -0
- {chutes-0.5.2rc9.dist-info → chutes-0.5.2rc10.dist-info}/top_level.txt +0 -0
chutes/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = "0.5.2.
|
|
1
|
+
version = "0.5.2.rc10"
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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":
|
|
140
|
+
return {"result": get_cfsv().version()}
|
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
|
|
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 =
|
|
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 =
|
|
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,9 +1,9 @@
|
|
|
1
1
|
chutes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
chutes/_version.py,sha256=
|
|
2
|
+
chutes/_version.py,sha256=13g4-aUp9sRrVO-TYslqufUj--hkUNGb9fWQGhrYYXw,23
|
|
3
3
|
chutes/cfsv,sha256=vkR_q3qB0hkD8Knv8rqqrb4A29y1muHW2-eNYZiuI-g,892932
|
|
4
4
|
chutes/cfsv_v2,sha256=fa8-WFqaNeD-BXcCayUjCvR0NNizcc6Ewd6vNmFjPc0,893296
|
|
5
5
|
chutes/cfsv_v3,sha256=Eg6Knim8qg_ig7y6zs238aLF2z1L3saLHtmUp2I-mZE,1197128
|
|
6
|
-
chutes/cfsv_wrapper.py,sha256=
|
|
6
|
+
chutes/cfsv_wrapper.py,sha256=qpzUuGkpt_8JDpUbSKvw06y_uFYYqAZ2LDsLZPGFwjY,4186
|
|
7
7
|
chutes/chutes-cfsv.so,sha256=fhglG-e1AvK8-0EpUtX3zEVdhdvjCkT559yTVqH8G9U,38896
|
|
8
8
|
chutes/chutes-inspecto.so,sha256=ywWZXE5VDUFgnLD2NSAsQJLXSlbWkB5jZFCVEKTZDv4,2309920
|
|
9
9
|
chutes/chutes-logintercept.so,sha256=3mYyj1_3Vc5g_2MLrEJPqnB5UiFMVkYy8Tw37BlRwDM,22424
|
|
@@ -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=
|
|
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.
|
|
77
|
-
chutes-0.5.
|
|
78
|
-
chutes-0.5.
|
|
79
|
-
chutes-0.5.
|
|
80
|
-
chutes-0.5.
|
|
81
|
-
chutes-0.5.
|
|
76
|
+
chutes-0.5.2rc10.dist-info/LICENSE,sha256=9qFhoY0O1XdKOczAAc7vcveZzk32-a0Wq2_diH_hAD8,1067
|
|
77
|
+
chutes-0.5.2rc10.dist-info/METADATA,sha256=12eiBRjcBc65wR0ZlAKO4NYOBSqTKrd974nBoveh45s,18790
|
|
78
|
+
chutes-0.5.2rc10.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
79
|
+
chutes-0.5.2rc10.dist-info/entry_points.txt,sha256=93PU_dKxEGA1hCGaabvRXO9WpyFgon6eqT4wIN91YAU,42
|
|
80
|
+
chutes-0.5.2rc10.dist-info/top_level.txt,sha256=oRxU-Kvd5BhaNbBQtqZCp9uzY0FrMBocoL0Q6kokxzA,7
|
|
81
|
+
chutes-0.5.2rc10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|