Skip to content

Cache transfer #224

@AkihiroSuda

Description

@AkihiroSuda

Still WIP, but opened tentatively for adding this to 2017Q4 github project: https://github.com/moby/buildkit/projects/1

Will update the issue description next week.

// Ref is a reference to cacheable objects.                
type Ref interface {                                       
        ID() string                                        
        Release(context.Context) error                     
        Size(ctx context.Context) (int64, error)           
        Metadata() *metadata.StorageItem // TODO: remove                  
}                                                          

type ImmutableRef interface {                              
        Ref                                                
        Finalize(ctx context.Context) error // Make sure reference is flushed to driver                                
        // TODO: ImmutableMeta                             
}                                                          

type LocalImmutableRef interface {                         
        ImmutableRef                                       
        Mountable                                          
        Extractable                                        
        Parent() LocalImmutableRef                         
}                                                          

// no implementation yet            
// non-mountable                       
type RemoteImmutableRef interface {                        
        ImmutableRef                                       
        Extractable                                        
        // copies the whole cache                          
        Pull(ctx context.Context, something TBD) (LocalImmutableRef, error)                                                           
}                                                          

type MutableRef interface {                                
        Ref                                                
        Mountable                                          
        // TODO: MutableMeta                               
        Commit(context.Context) (LocalImmutableRef, error) 
}                                                          

type Mountable interface {                                 
        Mount(ctx context.Context, readonly bool) ([]mount.Mount, error)                                               
}                                                          

type Extractable interface {                               
        // extract files within the cache.                 
        // toPath is a local filesystem path.              
        // srcPaths are paths within the cache.            
        // used for CopyOp                                 
        Extract(ctx context.Context, toPath string, srcPath ...string) error                                           
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions