registry: Fixes to allow layer uploads above 5GB
As we need to copy a stream of the uploaded layer (random uuid) to a blobs/.../<digest> path, that might surpass the maximum size of a monolithic upload to R2 without using multipart uploads.
To circumvent this, we will calculate the digest from the uploaded path and compare. Then, we will create a reference in the original blobs/.../digest path pointing to the upload path.
Should fix #69
tests fail due to some random vitest stuff that ive yet to figure out. However, behavior looks ok to me from manual testing. Will fix tests tomorrow
This PR fix the 5GB size limit on my local tests ! Any update on this @gabivlj for merge soon ? Thank you !
Pull Requests #100 and #101 should be merged in this PR first before merging to main branch.
PS: The vitest error cmme from the direct import of import sha256Wasm from "@taylorzane/hash-wasm/wasm/sha256.wasm": https://github.com/cloudflare/serverless-registry/blob/b7403912288a4361582b6600b99448ba133e912f/src/registry/r2.ts#L37
But i'm not sure how to fix it properly.