Documentation ¶
Index ¶
- type Client
- func (c *Client) AddCompletedLayers(compressedLayerDigest string)
- func (c *Client) Close()
- func (c *Client) FindBaseImage(ctr *containerd.Client, 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(ctr *containerd.Client, 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, insecure bool) error
- func (c *Client) Ping(proxyCfg string) (int64, string, string, error)
- func (c *Client) PrepareManager(namespace string, manifest digest.Digest) error
- func (c *Client) PullImage(ctr *containerd.Client, base containerd.Image, ref, platform, proxyCfg string, ...)
- func (c *Client) ScanExistingFilesystems()
- 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(ctr *containerd.Client, client *Client, ctx context.Context, ...)
- 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 PullFinishedMessage
- type StarlightDaemonAPIServer
- func (s *StarlightDaemonAPIServer) AddProxyProfile(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error)
- func (s *StarlightDaemonAPIServer) GetProxyProfiles(ctx context.Context, req *pb.Request) (resp *pb.GetProxyProfilesResponse, err 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(ctr *containerd.Client, 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 ¶
func (c *Client) LoadImage(ctr *containerd.Client, manifest digest.Digest) (manager *Manager, err error)
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( ctr *containerd.Client, base containerd.Image, ref, platform, proxyCfg string, ready *chan PullFinishedMessage, )
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) ScanExistingFilesystems ¶ added in v0.2.3
func (c *Client) ScanExistingFilesystems()
----------------------------------------------------------------------------- ScanExistingFilesystems scans place where the extracted file content is stored in case the file system has not extracted fully (without the `complete.json` file), we will remove the directory.
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(ctr *containerd.Client, client *Client, 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 PullFinishedMessage ¶ added in v0.2.6
type PullFinishedMessage struct {
// contains filtered or unexported fields
}
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) GetProxyProfiles ¶ added in v0.3.1
func (s *StarlightDaemonAPIServer) GetProxyProfiles(ctx context.Context, req *pb.Request) (resp *pb.GetProxyProfilesResponse, err 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)