Documentation
¶
Index ¶
- func Build(yamlFile, tmplName, baseDir, outputDir string) error
- func BuildAll(yamlFile, baseDir, outputDir string) error
- func CopyFile(src, dst string) error
- func RunAllTemplateTests(buildFile, rayVersion string, nightly bool) error
- func RunProbe(tmplName, buildFile string) error
- func RunTemplateTest(tmplName, buildFile, rayVersion string, nightly bool) error
- type AnyscaleCLI
- type CloudInfo
- type ClusterEnv
- type ClusterEnvBYOD
- type ComputeConfigListItem
- type Template
- type TestConfig
- type WorkspaceState
- type WorkspaceTestConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶ added in v0.32.0
CopyFile copies the file at src to dst. The destination file is created or truncated.
func RunAllTemplateTests ¶ added in v0.32.0
func RunProbe ¶ added in v0.33.0
RunProbe launches a template into a workspace, runs tests if configured, and cleans up.
func RunTemplateTest ¶ added in v0.32.0
Types ¶
type AnyscaleCLI ¶ added in v0.32.0
type AnyscaleCLI struct {
// contains filtered or unexported fields
}
AnyscaleCLI provides methods for interacting with the Anyscale CLI.
func NewAnyscaleCLI ¶ added in v0.32.0
func NewAnyscaleCLI() *AnyscaleCLI
NewAnyscaleCLI creates a new AnyscaleCLI instance.
func (*AnyscaleCLI) CreateComputeConfig ¶ added in v0.32.0
func (ac *AnyscaleCLI) CreateComputeConfig(name, configFilePath string) error
CreateComputeConfig creates a new compute config from a YAML file if it doesn't already exist. If the config file uses the old format (head_node_type, worker_node_types), it will have the cloud added to it if missing. name: the name for the compute config (without version tag) configFilePath: path to the YAML config file
func (*AnyscaleCLI) GetDefaultCloud ¶ added in v0.32.0
func (ac *AnyscaleCLI) GetDefaultCloud() (*CloudInfo, error)
GetDefaultCloud retrieves the default cloud from the Anyscale CLI. Returns the cloud name and ID from the YAML output.
func (*AnyscaleCLI) ListComputeConfigs ¶ added in v0.32.0
func (ac *AnyscaleCLI) ListComputeConfigs(name *string) ([]ComputeConfigListItem, error)
ListComputeConfigs returns compute configs from "compute-config list --json". Returns an empty list when there are no results.
type ClusterEnv ¶
type ClusterEnv struct {
BuildID string `yaml:"build_id,omitempty" json:"build_id,omitempty"`
ImageURI string `yaml:"image_uri,omitempty" json:"image_uri,omitempty"`
// BYOD is the cluster environment for bring-your-own-docker clusters.
BYOD *ClusterEnvBYOD `yaml:"byod,omitempty" json:"byod,omitempty"`
}
ClusterEnv is the cluster environment for Anyscale clusters.
type ClusterEnvBYOD ¶
type ClusterEnvBYOD struct {
ContainerFile string `yaml:"containerfile" json:"containerfile"`
DockerImage string `yaml:"docker_image" json:"docker_image"`
RayVersion string `yaml:"ray_version,omitempty" json:"ray_version,omitempty"`
}
ClusterEnvBYOD is the cluster environment for BYOD clusters.
type ComputeConfigListItem ¶ added in v0.32.0
type ComputeConfigListItem struct {
ID string `json:"id"`
Name string `json:"name"`
CloudID string `json:"cloud_id"`
Version float64 `json:"version"`
CreatedAt string `json:"created_at"`
LastModifiedAt string `json:"last_modified_at"`
URL string `json:"url"`
}
ComputeConfigListItem represents one entry from "compute-config list --json" results.
type Template ¶
type Template struct {
Name string `yaml:"name" json:"name"`
Dir string `yaml:"dir" json:"dir"`
Emoji string `yaml:"emoji" json:"emoji"`
Title string `yaml:"title" json:"title"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
ClusterEnv *ClusterEnv `yaml:"cluster_env" json:"cluster_env"`
// A map of files for different compute platforms.
ComputeConfig map[string]string `yaml:"compute_config" json:"compute_config"`
// Test configuration for the template (optional).
Test *TestConfig `yaml:"test,omitempty" json:"test,omitempty"`
}
Template defines the definition of a workspace template.
type TestConfig ¶ added in v0.32.0
type TestConfig struct {
TimeoutInSec int `yaml:"timeout_in_sec,omitempty" json:"timeout_in_sec,omitempty"`
TestsPath string `yaml:"tests_path,omitempty" json:"tests_path,omitempty"`
Command string `yaml:"command" json:"command"`
}
TestConfig defines test configuration for a template.
type WorkspaceState ¶ added in v0.32.0
type WorkspaceState int
WorkspaceState represents the state of an Anyscale workspace.
const ( StateTerminated WorkspaceState = iota // workspace is stopped StateStarting // workspace is starting up StateRunning // workspace is ready )
func (WorkspaceState) String ¶ added in v0.32.0
func (ws WorkspaceState) String() string
String returns the Anyscale API name of the state (e.g., "RUNNING").
type WorkspaceTestConfig ¶ added in v0.32.0
type WorkspaceTestConfig struct {
// contains filtered or unexported fields
}
WorkspaceTestConfig contains all the details to test a workspace.
func (*WorkspaceTestConfig) Run ¶ added in v0.32.0
func (c *WorkspaceTestConfig) Run()
Run sets up a workspace using the configured launcher, runs tests, and cleans up. It sets c.errs and c.success.