Documentation ¶
Overview ¶
Package native implements driver
Index ¶
- type Config
- type Driver
- func (d *Driver) Allocate(def types.LabelDefinition, metadata map[string]any) (*types.Resource, error)
- func (d *Driver) AvailableCapacity(nodeUsage types.Resources, req types.LabelDefinition) int64
- func (d *Driver) Deallocate(res *types.Resource) error
- func (d *Driver) GetTask(name, options string) drivers.ResourceDriverTask
- func (*Driver) IsRemote() bool
- func (*Driver) Name() string
- func (d *Driver) Prepare(config []byte) error
- func (*Driver) Status(res *types.Resource) (string, error)
- func (*Driver) ValidateDefinition(def types.LabelDefinition) error
- type EnvData
- type Factory
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SuPath string `json:"su_path"` // Path to the su (login as user) binary SudoPath string `json:"sudo_path"` // Path to the sudo (privilege escalation) binary ShPath string `json:"sh_path"` // Path to the sh (simple user shell) binary TarPath string `json:"tar_path"` // Path to the tar (unpacking images) binary MountPath string `json:"mount_path"` // Path to the mount (list of mounted volumes) binary ChownPath string `json:"chown_path"` // Path to the chown (change file/dir ownership) binary ChmodPath string `json:"chmod_path"` // Path to the chmod (change file/dir access) binary KillallPath string `json:"killall_path"` // Path to the killall (send signals to multiple processes) binary RmPath string `json:"rm_path"` // Path to the rm (cleanup after execution) binary ImagesPath string `json:"images_path"` // Where to store/look the environment images WorkspacePath string `json:"workspace_path"` // Where to place the env disks DsclPath string `json:"dscl_path"` // Path to the dscl (macos user control) binary HdiutilPath string `json:"hdiutil_path"` // Path to the hdiutil (macos images create/mount/umount) binary MdutilPath string `json:"mdutil_path"` // Path to the mdutil (macos disable indexing for disks) binary CreatehomedirPath string `json:"createhomedir_path"` // Path to the createhomedir (macos create/prefill user directory) binary // 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) is also available, but you're going to put more load on the scheduler // Please be careful here - noone wants the workload 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 to auth in download operations DownloadPassword string `json:"download_password"` // The password will be used to auth in download operations }
Config - node driver configuration
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver implements drivers.ResourceDriver interface
func (*Driver) Allocate ¶
func (d *Driver) Allocate(def types.LabelDefinition, metadata map[string]any) (*types.Resource, error)
Allocate workload environment with the provided images
It automatically download the required images, unpack them and runs the workload. Using metadata to pass the env to the entry point of the image.
func (*Driver) AvailableCapacity ¶
AvailableCapacity allows Fish to ask the driver about it's capacity (free slots) of a specific definition
func (*Driver) Deallocate ¶
Deallocate the resource
func (*Driver) GetTask ¶
func (d *Driver) GetTask(name, options string) drivers.ResourceDriverTask
GetTask returns task struct by name
func (*Driver) IsRemote ¶
IsRemote needed to detect the out-of-node resources managed by this driver
func (*Driver) ValidateDefinition ¶
func (*Driver) ValidateDefinition(def types.LabelDefinition) error
ValidateDefinition checks LabelDefinition is ok
type EnvData ¶
EnvData is used to provide some data to the entry/metadata values which could contain templates
type Factory ¶ added in v0.7.3
type Factory struct{}
Factory implements drivers.ResourceDriverFactory interface
func (*Factory) NewResourceDriver ¶ added in v0.7.3
func (*Factory) NewResourceDriver() drivers.ResourceDriver
NewResourceDriver creates new resource driver
type Options ¶
type Options struct { Images []drivers.Image `json:"images"` // Optional list of image dependencies, they will be unpacked in order //TODO: Setup string `json:"setup"` // Optional path to the executable, it will be started before the Entry with escalated privileges Entry string `json:"entry"` // Optional path to the executable, it will be running as workload (default: init.sh / init.ps1) Groups []string `json:"groups"` // Optional user groups user should have, first one is primary (default: staff) }
Options for label definition
Example:
images: - url: https://artifact-storage/aquarium/image/native/macos-VERSION/macos-VERSION.tar.xz sum: sha256:1234567890abcdef1234567890abcdef1 tag: ws # The same as a name of disk in Label resource definition - url: https://artifact-storage/aquarium/image/native/macos_amd64-ci-VERSION/macos_amd64-ci-VERSION.tar.xz sum: sha256:1234567890abcdef1234567890abcdef2 tag: ws entry: "{{ .Disks.ws }}/init.sh" # CWD is user home groups: - staff - importantgroup