utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func CreateCedanaConfig

func CreateCedanaConfig(path, username 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 SetConfigFile added in v1.0.0

func SetConfigFile(c string)

SetConfigFile overrides the path to the cedana config file

func Unzip

func Unzip(src, dest string) error

Types

type AWSConfig

type AWSConfig struct {
	AccessKeyID             string   `json:"access_key_id" mapstructure:"access_key_id"`
	SecretAccessKey         string   `json:"secret_access_key" mapstructure:"secret_access_key"`
	EnabledRegions          []string `json:"enabled_regions" mapstructure:"enabled_regions"`
	EnabledInstanceFamilies []string `json:"enabled_instance_families" mapstructure:"enabled_instance_families"`
}

type CedanaConfig

type CedanaConfig struct {
	CedanaManaged    bool             `json:"cedana_managed" mapstructure:"cedana_managed"`
	ManagedConfig    ManagedConfig    `json:"managed_config" mapstructure:"managed_config"`
	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"`
}

func InitCedanaConfig

func InitCedanaConfig() (*CedanaConfig, error)

type ManagedConfig added in v1.0.0

type ManagedConfig struct {
	MarketServiceUrl string `json:"market_service_url" mapstructure:"market_service_url"`
	Username         string `json:"username" mapstructure:"username"`
	UserID           string `json:"user_id" mapstructure:"user_id"`
	Password         string `json:"password" mapstructure:"password"`
	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"`
}

Jump to

Keyboard shortcuts

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