Repository navigation
Added sha256 checksum info in the compute worker logs for downloaded files - #2684
Conversation
|
Three remarks: Code optimizationThe submission file is read twice (SHA256, then MD5), using 4 KB chunks in pure Python, which is slow on large files. The worker is pinned to Python 3.13, so def file_checksums(filename, algorithms=("md5", "sha256")):
hashers = {a: hashlib.new(a) for a in algorithms}
with open(filename, "rb") as f:
for chunk in iter(lambda: f.read(1024 * 1024), b""):
for h in hashers.values():
h.update(chunk)
return {a: h.hexdigest() for a, h in hashers.items()}This also removes the duplication between md5() and sha256(). Cache and sizeCached bundles are re-hashed on every submission.
CommentsWording: |
|
Code optimization is done For the second remark, it is half wrong, the timer does not start in the Preperation phase (otherwise that would mean that downloading docker images and all those files also counts in the timeout, which is not the case currently) As for the wording, I have also fixed it to match |
f897e3f to
9bb5955
Compare
A brief description of the purpose of the changes contained in this PR.
Added sha256 checksum info in the compute worker logs for downloaded files
Checklist