Skip to content

Latest commit

 

History

History
80 lines (56 loc) · 3.68 KB

framework.md

File metadata and controls

80 lines (56 loc) · 3.68 KB

Use as a framework

satelit is a framework for the internal cloud. It has some components.

You can switch components to another backend that implemented interface.

switch components

NewSatelit() (code) in satelit/cmd/cmd.go return api.SatelitServer. api.SatelitServer has some implemented codes.

    return &api.SatelitServer{
		Europa:    targetds,
		IPAM:      ipamBackend,
		Datastore: ds,
		Ganymede:  libvirtBackend,
		Scheduler: schedulerBackend,
	}, nil

The component has interface in Go. So you can switch to another implement without change the original code of satelit.

e.g.) interface.go in europa

// Europa is interface of volume operation.
type Europa interface {
	CreateVolume(ctx context.Context, name uuid.UUID, capacityGB int) (*Volume, error)
	CreateVolumeFromImage(ctx context.Context, name uuid.UUID, capacityGB int, imageID uuid.UUID) (*Volume, error)
	DeleteVolume(ctx context.Context, id string) error
	ListVolume(ctx context.Context) ([]Volume, error)
	GetVolume(ctx context.Context, id string) (*Volume, error)
	AttachVolumeTeleskop(ctx context.Context, id string, hostname string) (int, string, error)
	AttachVolumeSatelit(ctx context.Context, id string, hostname string) (int, string, error)
	DetachVolume(ctx context.Context, id string) error
	GetImage(imageID uuid.UUID) (*BaseImage, error)
	ListImage() ([]BaseImage, error)
	UploadImage(ctx context.Context, image []byte, name, description string, imageSizeGB int) (*BaseImage, error)
	DeleteImage(ctx context.Context, id uuid.UUID) error
}

Components

Europa is a component of storage.

implemented backends:

Ganymede is a component of the virtual machine.

implemented backends:

  • libvirt
  • Memory (for testing only. do not operation virtual machine)

Datastore is a component of persistent data.

implemented backends:

Other Components

satelit has more components, but they depend on only datastore. So you can use it directly in many cases.

  • IPam: component of management network data
  • Scheduler: component of management resource in a hypervisor