Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Rothberg <[email protected]>
  • Loading branch information
vrothberg committed Apr 23, 2019
1 parent a4bad17 commit 6292b23
Show file tree
Hide file tree
Showing 48 changed files with 6,424 additions and 309 deletions.
11 changes: 6 additions & 5 deletions pkg/blobcache/blobcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/containers/image/docker/reference"
"github.com/containers/image/image"
"github.com/containers/image/manifest"
"github.com/containers/image/pkg/progress"
"github.com/containers/image/transports"
"github.com/containers/image/types"
"github.com/containers/storage/pkg/archive"
Expand Down Expand Up @@ -416,7 +417,7 @@ func (s *blobCacheDestination) HasThreadSafePutBlob() bool {
return s.destination.HasThreadSafePutBlob()
}

func (d *blobCacheDestination) PutBlob(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, layerIndexInImage int, cache types.BlobInfoCache, isConfig bool) (types.BlobInfo, error) {
func (d *blobCacheDestination) PutBlob(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, layerIndexInImage int, cache types.BlobInfoCache, isConfig bool, bar *progress.Bar) (types.BlobInfo, error) {
var tempfile *os.File
var err error
var n int
Expand Down Expand Up @@ -479,7 +480,7 @@ func (d *blobCacheDestination) PutBlob(ctx context.Context, stream io.Reader, in
}
}
}
newBlobInfo, err := d.destination.PutBlob(ctx, stream, inputInfo, layerIndexInImage, cache, isConfig)
newBlobInfo, err := d.destination.PutBlob(ctx, stream, inputInfo, layerIndexInImage, cache, isConfig, bar)
if err != nil {
return newBlobInfo, errors.Wrapf(err, "error storing blob to image destination for cache %q", transports.ImageName(d.reference))
}
Expand All @@ -491,8 +492,8 @@ func (d *blobCacheDestination) PutBlob(ctx context.Context, stream io.Reader, in
return newBlobInfo, nil
}

func (d *blobCacheDestination) TryReusingBlob(ctx context.Context, info types.BlobInfo, layerIndexInImage int, cache types.BlobInfoCache, canSubstitute bool) (bool, types.BlobInfo, error) {
present, reusedInfo, err := d.destination.TryReusingBlob(ctx, info, layerIndexInImage, cache, canSubstitute)
func (d *blobCacheDestination) TryReusingBlob(ctx context.Context, info types.BlobInfo, layerIndexInImage int, cache types.BlobInfoCache, canSubstitute bool, bar *progress.Bar) (bool, types.BlobInfo, error) {
present, reusedInfo, err := d.destination.TryReusingBlob(ctx, info, layerIndexInImage, cache, canSubstitute, bar)
if err != nil || present {
return present, reusedInfo, err
}
Expand All @@ -502,7 +503,7 @@ func (d *blobCacheDestination) TryReusingBlob(ctx context.Context, info types.Bl
f, err := os.Open(filename)
if err == nil {
defer f.Close()
uploadedInfo, err := d.destination.PutBlob(ctx, f, info, layerIndexInImage, cache, isConfig)
uploadedInfo, err := d.destination.PutBlob(ctx, f, info, layerIndexInImage, cache, isConfig, bar)
if err != nil {
return false, types.BlobInfo{}, err
}
Expand Down
3 changes: 2 additions & 1 deletion vendor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ github.com/BurntSushi/toml v0.2.0
github.com/containerd/continuity 004b46473808b3e7a4a3049c20e4376c91eb966d
github.com/containernetworking/cni v0.7.0-rc2
github.com/containers/image commit https://github.com/vrothberg/image
github.com/vbauerster/mpb v3.3.4
github.com/etcd-io/bbolt v1.3.2
github.com/vbauerster/mpb v3.4.0
github.com/mattn/go-isatty v0.0.4
github.com/VividCortex/ewma v1.1.1
github.com/boltdb/bolt v1.3.1
Expand Down
20 changes: 20 additions & 0 deletions vendor/github.com/etcd-io/bbolt/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6292b23

Please sign in to comment.