utils

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidProviders = []string{
	"aws",
	"gcp",
	"azure",
	"paperspace",
	"local",
}

Functions

func BuildClientConfig

func BuildClientConfig(jobFile *cedana.JobFile) *core.Config

Used to passthrough cedana configuration to the daemon

func CreateCedanaConfig

func CreateCedanaConfig(path string) error

Used in bootstrap to create a placeholder config

func CreateSSHLogger

func CreateSSHLogger()

a separate logger for SSH stdout/stderr, for finer control on output.

func GenerateJWT

func GenerateJWT(id string, skey string) (*string, error)

func GetLogger

func GetLogger() zerolog.Logger

func Unzip

func Unzip(src, dest string) error

Types

type AWSConfig

type AWSConfig struct {
	SSHKeyPath              string   `json:"ssh_key_path" mapstructure:"ssh_key_path"` // path to AWS identity key
	EnabledRegions          []string `json:"enabled_regions" mapstructure:"enabled_regions"`
	EnabledInstanceFamilies []string `json:"enabled_instance_families" mapstructure:"enabled_instance_families"`
	LaunchTemplateName      string   `json:"launch_template" mapstructure:"launch_template"`
	ImageId                 string   `json:"image_id" mapstructure:"image_id"` // AMI image id
	User                    string   `json:"user" mapstructure:"user"`         // user if using a custom AMI
}

type CedanaConfig

type CedanaConfig struct {
	SelfServe        bool                `json:"self_serve" mapstructure:"self_serve"`
	EnabledProviders []string            `json:"enabled_providers" mapstructure:"enabled_providers"`
	KeepRunning      bool                `json:"keep_running" mapstructure:"keep_running"`
	AWSConfig        AWSConfig           `json:"aws" mapstructure:"aws"`
	PaperspaceConfig PaperspaceConfig    `json:"paperspace" mapstructure:"paperspace"`
	Checkpoint       Checkpoint          `json:"checkpoint" mapstructure:"checkpoint"`
	SharedStorage    SharedStorageConfig `json:"shared_storage" mapstructure:"shared_storage"`
	Connection       Connection          `json:"connection" mapstructure:"connection"`
}

func InitCedanaConfig

func InitCedanaConfig() (*CedanaConfig, error)

type Checkpoint

type Checkpoint struct {
	HeartbeatEnabled  bool `json:"heartbeat_enabled" mapstructure:"heartbeat_enabled"`
	HeartbeatInterval int  `json:"heartbeat_interval_seconds" mapstructure:"heartbeat_interval_seconds"`
}

type Connection

type Connection struct {
	NATSUrl   string `json:"nats_url" mapstructure:"nats_url"`
	NATSPort  int    `json:"nats_port" mapstructure:"nats_port"`
	AuthToken string `json:"auth_token" mapstructure:"auth_token"`
}

type PaperspaceConfig

type PaperspaceConfig struct {
	APIKey         string   `json:"api_key" mapstructure:"api_key"`
	SSHKeyPath     string   `json:"ssh_key_path" mapstructure:"ssh_key_path"`
	EnabledRegions []string `json:"enabled_regions" mapstructure:"enabled_regions"`
	TemplateId     string   `json:"template_id" mapstructure:"template_id"`
	User           string   `json:"user" mapstructure:"user"`
}

type SharedStorageConfig

type SharedStorageConfig struct {
	DumpStorageDir string `json:"dump_storage_dir" mapstructure:"dump_storage_dir"`
	MountPoint     string `json:"mount_point" mapstructure:"mount_point"`
}

Jump to

Keyboard shortcuts

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