client

package
v0.3.45 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const MaxJobsPerRequest = 200

Variables

This section is empty.

Functions

func AddArmadaApiConnectionCommandlineArgs

func AddArmadaApiConnectionCommandlineArgs(rootCmd *cobra.Command)

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 added in v0.1.28

func AddClientIds(jobs []*api.JobSubmitRequestItem)

func CreateApiConnection

func CreateApiConnection(config *ApiConnectionDetails, additionalDialOptions ...grpc.DialOption) (*grpc.ClientConn, error)

func CreateApiConnectionWithCallOptions added in v0.2.14

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 DeleteQueue added in v0.1.14

func DeleteQueue(submitClient api.SubmitClient, name string) error

func GetJobSetState added in v0.1.4

func GetJobSetState(client api.EventClient, queue, jobSetId string, context context.Context, errorOnNotExists bool, forceNew bool, forceLegacy bool) *domain.WatchContext

func GetKubectlCommand added in v0.1.4

func GetKubectlCommand(cluster string, namespace string, jobId string, podNumber int, cmd string) string

func LoadClientConfig added in v0.2.13

func LoadClientConfig(configPath string) (*armadaClientConfig, error)

LoadClientConfig reads in config from the file at configPath, or, if configPath is the empty string, from $HOME/.armada/config, and from environment variables, using viper.

func LoadCommandlineArgs added in v0.2.14

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

func LoadCommandlineArgsFromConfigFile(cfgFile string) error

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 NewThreadSafeStringSlice added in v0.1.8

func NewThreadSafeStringSlice() *threadSafeStringSlice

func SubmitJobs

func SubmitJobs(submitClient api.SubmitClient, request *api.JobSubmitRequest) (*api.JobSubmitResponse, error)

func UpdateQueue added in v0.2.3

func UpdateQueue(submitClient api.SubmitClient, queue *api.Queue) error

func WatchJobSet

func WatchJobSet(
	client api.EventClient,
	queue, jobSetId string,
	waitForNew bool,
	errorOnNotExists bool,
	forceNew bool,
	forceLegacy bool,
	context context.Context,
	onUpdate func(*domain.WatchContext, api.Event) bool,
) *domain.WatchContext

func WatchJobSetWithJobIdsFilter

func WatchJobSetWithJobIdsFilter(
	client api.EventClient,
	queue, jobSetId string,
	waitForNew bool,
	errorOnNotExists bool,
	forceNew bool,
	forceLegacy bool,
	jobIds []string,
	context context.Context,
	onUpdate func(*domain.WatchContext, api.Event) bool,
) *domain.WatchContext

func WithConnection

func WithConnection(apiConnectionDetails *ApiConnectionDetails, action func(*grpc.ClientConn) error) error

func WithEventClient added in v0.3.15

func WithEventClient(apiConnectionDetails *ApiConnectionDetails, action func(api.EventClient) error) error

func WithSchedulerReportingClient added in v0.3.35

func WithSchedulerReportingClient(apiConnectionDetails *ApiConnectionDetails, action func(schedulerobjects.SchedulerReportingClient) error) error

func WithSubmitClient added in v0.3.15

func WithSubmitClient(apiConnectionDetails *ApiConnectionDetails, action func(api.SubmitClient) error) error

Types

type APIVersion added in v0.2.18

type APIVersion string
const (
	APIVersionV1 APIVersion = "armadaproject.io/v1beta1"
)

func NewAPIVersion added in v0.2.18

func NewAPIVersion(in string) (APIVersion, error)

func (*APIVersion) UnmarshalJSON added in v0.2.18

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
	KerberosAuth                kerberos.ClientConfig
	ForceNoTls                  bool
	ExecAuth                    exec.CommandDetails
}

func ExtractCommandlineArmadaApiConnectionDetails

func ExtractCommandlineArmadaApiConnectionDetails() *ApiConnectionDetails

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 added in v0.3.16

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 added in v0.2.11

type ConnectionDetails func() *ApiConnectionDetails

type LoadTester

type LoadTester interface {
	RunSubmissionTest(ctx context.Context, spec domain.LoadTestSpecification, watchEvents bool) *domain.WatchContext
}

type Resource added in v0.2.18

type Resource struct {
	Version APIVersion   `json:"apiVersion"`
	Kind    ResourceKind `json:"kind"`
}

type ResourceKind added in v0.2.18

type ResourceKind string
const (
	ResourceKindQueue ResourceKind = "Queue"
)

func NewResourceKind added in v0.2.18

func NewResourceKind(in string) (ResourceKind, error)

func (*ResourceKind) UnmarshalJSON added in v0.2.18

func (kind *ResourceKind) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
auth

Jump to

Keyboard shortcuts

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