Documentation ¶
Index ¶
- type Client
- func (c *Client) AddCompletedLayers(compressedLayerDigest string)
- func (c *Client) Close()
- func (c *Client) FindBaseImage(base, ref string) (img containerd.Image, err error)
- func (c *Client) GetFilesystemPath(cd string) string
- func (c *Client) GetFilesystemRoot() string
- func (c *Client) GetMountingPoint(ssId string) string
- func (c *Client) InitCLIServer() (err error)
- func (c *Client) InitSnapshotter() (err error)
- func (c *Client) LoadImage(manifest digest.Digest) (manager *Manager, err error)
- func (c *Client) Mount(ld digest.Digest, ssId string, sn *snapshots.Info) (mnt string, err error)
- func (c *Client) Notify(proxyCfg string, reference name.Reference) error
- func (c *Client) Ping(proxyCfg string) (int64, string, string, error)
- func (c *Client) PrepareManager(manifest digest.Digest) (err error)
- func (c *Client) PullImage(base containerd.Image, ref, platform, proxyCfg string, ready *chan bool) (img containerd.Image, closedReady bool, err error)
- func (c *Client) StartCLIServer()
- func (c *Client) StartSnapshotter()
- func (c *Client) Unmount(cd, sn string) error
- func (c *Client) UploadTraces(proxyCfg string, tc *fs.TraceCollection) error
- type Configuration
- type Manager
- func (m *Manager) CreateSnapshots(c *Client) (chainIds []digest.Digest, err error)
- func (m *Manager) Extract(r *io.ReadCloser) (err error)
- func (m *Manager) GetPathBySerial(serial int64) string
- func (m *Manager) GetPathByStack(stack int64) string
- func (m *Manager) Init(ctx context.Context, cfg *Configuration, ready bool, manifest *v1.Manifest, ...)
- func (m *Manager) LogTrace(stack int64, filename string, access, complete time.Time)
- func (m *Manager) LookUpFile(stack int64, filename string) fs.ReceivedFile
- func (m *Manager) NewStarlightFS(mount string, stack int64, options *fusefs.Options, debug bool) (f *fs.Instance, err error)
- func (m *Manager) PrepareDirectories(c *Client) error
- func (m *Manager) SetOptimizerOff() (duration time.Duration, err error)
- func (m *Manager) SetOptimizerOn(optimizeGroup string) (starTime time.Time, err error)
- func (m *Manager) String() string
- func (m *Manager) Teardown()
- type ProxyConfig
- type StarlightDaemonAPIServer
- func (s *StarlightDaemonAPIServer) AddProxyProfile(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error)
- func (s *StarlightDaemonAPIServer) GetVersion(ctx context.Context, req *pb.Request) (*pb.Version, error)
- func (s *StarlightDaemonAPIServer) NotifyProxy(ctx context.Context, req *pb.NotifyRequest) (*pb.NotifyResponse, error)
- func (s *StarlightDaemonAPIServer) PingTest(ctx context.Context, req *pb.PingRequest) (*pb.PingResponse, error)
- func (s *StarlightDaemonAPIServer) PullImage(ctx context.Context, ref *pb.ImageReference) (resp *pb.ImagePullResponse, err error)
- func (s *StarlightDaemonAPIServer) ReportTraces(ctx context.Context, req *pb.ReportTracesRequest) (*pb.ReportTracesResponse, error)
- func (s *StarlightDaemonAPIServer) SetOptimizer(ctx context.Context, req *pb.OptimizeRequest) (*pb.OptimizeResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddCompletedLayers ¶
func (*Client) FindBaseImage ¶
func (c *Client) FindBaseImage(base, ref string) (img containerd.Image, err error)
FindBaseImage find the closest available image for the requested image, if user appointed an image, then this function will be used for confirming the appointed image is available in the local storage
func (*Client) GetFilesystemPath ¶
func (*Client) GetFilesystemRoot ¶
func (*Client) GetMountingPoint ¶
func (*Client) InitCLIServer ¶
func (*Client) InitSnapshotter ¶
InitSnapshotter initializes the snapshotter service
func (*Client) LoadImage ¶
LoadImage loads image manifest from content store to the memory, if it is in memory, return manager directly.
This method should not use any snapshotter methods to avoid recursive lock. This method is similar to PullImage, but it only uses content store.
func (*Client) Mount ¶
Mount returns the mountpoint for the given snapshot - md: manifest digest - ld: uncompressed layer digest - ssId: snapshot id
func (*Client) PrepareManager ¶ added in v0.2.1
func (*Client) PullImage ¶
func (c *Client) PullImage(base containerd.Image, ref, platform, proxyCfg string, ready *chan bool) (img containerd.Image, closedReady bool, err error)
PullImage pulls an image from a registry and stores it in the content store it also stores the manager in memory. In case there exists another manager in memory, it removes it and re-pull the image
func (*Client) StartCLIServer ¶
func (c *Client) StartCLIServer()
func (*Client) StartSnapshotter ¶
func (c *Client) StartSnapshotter()
StartSnapshotter starts the snapshotter service, should be run in a goroutine
func (*Client) UploadTraces ¶
func (c *Client) UploadTraces(proxyCfg string, tc *fs.TraceCollection) error
type Configuration ¶
type Configuration struct { LogLevel string `json:"log_level"` ClientId string `json:"id"` // path to database Metadata string `json:"metadata"` // socket address Socket string `json:"socket"` DaemonType string `json:"daemon_type"` Daemon string `json:"daemon"` Containerd string `json:"containerd"` Namespace string `json:"default_namespace"` TracesDir string `json:"traces_dir"` // registry + proxy DefaultProxy string `json:"default_proxy"` FileSystemRoot string `json:"fs_root"` Proxies map[string]*ProxyConfig `json:"configs"` }
func LoadConfig ¶
func LoadConfig(cfgPath string) (c *Configuration, p string, n bool, error error)
func NewConfig ¶
func NewConfig() *Configuration
func (*Configuration) SaveConfig ¶
func (c *Configuration) SaveConfig() error
type Manager ¶
type Manager struct { receive.DeltaBundle // contains filtered or unexported fields }
Manager should be unmarshalled from a json file and then Populate() should be called to populate other fields
func (*Manager) CreateSnapshots ¶
CreateSnapshots for chainIds should unlock the managerMapLock before calling CreateSnapshot
func (*Manager) GetPathBySerial ¶ added in v0.2.1
func (*Manager) GetPathByStack ¶ added in v0.2.1
func (*Manager) Init ¶
func (m *Manager) Init(ctx context.Context, cfg *Configuration, ready bool, manifest *v1.Manifest, imageConfig *v1.Image, manifestDigest digest.Digest)
Init populates the manager with the necessary information and data structures. Use json.Unmarshal to unmarshal the json file from data storage into a Manager struct.
- ready: if set to false, we will then use Extract() to get the content of the file
- cfg: configuration of the client
- image, manifest, imageConfig: information about the image (maybe we don't need this)
do not change any outside state, only the manager itself
func (*Manager) LookUpFile ¶
func (m *Manager) LookUpFile(stack int64, filename string) fs.ReceivedFile
func (*Manager) NewStarlightFS ¶
func (m *Manager) NewStarlightFS(mount string, stack int64, options *fusefs.Options, debug bool) (f *fs.Instance, err error)
NewStarlightFS creates FUSE server and mount to provided mount directory
func (*Manager) PrepareDirectories ¶
func (*Manager) SetOptimizerOff ¶
func (*Manager) SetOptimizerOn ¶
type ProxyConfig ¶
type ProxyConfig struct { Protocol string `json:"protocol"` Address string `json:"address"` // Auth Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` }
func ParseProxyStrings ¶
func ParseProxyStrings(v string) (name string, c *ProxyConfig, err error)
type StarlightDaemonAPIServer ¶
type StarlightDaemonAPIServer struct { pb.UnimplementedDaemonServer // contains filtered or unexported fields }
func (*StarlightDaemonAPIServer) AddProxyProfile ¶
func (s *StarlightDaemonAPIServer) AddProxyProfile(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error)
func (*StarlightDaemonAPIServer) GetVersion ¶ added in v0.2.2
func (*StarlightDaemonAPIServer) NotifyProxy ¶ added in v0.2.1
func (s *StarlightDaemonAPIServer) NotifyProxy(ctx context.Context, req *pb.NotifyRequest) (*pb.NotifyResponse, error)
func (*StarlightDaemonAPIServer) PingTest ¶ added in v0.2.1
func (s *StarlightDaemonAPIServer) PingTest(ctx context.Context, req *pb.PingRequest) (*pb.PingResponse, error)
func (*StarlightDaemonAPIServer) PullImage ¶
func (s *StarlightDaemonAPIServer) PullImage(ctx context.Context, ref *pb.ImageReference) (resp *pb.ImagePullResponse, err error)
func (*StarlightDaemonAPIServer) ReportTraces ¶
func (s *StarlightDaemonAPIServer) ReportTraces(ctx context.Context, req *pb.ReportTracesRequest) (*pb.ReportTracesResponse, error)
func (*StarlightDaemonAPIServer) SetOptimizer ¶
func (s *StarlightDaemonAPIServer) SetOptimizer(ctx context.Context, req *pb.OptimizeRequest) (*pb.OptimizeResponse, error)