Documentation ¶
Index ¶
- Constants
- func AddArmadaApiConnectionCommandlineArgs(rootCmd *cobra.Command)
- func AddClientIds(jobs []*api.JobSubmitRequestItem)
- func CreateApiConnection(config *ApiConnectionDetails, additionalDialOptions ...grpc.DialOption) (*grpc.ClientConn, error)
- func CreateApiConnectionWithCallOptions(config *ApiConnectionDetails, additionalDefaultCallOptions []grpc.CallOption, ...) (*grpc.ClientConn, error)
- func CreateChunkedSubmitRequests(queue string, jobSetId string, jobs []*api.JobSubmitRequestItem) []*api.JobSubmitRequest
- func CreateQueue(submitClient api.SubmitClient, queue *api.Queue) error
- func CustomClientSubmitJobs(submitClient api.CustomSubmitClient, request *api.JobSubmitRequest) (*api.JobSubmitResponse, error)
- func DeleteQueue(submitClient api.SubmitClient, name string) error
- func ExtractConfigurationContexts() []string
- func GetJobSetState(client api.EventClient, queue, jobSetId string, context context.Context, ...) *domain.WatchContext
- func GetKubectlCommand(cluster string, namespace string, jobId string, podNumber int, cmd string) string
- func LoadCommandlineArgs() error
- func LoadCommandlineArgsFromConfigFile(cfgFile string) error
- func ModifyCurrentContextInConfig(cfgFilePath string, newContext string) error
- func NewThreadSafeStringSlice() *threadSafeStringSlice
- func SetDefaultContext(newContext string) error
- func SubmitJobs(submitClient api.SubmitClient, request *api.JobSubmitRequest) (*api.JobSubmitResponse, error)
- func UpdateQueue(submitClient api.SubmitClient, queue *api.Queue) error
- func WatchJobSet(client api.EventClient, queue, jobSetId string, waitForNew bool, ...) *domain.WatchContext
- func WatchJobSetWithJobIdsFilter(client api.EventClient, queue, jobSetId string, waitForNew bool, ...) *domain.WatchContext
- func WithConnection(apiConnectionDetails *ApiConnectionDetails, ...) error
- func WithEventClient(apiConnectionDetails *ApiConnectionDetails, action func(api.EventClient) error) error
- func WithSchedulerReportingClient(apiConnectionDetails *ApiConnectionDetails, ...) error
- func WithSubmitClient(apiConnectionDetails *ApiConnectionDetails, ...) error
- type APIVersion
- type ApiConnectionDetails
- type ArmadaLoadTester
- type ConnectionDetails
- type CtlConfig
- type LoadTester
- type Resource
- type ResourceKind
Constants ¶
const MaxJobsPerRequest = 200
Variables ¶
This section is empty.
Functions ¶
func AddArmadaApiConnectionCommandlineArgs ¶
AddArmadaApiConnectionCommandlineArgs adds command-line flags to a cobra command. Arguments given via these flags are later used by LoadCommandlineArgsFromConfigFile. Hence, apps that use the client package to load config should call this function as part of their initialization.
func AddClientIds ¶
func AddClientIds(jobs []*api.JobSubmitRequestItem)
func CreateApiConnection ¶
func CreateApiConnection(config *ApiConnectionDetails, additionalDialOptions ...grpc.DialOption) (*grpc.ClientConn, error)
func CreateApiConnectionWithCallOptions ¶
func CreateApiConnectionWithCallOptions( config *ApiConnectionDetails, additionalDefaultCallOptions []grpc.CallOption, additionalDialOptions ...grpc.DialOption, ) (*grpc.ClientConn, error)
func CreateChunkedSubmitRequests ¶
func CreateChunkedSubmitRequests(queue string, jobSetId string, jobs []*api.JobSubmitRequestItem) []*api.JobSubmitRequest
func CreateQueue ¶
func CreateQueue(submitClient api.SubmitClient, queue *api.Queue) error
func CustomClientSubmitJobs ¶ added in v0.4.8
func CustomClientSubmitJobs(submitClient api.CustomSubmitClient, request *api.JobSubmitRequest) (*api.JobSubmitResponse, error)
func DeleteQueue ¶
func DeleteQueue(submitClient api.SubmitClient, name string) error
func ExtractConfigurationContexts ¶ added in v0.4.40
func ExtractConfigurationContexts() []string
ExtractConfigurationContexts extracts all contexts from loaded viper state
func GetJobSetState ¶
func GetJobSetState(client api.EventClient, queue, jobSetId string, context context.Context, errorOnNotExists bool, forceNew bool, forceLegacy bool) *domain.WatchContext
func GetKubectlCommand ¶
func LoadCommandlineArgs ¶
func LoadCommandlineArgs() error
LoadCommandlineArgs loads armadactl config armadactl-defaults.yaml - From exePath, where exePath is the path to the armadactl executable armada config file - From cfgFile, set by the --config CLI flag, or defaulting to $HOME/.armadactl if not set These configs are then merged
func LoadCommandlineArgsFromConfigFile ¶
LoadCommandlineArgsFromConfigFile loads armadactl config armadactl-defaults.yaml - From exePath, where exePath is the path to the armadactl executable armada config file - From cfgFile or defaulting to $HOME/.armadactl These configs are then merged
func ModifyCurrentContextInConfig ¶ added in v0.4.40
ModifyCurrentContextInConfig reads the config file at the provided path, sets the currentContext to the provided value, and writes the config back into the file.
func NewThreadSafeStringSlice ¶
func NewThreadSafeStringSlice() *threadSafeStringSlice
func SetDefaultContext ¶ added in v0.4.40
SetDefaultContext sets the currentContext within the viper config. We return an error if the context doesn't exist in the set of existing contexts
func SubmitJobs ¶
func SubmitJobs(submitClient api.SubmitClient, request *api.JobSubmitRequest) (*api.JobSubmitResponse, error)
func UpdateQueue ¶
func UpdateQueue(submitClient api.SubmitClient, queue *api.Queue) error
func WatchJobSet ¶
func WithConnection ¶
func WithConnection(apiConnectionDetails *ApiConnectionDetails, action func(*grpc.ClientConn) error) error
func WithEventClient ¶
func WithEventClient(apiConnectionDetails *ApiConnectionDetails, action func(api.EventClient) error) error
func WithSchedulerReportingClient ¶
func WithSchedulerReportingClient(apiConnectionDetails *ApiConnectionDetails, action func(schedulerobjects.SchedulerReportingClient) error) error
func WithSubmitClient ¶
func WithSubmitClient(apiConnectionDetails *ApiConnectionDetails, action func(api.SubmitClient) error) error
Types ¶
type APIVersion ¶
type APIVersion string
const (
APIVersionV1 APIVersion = "armadaproject.io/v1beta1"
)
func NewAPIVersion ¶
func NewAPIVersion(in string) (APIVersion, error)
func (*APIVersion) UnmarshalJSON ¶
func (version *APIVersion) UnmarshalJSON(data []byte) error
type ApiConnectionDetails ¶
type ApiConnectionDetails struct { ArmadaUrl string ArmadaRestUrl string // Names of executor clusters as they appear in the local kubeconfig file. // Used by the test suite to download logs from pods running tests. ExecutorClusters []string // After a duration of this time, if the client doesn't see any activity it // pings the server to see if the transport is still alive. // If set below 10s, a minimum value of 10s is used instead. // The default value is infinity. GrpcKeepAliveTime time.Duration // After having pinged for keepalive check, the client waits for a duration // of Timeout and if no activity is seen even after that the connection is // closed. GrpcKeepAliveTimeout time.Duration // Authentication options. BasicAuth common.LoginCredentials KubernetesNativeAuth kubernetes.NativeAuthDetails OpenIdAuth oidc.PKCEDetails OpenIdDeviceAuth oidc.DeviceDetails OpenIdPasswordAuth oidc.ClientPasswordDetails OpenIdClientCredentialsAuth oidc.ClientCredentialsDetails OpenIdKubernetesAuth oidc.KubernetesDetails ForceNoTls bool ExecAuth exec.CommandDetails }
func ExtractCommandlineArmadaApiConnectionDetails ¶
func ExtractCommandlineArmadaApiConnectionDetails() (*ApiConnectionDetails, error)
ExtractCommandlineArmadaApiConnectionDetails extracts Armada server connection details from the config loaded into viper. Hence, this function must be called after loading config into viper, e.g., by calling LoadCommandlineArgsFromConfigFile.
func (*ApiConnectionDetails) ArmadaHealthCheck ¶
func (a *ApiConnectionDetails) ArmadaHealthCheck() (ok bool, err error)
ArmadaHealthCheck calls Armada Server /health endpoint.
Returns true if response status code is in range [200-399], otherwise returns false.
TODO: Shouldn't be a method on ApiConnectionDetails. TODO: Break this up into one function to get the status code and another to check if that's a healthy one.
type ArmadaLoadTester ¶
type ArmadaLoadTester struct {
// contains filtered or unexported fields
}
func NewArmadaLoadTester ¶
func NewArmadaLoadTester(connectionDetails *ApiConnectionDetails) *ArmadaLoadTester
func (ArmadaLoadTester) RunSubmissionTest ¶
func (apiLoadTester ArmadaLoadTester) RunSubmissionTest(ctx context.Context, spec domain.LoadTestSpecification, watchEvents bool) domain.LoadTestSummary
type ConnectionDetails ¶
type ConnectionDetails func() (*ApiConnectionDetails, error)
type CtlConfig ¶ added in v0.4.40
type CtlConfig struct { CurrentContext string `yaml:"currentContext"` Contexts map[string]interface{} `yaml:"contexts"` }
func ReadConfigFromPath ¶ added in v0.4.40
type LoadTester ¶
type LoadTester interface {
RunSubmissionTest(ctx context.Context, spec domain.LoadTestSpecification, watchEvents bool) *domain.WatchContext
}
type Resource ¶
type Resource struct { Version APIVersion `json:"apiVersion" yaml:"apiVersion"` Kind ResourceKind `json:"kind" yaml:"kind"` }
type ResourceKind ¶
type ResourceKind string
const (
ResourceKindQueue ResourceKind = "Queue"
)
func NewResourceKind ¶
func NewResourceKind(in string) (ResourceKind, error)
func (*ResourceKind) UnmarshalJSON ¶
func (kind *ResourceKind) UnmarshalJSON(data []byte) error