Documentation
¶
Index ¶
- Constants
- type ByAccessTime
- type ByAccessTimeOptimized
- type Entry
- type FsEntry
- func (fe *FsEntry) AtomicGetFileState() int8
- func (fe *FsEntry) AtomicGetRealPath() string
- func (fe *FsEntry) AtomicSetFileState(from, to int8) bool
- func (fe *FsEntry) Children() *map[string]TocEntry
- func (fe *FsEntry) GetAttrFromEntry(out *fuse.Attr) syscall.Errno
- func (fe *FsEntry) GetAttrFromFs(st *syscall.Stat_t) syscall.Errno
- func (fe *FsEntry) GetChildren() *map[string]TocEntry
- func (fe *FsEntry) GetFileMode() uint32
- func (fe *FsEntry) GetParent() *FsEntry
- func (fe *FsEntry) GetRoLayerPath() string
- func (fe *FsEntry) GetRwLayerPath() string
- func (fe *FsEntry) GetStableAttr() *fuseFs.StableAttr
- func (fe *FsEntry) IsRoot() bool
- func (fe *FsEntry) LookUp(base string) (*FsEntry, bool)
- func (fe *FsEntry) Promote() syscall.Errno
- func (fe *FsEntry) RemoveChild(baseName string)
- type FsInstance
- func (fi *FsInstance) GetImageName() string
- func (fi *FsInstance) GetImageTag() string
- func (fi *FsInstance) GetMountPoint() string
- func (fi *FsInstance) GetRwLayerHash() digest.Digest
- func (fi *FsInstance) GetRwLayerPath() string
- func (fi *FsInstance) GetRwTraceableBlobDigest() util.TraceableBlobDigest
- func (fi *FsInstance) GetServer() *fuse.Server
- func (fi *FsInstance) NewFuseServer(dir string, options *fs.Options, debug bool) (*fuse.Server, error)
- func (fi *FsInstance) SetOptimizerOn(optimizeGroup string) (err error)
- func (fi *FsInstance) Teardown() error
- type LandmarkEntry
- type LayerMeta
- type LayerStore
- func (s *LayerStore) FindLayer(digest util.TraceableBlobDigest) (*LayerMeta, error)
- func (s *LayerStore) GetWorkDir() string
- func (s *LayerStore) RegisterLayer(digest util.TraceableBlobDigest, writable, complete bool) (*LayerMeta, error)
- func (s *LayerStore) RegisterLayerWithAbsolutePath(digest util.TraceableBlobDigest, lay *LayerMeta) (*LayerMeta, error)
- func (s *LayerStore) RegisterLayerWithPath(digest util.TraceableBlobDigest, lay *LayerMeta) (*LayerMeta, error)
- func (s *LayerStore) RegisterLayerWithPrefix(prefix string, count int, digest util.TraceableBlobDigest, ...) (*LayerMeta, error)
- func (s *LayerStore) RemoveLayer(digest util.TraceableBlobDigest, removeFile bool) error
- type OptimizedGroup
- type OptimizedTraceItem
- type Receiver
- type StarlightFsNode
- func (n *StarlightFsNode) Create(ctx context.Context, name string, flags uint32, mode uint32, ...) (*fs.Inode, fs.FileHandle, uint32, syscall.Errno)
- func (n *StarlightFsNode) FileReadyWait()
- func (n *StarlightFsNode) Fsync(ctx context.Context, f fs.FileHandle, flags uint32) syscall.Errno
- func (n *StarlightFsNode) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno
- func (n *StarlightFsNode) Getxattr(ctx context.Context, attr string, dest []byte) (uint32, syscall.Errno)
- func (n *StarlightFsNode) Link(ctx context.Context, target fs.InodeEmbedder, name string, out *fuse.EntryOut) (node *fs.Inode, errno syscall.Errno)
- func (n *StarlightFsNode) Listxattr(ctx context.Context, dest []byte) (uint32, syscall.Errno)
- func (n *StarlightFsNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (n *StarlightFsNode) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (n *StarlightFsNode) Mknod(ctx context.Context, name string, mode, rdev uint32, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (n *StarlightFsNode) Open(ctx context.Context, flags uint32) (fs.FileHandle, uint32, syscall.Errno)
- func (n *StarlightFsNode) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)
- func (n *StarlightFsNode) Readlink(ctx context.Context) ([]byte, syscall.Errno)
- func (n *StarlightFsNode) Removexattr(ctx context.Context, attr string) syscall.Errno
- func (n *StarlightFsNode) Rename(ctx context.Context, name string, newParent fs.InodeEmbedder, newName string, ...) syscall.Errno
- func (n *StarlightFsNode) Rmdir(ctx context.Context, name string) syscall.Errno
- func (n *StarlightFsNode) Setattr(ctx context.Context, fh fs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno
- func (n *StarlightFsNode) Setxattr(ctx context.Context, attr string, data []byte, flags uint32) syscall.Errno
- func (n *StarlightFsNode) Statfs(ctx context.Context, out *fuse.StatfsOut) syscall.Errno
- func (n *StarlightFsNode) Symlink(ctx context.Context, target, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (n *StarlightFsNode) Unlink(ctx context.Context, name string) syscall.Errno
- type TemplateEntry
- type TocEntry
- type TraceCollection
- type TraceItem
- type Tracer
Constants ¶
const ( EnEmpty = int8(0) EnPartial = int8(1) // Planning not to implemented EnRoLayer = int8(2) EnRwLayer = int8(3) )
const (
DebugTrace = false
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByAccessTime ¶
type ByAccessTime []*TraceItem
////////////////////////
func (ByAccessTime) Len ¶
func (b ByAccessTime) Len() int
func (ByAccessTime) Less ¶
func (b ByAccessTime) Less(i, j int) bool
func (ByAccessTime) Swap ¶
func (b ByAccessTime) Swap(i, j int)
type ByAccessTimeOptimized ¶
type ByAccessTimeOptimized []*OptimizedTraceItem
////////////////////////
func (ByAccessTimeOptimized) Len ¶
func (bo ByAccessTimeOptimized) Len() int
func (ByAccessTimeOptimized) Less ¶
func (bo ByAccessTimeOptimized) Less(i, j int) bool
func (ByAccessTimeOptimized) Swap ¶
func (bo ByAccessTimeOptimized) Swap(i, j int)
type Entry ¶
type Entry struct {
*util.TraceableEntry
State int8
// contains filtered or unexported fields
}
--------------------------------------------------------------------------------------- Entry
func (*Entry) GetInterface ¶
type FsEntry ¶
--------------------------------------------------------------------------------------- FsEntry
func NewFsEntry ¶
func NewFsEntry(fi *FsInstance, t *TemplateEntry) *FsEntry
func (*FsEntry) AtomicGetFileState ¶
func (*FsEntry) AtomicGetRealPath ¶
AtomicGetRealPath returns the absolute path in the real file system be aware that this method will lock StateMu
func (*FsEntry) AtomicSetFileState ¶
func (*FsEntry) GetAttrFromEntry ¶
GetAttrFromEntry converts stargz's TOCEntry to go-fuse's Attr. From estargz
func (*FsEntry) GetChildren ¶
func (*FsEntry) GetFileMode ¶
func (*FsEntry) GetRoLayerPath ¶
GetRoLayerPath returns the absolute path to the RO layer in the real file system this method will NOT lock StateMu
func (*FsEntry) GetRwLayerPath ¶
GetRwLayerPath returns the absolute path to the RW layer in the real file system this method will NOT lock StateMu
func (*FsEntry) GetStableAttr ¶
func (fe *FsEntry) GetStableAttr() *fuseFs.StableAttr
func (*FsEntry) RemoveChild ¶
type FsInstance ¶
type FsInstance struct {
Root *FsEntry
// contains filtered or unexported fields
}
FsInstance should be created using
func (*FsInstance) GetImageName ¶
func (fi *FsInstance) GetImageName() string
func (*FsInstance) GetImageTag ¶
func (fi *FsInstance) GetImageTag() string
func (*FsInstance) GetMountPoint ¶
func (fi *FsInstance) GetMountPoint() string
func (*FsInstance) GetRwLayerHash ¶
func (fi *FsInstance) GetRwLayerHash() digest.Digest
func (*FsInstance) GetRwLayerPath ¶
func (fi *FsInstance) GetRwLayerPath() string
func (*FsInstance) GetRwTraceableBlobDigest ¶
func (fi *FsInstance) GetRwTraceableBlobDigest() util.TraceableBlobDigest
func (*FsInstance) GetServer ¶
func (fi *FsInstance) GetServer() *fuse.Server
func (*FsInstance) NewFuseServer ¶
func (*FsInstance) SetOptimizerOn ¶
func (fi *FsInstance) SetOptimizerOn(optimizeGroup string) (err error)
func (*FsInstance) Teardown ¶
func (fi *FsInstance) Teardown() error
Teardown unmounts the file system and close the logging file if there is one writing
type LandmarkEntry ¶
type LandmarkEntry struct {
// contains filtered or unexported fields
}
func (*LandmarkEntry) AddChild ¶
func (le *LandmarkEntry) AddChild(base string, entry TocEntry)
func (*LandmarkEntry) GetEntry ¶
func (le *LandmarkEntry) GetEntry() *Entry
func (*LandmarkEntry) GetInterface ¶
func (le *LandmarkEntry) GetInterface() TocEntry
func (*LandmarkEntry) String ¶
func (le *LandmarkEntry) String() string
type LayerMeta ¶
type LayerMeta struct {
// contains filtered or unexported fields
}
func NewLayerMeta ¶
func (*LayerMeta) AtomicIsComplete ¶
func (*LayerMeta) AtomicSetCompleted ¶
func (*LayerMeta) GetAbsPath ¶
func (*LayerMeta) IsWritable ¶
type LayerStore ¶
type LayerStore struct {
// contains filtered or unexported fields
}
func NewLayerStore ¶
func (*LayerStore) FindLayer ¶
func (s *LayerStore) FindLayer(digest util.TraceableBlobDigest) (*LayerMeta, error)
func (*LayerStore) GetWorkDir ¶
func (s *LayerStore) GetWorkDir() string
func (*LayerStore) RegisterLayer ¶
func (s *LayerStore) RegisterLayer(digest util.TraceableBlobDigest, writable, complete bool) (*LayerMeta, error)
func (*LayerStore) RegisterLayerWithAbsolutePath ¶
func (s *LayerStore) RegisterLayerWithAbsolutePath(digest util.TraceableBlobDigest, lay *LayerMeta) (*LayerMeta, error)
func (*LayerStore) RegisterLayerWithPath ¶
func (s *LayerStore) RegisterLayerWithPath(digest util.TraceableBlobDigest, lay *LayerMeta) (*LayerMeta, error)
func (*LayerStore) RegisterLayerWithPrefix ¶
func (s *LayerStore) RegisterLayerWithPrefix(prefix string, count int, digest util.TraceableBlobDigest, writable, complete bool) (*LayerMeta, error)
func (*LayerStore) RemoveLayer ¶
func (s *LayerStore) RemoveLayer(digest util.TraceableBlobDigest, removeFile bool) error
type OptimizedGroup ¶
type OptimizedGroup struct {
History []*OptimizedTraceItem `json:"h"`
Images []*util.ImageRef `json:"i"`
}
type OptimizedTraceItem ¶
OptimizedTraceItem with ranking
func (OptimizedTraceItem) Key ¶
func (oti OptimizedTraceItem) Key() string
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
func NewReceiver ¶
func NewReceiver(ctx context.Context, layerStore *LayerStore, reader io.Reader, headerOffset int64, prefix string, cb func()) (*Receiver, error)
NewReceiver reads image from reader and save it to layerStore
- ctx: context - layerStore: stores the layers - reader: image reader - tocOffset: size of the TOC in reader - prefix: to store the layers in one single folder (snapshot id)
func NewReceiverFromFile ¶
func (*Receiver) ExtractFiles ¶
func (r *Receiver) ExtractFiles()
func (*Receiver) GetLayerMounts ¶
func (*Receiver) NewFsInstance ¶
func (r *Receiver) NewFsInstance(imageName, imageTag, snapshotId string, optimize bool, optimizeGroup string) (*FsInstance, error)
/////////////////////////////////////////////////////////////// NewFsInstance creates new file system instance, - imageName, imageTag should be available in ImageReader. imageLookupMap - snapshotId is the absolute path will be created to hold the rw layer and the mounting point. - checkpoint is the starting point for the image reader - optimize determines whether the file system should collect access traces for optimization
type StarlightFsNode ¶
type StarlightFsNode struct {
//I is a pointer to fs.Inode
fs.Inode
// Ent is a pointer to delta.FsEntry via delta.TocEntry interface
Ent *FsEntry
}
func (*StarlightFsNode) FileReadyWait ¶
func (n *StarlightFsNode) FileReadyWait()
func (*StarlightFsNode) Fsync ¶
func (n *StarlightFsNode) Fsync(ctx context.Context, f fs.FileHandle, flags uint32) syscall.Errno
func (*StarlightFsNode) Getattr ¶
func (n *StarlightFsNode) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno
func (*StarlightFsNode) Open ¶
func (n *StarlightFsNode) Open(ctx context.Context, flags uint32) (fs.FileHandle, uint32, syscall.Errno)
func (*StarlightFsNode) Removexattr ¶
func (*StarlightFsNode) Rename ¶
func (n *StarlightFsNode) Rename(ctx context.Context, name string, newParent fs.InodeEmbedder, newName string, flags uint32) syscall.Errno
type TemplateEntry ¶
type TemplateEntry struct {
Entry
}
--------------------------------------------------------------------------------------- TemplateEntry
func (*TemplateEntry) DeepCopy ¶
func (t *TemplateEntry) DeepCopy(fi *FsInstance) *FsEntry
type TocEntry ¶
type TocEntry interface {
GetInterface() TocEntry
GetEntry() *Entry
AddChild(base string, entry TocEntry)
String() string
}
--------------------------------------------------------------------------------------- TocEntry interface supports RootEntry and Entry
type TraceCollection ¶
type TraceCollection struct {
Groups []*OptimizedGroup
// contains filtered or unexported fields
}
func NewTraceCollection ¶
func NewTraceCollection(ctx context.Context, p string) (*TraceCollection, error)
func NewTraceCollectionFromBuffer ¶
func NewTraceCollectionFromBuffer(buf []byte) (*TraceCollection, error)
func (TraceCollection) ToJSONBuffer ¶
func (tc TraceCollection) ToJSONBuffer() []byte
type TraceItem ¶
type TraceItem struct {
FileName string `json:"f"`
Access time.Duration `json:"a"`
Wait time.Duration `json:"w"`
}
////////////////////////
type Tracer ¶
type Tracer struct {
// label could be the name of the application or the workload.
// Different workload might have
OptimizeGroup string `json:"group"`
Image util.ImageRef `json:"image"`
StartTime time.Time `json:"start"`
Seq []*TraceItem `json:"seq"`
// contains filtered or unexported fields
}
////////////////////////