Documentation
¶
Index ¶
- Constants
- func DetectFsVersion(header []byte) (string, error)
- type BlobManager
- type Filesystem
- func (fs *Filesystem) BootstrapFile(id string) (string, error)
- func (fs *Filesystem) CacheUsage(ctx context.Context, blobDigest string) (snapshots.Usage, error)
- func (fs *Filesystem) Cleanup(ctx context.Context) error
- func (fs *Filesystem) CleanupBlobLayer(ctx context.Context, blobDigest string, async bool) error
- func (fs *Filesystem) IsNydusDataLayer(ctx context.Context, labels map[string]string) bool
- func (fs *Filesystem) IsNydusMetaLayer(ctx context.Context, labels map[string]string) bool
- func (fs *Filesystem) IsStargzDataLayer(ctx context.Context, labels map[string]string) (bool, string, string, *stargz.Blob)
- func (fs *Filesystem) MergeStargzMetaLayer(ctx context.Context, s storage.Snapshot) error
- func (fs *Filesystem) Mount(snapshotID string, labels map[string]string) (err error)
- func (fs *Filesystem) MountPoint(snapshotID string) (string, error)
- func (fs *Filesystem) NewDaemonConfig(labels map[string]string, snapshotID string) (config.DaemonConfig, error)
- func (fs *Filesystem) PrepareBlobLayer(ctx context.Context, snapshot storage.Snapshot, labels map[string]string) error
- func (fs *Filesystem) PrepareStargzMetaLayer(ctx context.Context, blob *stargz.Blob, ref, layerDigest string, ...) error
- func (fs *Filesystem) RemoveCache(blobDigest string) error
- func (fs *Filesystem) StargzEnabled() bool
- func (fs *Filesystem) StargzLayer(labels map[string]string) bool
- func (fs *Filesystem) Umount(ctx context.Context, mountPoint string) error
- func (fs *Filesystem) WaitUntilReady(snapshotID string) error
- type ImageMode
- type Mode
- type NewFSOpt
- func WithCacheManager(cm *cache.Manager) NewFSOpt
- func WithDaemonConfig(cfg config.DaemonConfig) NewFSOpt
- func WithDaemonMode(daemonMode string) NewFSOpt
- func WithEnableStargz(enable bool) NewFSOpt
- func WithFsDriver(fsDriver string) NewFSOpt
- func WithImageMode(cfg config.DaemonConfig) NewFSOpt
- func WithLogDir(dir string) NewFSOpt
- func WithLogLevel(logLevel string) NewFSOpt
- func WithLogToStdout(logToStdout bool) NewFSOpt
- func WithMeta(root string) NewFSOpt
- func WithNydusImageBinaryPath(p string) NewFSOpt
- func WithNydusdBinaryPath(p string, daemonMode string) NewFSOpt
- func WithNydusdThreadNum(nydusdThreadNum int) NewFSOpt
- func WithProcessManager(pm *process.Manager) NewFSOpt
- func WithVPCRegistry(vpcRegistry bool) NewFSOpt
- func WithVerifier(verifier *signature.Verifier) NewFSOpt
- type Resolver
Constants ¶
const ( RafsV5 string = "v5" RafsV6 string = "v6" RafsV5SuperVersion uint32 = 0x500 RafsV5SuperMagic uint32 = 0x5241_4653 RafsV6SuperMagic uint32 = 0xE0F5_E1E2 RafsV6SuperBlockSize uint32 = 1024 + 128 + 256 RafsV6SuperBlockOffset uint32 = 1024 RafsV6ChunkInfoOffset uint32 = 1024 + 128 + 24 BootstrapFile string = "image/image.boot" LegacyBootstrapFile string = "image.boot" DummyMountpoint string = "/dummy" )
const MaxSuperBlockSize = 8 * 1024
RafsV6 layout: 1k + SuperBlock(128) + SuperBlockExtener(256) RafsV5 layout: 8K superblock So we only need to read the MaxSuperBlockSize size to include both v5 and v6 superblocks
Variables ¶
This section is empty.
Functions ¶
func DetectFsVersion ¶ added in v0.3.0
Types ¶
type BlobManager ¶ added in v0.3.0
type BlobManager struct {
// contains filtered or unexported fields
}
func NewBlobManager ¶ added in v0.3.0
func NewBlobManager(blobDir string) *BlobManager
func (*BlobManager) GetBlobDir ¶ added in v0.3.0
func (b *BlobManager) GetBlobDir() string
type Filesystem ¶ added in v0.3.0
type Filesystem struct {
meta.FileSystemMeta
// contains filtered or unexported fields
}
func NewFileSystem ¶ added in v0.3.0
func NewFileSystem(ctx context.Context, opt ...NewFSOpt) (*Filesystem, error)
NewFileSystem initialize Filesystem instance TODO(chge): `Filesystem` abstraction is not suggestive. A snapshotter can mount many Rafs/Erofs file systems
func (*Filesystem) BootstrapFile ¶ added in v0.3.0
func (fs *Filesystem) BootstrapFile(id string) (string, error)
func (*Filesystem) CacheUsage ¶ added in v0.3.1
How much space the layer/blob cache filesystem is occupying The blob digest mush have `sha256:` prefixed, otherwise, throw errors.
func (*Filesystem) Cleanup ¶ added in v0.3.0
func (fs *Filesystem) Cleanup(ctx context.Context) error
func (*Filesystem) CleanupBlobLayer ¶ added in v0.3.0
func (*Filesystem) IsNydusDataLayer ¶ added in v0.3.0
func (*Filesystem) IsNydusMetaLayer ¶ added in v0.3.0
func (*Filesystem) IsStargzDataLayer ¶ added in v0.3.0
func (*Filesystem) MergeStargzMetaLayer ¶ added in v0.3.0
func (*Filesystem) Mount ¶ added in v0.3.0
func (fs *Filesystem) Mount(snapshotID string, labels map[string]string) (err error)
Mount will be called when containerd snapshotter prepare remote snapshotter this method will fork nydus daemon and manage it in the internal store, and indexed by snapshotID
func (*Filesystem) MountPoint ¶ added in v0.3.0
func (fs *Filesystem) MountPoint(snapshotID string) (string, error)
func (*Filesystem) NewDaemonConfig ¶ added in v0.3.0
func (fs *Filesystem) NewDaemonConfig(labels map[string]string, snapshotID string) (config.DaemonConfig, error)
func (*Filesystem) PrepareBlobLayer ¶ added in v0.3.0
func (fs *Filesystem) PrepareBlobLayer(ctx context.Context, snapshot storage.Snapshot, labels map[string]string) error
Download blobs and bootstrap in nydus-snapshotter for preheating container image usage. It has to enable blobs manager when start nydus-snapshotter
func (*Filesystem) PrepareStargzMetaLayer ¶ added in v0.3.0
func (*Filesystem) RemoveCache ¶ added in v0.3.3
func (fs *Filesystem) RemoveCache(blobDigest string) error
func (*Filesystem) StargzEnabled ¶ added in v0.3.0
func (fs *Filesystem) StargzEnabled() bool
func (*Filesystem) StargzLayer ¶ added in v0.3.0
func (fs *Filesystem) StargzLayer(labels map[string]string) bool
func (*Filesystem) Umount ¶ added in v0.3.0
func (fs *Filesystem) Umount(ctx context.Context, mountPoint string) error
func (*Filesystem) WaitUntilReady ¶ added in v0.3.0
func (fs *Filesystem) WaitUntilReady(snapshotID string) error
WaitUntilReady wait until daemon ready by snapshotID, it will wait until nydus domain socket established and the status of nydusd daemon must be ready
type Mode ¶
type Mode int
const ( SharedInstance Mode = iota // One container image one nydusd topology MultiInstance // Nydusd is not needed to work as FUSE server (fusedev) or other fs drivers, // just provide the mount slices to containerd via API `Mounts` in mount options, // and do real mount by other components. NoneInstance // Nydusd does not fulfill any lazy-load (on-daemon) ability but only // prefetches image data into local blob cache for other components PrefetchInstance )
type NewFSOpt ¶ added in v0.3.0
type NewFSOpt func(d *Filesystem) error
func WithCacheManager ¶ added in v0.3.0
func WithDaemonConfig ¶ added in v0.3.0
func WithDaemonConfig(cfg config.DaemonConfig) NewFSOpt
func WithDaemonMode ¶ added in v0.3.0
func WithEnableStargz ¶ added in v0.3.0
func WithFsDriver ¶ added in v0.3.0
func WithImageMode ¶ added in v0.3.0
func WithImageMode(cfg config.DaemonConfig) NewFSOpt
func WithLogDir ¶ added in v0.3.0
func WithLogLevel ¶ added in v0.3.0
func WithLogToStdout ¶ added in v0.3.0
func WithNydusImageBinaryPath ¶ added in v0.3.0
func WithNydusdBinaryPath ¶ added in v0.3.0
func WithNydusdThreadNum ¶ added in v0.3.0
func WithProcessManager ¶ added in v0.3.0
func WithVPCRegistry ¶ added in v0.3.0
func WithVerifier ¶ added in v0.3.0
type Resolver ¶ added in v0.3.0
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶ added in v0.3.0
func NewResolver() *Resolver