Skip to content

Commit

Permalink
Feat: offloading bandwidth to client side for Pull operations
Browse files Browse the repository at this point in the history
Signed-off-by: guacamole <[email protected]>
  • Loading branch information
guacamole committed Nov 23, 2021
1 parent 6c2a752 commit 1e5b88a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
sleep 5
curl -XPOST -d ${{ secrets.OPENREGISTRY_SIGNUP_PAYLOAD }} "http://${IP}:5000/auth/signup"
- name: Run OCI Distribution Spec conformance tests
uses: opencontainers/distribution-spec@main
uses: opencontainers/distribution-spec@v1.0.1
env:
OCI_ROOT_URL: ${{ env.OCI_ROOT_URL }}
OCI_USERNAME: ${{ secrets.OPENREGISTRY_USERNAME }}
Expand Down
3 changes: 2 additions & 1 deletion registry/v2/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,11 @@ func (r *registry) PullLayer(ctx echo.Context) error {
}
}

_, ok := r.skynet.Metadata(layerRef.Skylink)
size, ok := r.skynet.Metadata(layerRef.Skylink)
if ok {
url := fmt.Sprintf("https://siasky.net/%s",
strings.Replace(layerRef.Skylink, "sia://", "", 1))
ctx.Response().Header().Set("Content-Length", fmt.Sprintf("%d", size))
http.Redirect(ctx.Response(), ctx.Request(), url, http.StatusTemporaryRedirect)
return nil
}
Expand Down
6 changes: 5 additions & 1 deletion telemetry/fluent-bit/fluent_bit.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ func New(config *config.RegistryConfig) (FluentBit, error) {

func (fb *fluentBit) Send(logBytes []byte) {
// don't send logs to grafana from local instances of OpenRegistry
if fb.config.Environment == config.Dev || fb.config.Environment == config.Local {
dev := fb.config.Environment == config.Dev
local := fb.config.Environment == config.Local
ci := fb.config.Environment == config.CI

if dev || local || ci {
return
}

Expand Down

0 comments on commit 1e5b88a

Please sign in to comment.