PyKubeGrader 0.3.2__py3-none-any.whl → 0.3.3__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.
- {PyKubeGrader-0.3.2.dist-info → PyKubeGrader-0.3.3.dist-info}/METADATA +1 -1
- {PyKubeGrader-0.3.2.dist-info → PyKubeGrader-0.3.3.dist-info}/RECORD +7 -7
- pykubegrader/telemetry.py +50 -0
- {PyKubeGrader-0.3.2.dist-info → PyKubeGrader-0.3.3.dist-info}/LICENSE.txt +0 -0
- {PyKubeGrader-0.3.2.dist-info → PyKubeGrader-0.3.3.dist-info}/WHEEL +0 -0
- {PyKubeGrader-0.3.2.dist-info → PyKubeGrader-0.3.3.dist-info}/entry_points.txt +0 -0
- {PyKubeGrader-0.3.2.dist-info → PyKubeGrader-0.3.3.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
pykubegrader/__init__.py,sha256=AoAkdfIjDDZGWLlsIRENNq06L9h46kDGBIE8vRmsCfg,311
|
2
2
|
pykubegrader/grading_tester.ipynb,sha256=2c1JgnV-zgP405Q3rlEkOlMJPm_9Qga0Z0MVWpFk5No,18531
|
3
3
|
pykubegrader/initialize.py,sha256=Bwu1q18l18FB9lGppvt-L41D5gzr3S8t6zC0_UbrASw,3994
|
4
|
-
pykubegrader/telemetry.py,sha256=
|
4
|
+
pykubegrader/telemetry.py,sha256=2xNo2r4uhjNBIWfZBHviARgxE81t_tL4yaVMEZJoPyQ,7928
|
5
5
|
pykubegrader/utils.py,sha256=jlJklKvRhY3O7Hz2aaU1m0y3p_n9eMAXNnAF7LUEaPY,1275
|
6
6
|
pykubegrader/validate.py,sha256=OKnItGyd-L8QPKcsE0KRuwBI_IxKiJzMLJKZiA2j3II,11184
|
7
7
|
pykubegrader/build/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
@@ -31,9 +31,9 @@ pykubegrader/widgets_base/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-
|
|
31
31
|
pykubegrader/widgets_base/multi_select.py,sha256=JgjhHQJL8Pf0-1T_wdZCecAK1IgVJrZBCbR6b3jvDtk,4181
|
32
32
|
pykubegrader/widgets_base/reading.py,sha256=ChUS3NOTa_HLtNpxR8hGX80LPKMvYMypnR6dFknfxus,5430
|
33
33
|
pykubegrader/widgets_base/select.py,sha256=tEDg7GEjsZnz1646YTthTeamujVRS5jDJWMsXhmOQbI,2705
|
34
|
-
PyKubeGrader-0.3.
|
35
|
-
PyKubeGrader-0.3.
|
36
|
-
PyKubeGrader-0.3.
|
37
|
-
PyKubeGrader-0.3.
|
38
|
-
PyKubeGrader-0.3.
|
39
|
-
PyKubeGrader-0.3.
|
34
|
+
PyKubeGrader-0.3.3.dist-info/LICENSE.txt,sha256=YTp-Ewc8Kems8PJEE27KnBPFnZSxoWvSg7nnknzPyYw,1546
|
35
|
+
PyKubeGrader-0.3.3.dist-info/METADATA,sha256=7d5qLOoTobGzMNyp0D8s2uKq1gRrL0bQowsGcOqFJSg,2806
|
36
|
+
PyKubeGrader-0.3.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
37
|
+
PyKubeGrader-0.3.3.dist-info/entry_points.txt,sha256=BbLXpFZObpOXA8e3p3GcFkL-sHdUnDLUcnYmc6zx3NI,201
|
38
|
+
PyKubeGrader-0.3.3.dist-info/top_level.txt,sha256=e550Klfze6higFxER1V62fnGOcIgiKRbsrl9CC4UdtQ,13
|
39
|
+
PyKubeGrader-0.3.3.dist-info/RECORD,,
|
pykubegrader/telemetry.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import base64
|
2
2
|
import datetime
|
3
|
+
import gzip
|
3
4
|
import json
|
4
5
|
import logging
|
5
6
|
import os
|
@@ -233,3 +234,52 @@ def get_my_grades() -> pd.DataFrame:
|
|
233
234
|
sorted_vertical_df = vertical_df.sort_index()
|
234
235
|
|
235
236
|
return sorted_vertical_df
|
237
|
+
|
238
|
+
|
239
|
+
#
|
240
|
+
# Code execution log testing
|
241
|
+
#
|
242
|
+
|
243
|
+
|
244
|
+
def upload_execution_log() -> None:
|
245
|
+
if not student_user or not student_pw or not api_base_url:
|
246
|
+
raise ValueError("Necessary environment variables not set")
|
247
|
+
|
248
|
+
responses = ensure_responses()
|
249
|
+
student_email: str = responses["jhub_user"]
|
250
|
+
assignment: str = responses["assignment"]
|
251
|
+
if not student_email or not assignment:
|
252
|
+
raise ValueError("Missing student email and/or assignment name")
|
253
|
+
|
254
|
+
print(f"Student: {student_email}")
|
255
|
+
print(f"Assignment: {assignment}")
|
256
|
+
print("Uploading code execution log...")
|
257
|
+
|
258
|
+
try:
|
259
|
+
with open(".output_code.log", "rb") as f:
|
260
|
+
log_bytes = f.read()
|
261
|
+
except FileNotFoundError:
|
262
|
+
raise FileNotFoundError("Code execution log not found")
|
263
|
+
|
264
|
+
print(f"Uncompressed log size: {len(log_bytes)} bytes")
|
265
|
+
|
266
|
+
compressed = gzip.compress(log_bytes)
|
267
|
+
|
268
|
+
print(f"Compressed log size: {len(compressed)} bytes")
|
269
|
+
|
270
|
+
encoded = base64.b64encode(compressed).decode("utf-8")
|
271
|
+
|
272
|
+
payload = {
|
273
|
+
"student_email": student_email,
|
274
|
+
"assignment": assignment,
|
275
|
+
"encrypted_content": encoded,
|
276
|
+
}
|
277
|
+
|
278
|
+
res = requests.post(
|
279
|
+
url=api_base_url.rstrip("/") + "/execution-logs",
|
280
|
+
json=payload,
|
281
|
+
auth=HTTPBasicAuth(student_user, student_pw),
|
282
|
+
)
|
283
|
+
res.raise_for_status()
|
284
|
+
|
285
|
+
print("Execution log uploaded successfully")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|