Chunked layer upload appears to be broken, responds with the first chunk uploaded over and over again
DEBUG org.apache.http.headers - http-outgoing-10 << HTTP/1.1 202 Accepted
DEBUG org.apache.http.headers - http-outgoing-10 << Content-Length: 0
DEBUG org.apache.http.headers - http-outgoing-10 << Content-Type: application/json
DEBUG org.apache.http.headers - http-outgoing-10 << docker-distribution-api-version: registry/2.0
DEBUG org.apache.http.headers - http-outgoing-10 << range: 0-33
For example, range on github is perpetually responding with 0-<content-length>
, whereas gitlab and local docker registry respond with 0-<total length sent>
.
I’ve found two cases in which chunked uploads on github do succeed; one where all of the data is uploaded in the final put and no patchs are sent or if all the data is sent in a patch, and then completed with an empty put (simple change to the for loop). Multiple patchs is where I start hitting troubles with github.
Current branch I’m testing against Comparing GoogleContainerTools:master...Sineaggi:chunked-uploads · GoogleContainerTools/jib · GitHub
The code as-is works for gitlab and a local registry (running in docker).
Note that the 34 byte chunk size is arbitrary, I’m uploading small layers to I used small chunk sizes.
Here’s an example chunk request/response
DEBUG org.apache.http.headers - http-outgoing-10 >> PATCH /v2/sineaggi/busybox/blobs/upload/cdbf883e-3ac5-44b2-a6e5-7f1395a2683f HTTP/1.1
DEBUG org.apache.http.headers - http-outgoing-10 >> Accept:
DEBUG org.apache.http.headers - http-outgoing-10 >> Accept-Encoding: gzip
DEBUG org.apache.http.headers - http-outgoing-10 >> Authorization: Bearer -------
DEBUG org.apache.http.headers - http-outgoing-10 >> Content-Range: 49-74
DEBUG org.apache.http.headers - http-outgoing-10 >> User-Agent: jib null jib-core Google-HTTP-Java-Client/1.38.1 (gzip)
DEBUG org.apache.http.headers - http-outgoing-10 >> Content-Length: 26
DEBUG org.apache.http.headers - http-outgoing-10 >> Content-Type: application/octet-stream
DEBUG org.apache.http.headers - http-outgoing-10 >> Host: ghcr.io
DEBUG org.apache.http.headers - http-outgoing-10 >> Connection: Keep-Alive
DEBUG org.apache.http.headers - http-outgoing-10 << HTTP/1.1 202 Accepted
DEBUG org.apache.http.headers - http-outgoing-10 << Content-Length: 0
DEBUG org.apache.http.headers - http-outgoing-10 << Content-Type: application/json
DEBUG org.apache.http.headers - http-outgoing-10 << docker-distribution-api-version: registry/2.0
DEBUG org.apache.http.headers - http-outgoing-10 << docker-upload-uuid: cdbf883e-3ac5-44b2-a6e5-7f1395a2683f
DEBUG org.apache.http.headers - http-outgoing-10 << Location: /v2/sineaggi/busybox/blobs/upload/cdbf883e-3ac5-44b2-a6e5-7f1395a2683f
DEBUG org.apache.http.headers - http-outgoing-10 << range: 0-25
DEBUG org.apache.http.headers - http-outgoing-10 << Date: Mon, 02 Aug 2021 18:16:52 GMT
DEBUG org.apache.http.headers - http-outgoing-10 << X-GitHub-Request-Id: 0B20:19A0:7C33:FDEB:61083694