docker

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DockerPath string `json:"docker_path"` // '/Applications/Docker.app/Contents/Resources/bin/docker'

	IsRemote bool `json:"is_remote"` // In case the docker client does not use the local node resources

	ImagesPath    string `json:"images_path"`    // Where to look/store docker file images
	WorkspacePath string `json:"workspace_path"` // Where to place the disks

	// Alter allows you to control how much resources will be used:
	// * Negative (<0) value will alter the total resource count before provisioning so you will be
	//   able to save some resources for the host system (recommended -2 for CPU and -10 for RAM
	//   for disk caching)
	// * Positive (>0) value could also be available (but check it in your docker dist in advance)
	//   Please be careful here - noone wants the container to fail allocation because of that...
	CpuAlter int `json:"cpu_alter"` // 0 do nothing, <0 reduces number available CPUs, >0 increases it (dangerous)
	RamAlter int `json:"ram_alter"` // 0 do nothing, <0 reduces amount of available RAM (GB), >0 increases it (dangerous)

	// Overbook options allows tenants to reuse the resources
	// It will be used only when overbook is allowed by the tenants. It works by just adding those
	// amounts to the existing total before checking availability. For example if you have 16CPU
	// and want to run 2 tenants with requirement of 14 CPUs each - you can put 12 in CpuOverbook -
	// to have virtually 28 CPUs. 3rd will not be running because 2 tenants will eat all 28 virtual
	// CPUs. Same applies to the RamOverbook.
	CpuOverbook uint `json:"cpu_overbook"` // How much CPUs could be reused by multiple tenants
	RamOverbook uint `json:"ram_overbook"` // How much RAM (GB) could be reused by multiple tenants

	DownloadUser     string `json:"download_user"`     // The user will be used in download operations
	DownloadPassword string `json:"download_password"` // The password will be used in download operations
}

func (*Config) Apply

func (c *Config) Apply(config []byte) error

func (*Config) Validate

func (c *Config) Validate() (err error)

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Implements drivers.ResourceDriver interface

func (*Driver) Allocate

func (d *Driver) Allocate(def types.LabelDefinition, metadata map[string]any) (*types.Resource, error)

*

  • Allocate container out of the images *
  • It automatically download the required images, unpack them and runs the container.
  • Using metadata to create env file and pass it to the container.

func (*Driver) AvailableCapacity added in v0.6.0

func (d *Driver) AvailableCapacity(node_usage types.Resources, req types.LabelDefinition) int64

Allow Fish to ask the driver about it's capacity (free slots) of a specific definition

func (*Driver) Deallocate

func (d *Driver) Deallocate(res *types.Resource) error

func (*Driver) GetTask added in v0.6.0

func (d *Driver) GetTask(name, options string) drivers.ResourceDriverTask

func (*Driver) IsRemote added in v0.6.0

func (d *Driver) IsRemote() bool

func (*Driver) Name

func (d *Driver) Name() string

func (*Driver) Prepare

func (d *Driver) Prepare(config []byte) error

func (*Driver) Status

func (d *Driver) Status(res *types.Resource) (string, error)

func (*Driver) ValidateDefinition

func (d *Driver) ValidateDefinition(def types.LabelDefinition) error

type Options added in v0.6.0

type Options struct {
	Images []drivers.Image `json:"images"` // List of image dependencies, last one is running one
}

*

func (*Options) Apply added in v0.6.0

func (o *Options) Apply(options util.UnparsedJson) error

func (*Options) Validate added in v0.6.0

func (o *Options) Validate() error

Jump to

Keyboard shortcuts

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