g8ufs

package module
v2.0.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 15 Imported by: 1

README

0-fs Build Status codecov

IMPORTANT: Due to issues with the fuse library, g8ufs should be built with golang v1.8.*. Newer versions of go will cause unexpected issues

0-fs is the fuse file system of Zero-OS.

0-fs can be mounted only using a relatively small meta data database (currently support RocksDB). On accessing the file it fetches the required file chunks from a remote store, and cache it locally. The idea of using this file system is to speed up container creation by just mounting the container root from any image metadata file (we call it a flist file) and once the container starts, it fetches only the required files from the remote store. So no need to clone large images locally.

Design

The fuse mount point is actually a unionfs mount of two layers:

  • RW (read-write) layer that is just an actual directory on the raw file system of your hard disk
  • RO (read-only) layer that is the actual fuse mount point. The read-only layer will download the files into a cache when they are opened for reading the first time

By merging those 2 layers on top of each other, (read-write on top) the merged mount point will expose a read-write file system where all file changes, and new files get written to the RW layer, while reading file operations will be forwarded to the underlaying read-only layer. Once a file is opened for writing (that is only available on the read-only layer) it will be copied (copy on write) to the read-write layer and afterwards all read and write operations will be handled directly by the RW layer.

Building

Make sure you have librocksdb v5.2.1 or higher.

godep restore
make

Mounting the file system

$ ./g8ufs -h
Usage of ./g8ufs:
  -backend string
    	Working directory of the filesystem (cache and others) (default "/tmp/backend")
  -debug
    	Print debug messages
  -meta string
    	Path to metadata database (rocksdb)
  -reset
    	Reset filesystem on mount
  -storage-url string
    	Storage url (default "ardb://hub.gig.tech:16379")

More

All documentation is in the /docs directory, including a table of contents.

In Getting Started with 0-fs you find the recommended path to quickly get up and running.

Owner

muhamadazmy

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Branch   = "{branch}"
	Revision = "{revision}"
	Dirty    = "{dirty}"
)

Functions

func Version

func Version() fmt.Stringer

Types

type Exec

type Exec func(name string, arg ...string) Starter

type G8ufs

type G8ufs struct {
	*rofs.Config
	// contains filtered or unexported fields
}

func Mount

func Mount(opt *Options) (*G8ufs, error)

Mount mounts fuse with given options, it blocks forever until unmount is called on the given mount point

func (*G8ufs) Unmount

func (fs *G8ufs) Unmount() error

func (*G8ufs) Wait

func (fs *G8ufs) Wait() error

Wait filesystem until it's unmounted.

type Options

type Options struct {
	//Backend (required) working directory where the filesystem keeps it's cache and others
	//will be created if doesn't exist
	Backend string
	//Cache location where downloaded files are gonna be kept (optional). If not provided
	//a cache directly will be created under the backend.
	Cache string
	//Mount (required) is the mount point
	Target string
	//MetaStore (optional), if not provided `Reset` flag will have no effect, and only the backend overlay
	//will be mount at target, allows *full* backups of the backend to be mounted.
	MetaStore meta.MetaStore
	//Storage (required) storage to download files from
	Storage storage.Storage
	//Reset if set, will wipe up the backend clean before mounting.
	Reset bool
}

type Starter

type Starter interface {
	Start() error
	Wait() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL