From b2db8c98d7b17c96d53c28154739e624fe48a63d Mon Sep 17 00:00:00 2001 From: Anders Schwartz Date: Thu, 27 Jul 2023 19:23:21 -0400 Subject: [PATCH] feat: add `kurtosis cloud load to CLI` (#882) ## Description: In this PR we are adding the `kurtosis cloud load ` option that enables the user to load the config from the cloud and automatically switch the context. To use the command the user must export an API key to the env var: `KURTOSIS_CLOUD_API_KEY` ## Is this change user facing? YES ## References (if applicable): --- api/golang/engine/lib/cloud/cloud.go | 55 ++ .../lib/kurtosis_context/kurtosis_context.go | 2 +- .../instance_id_arg/instance_id_arg.go | 67 +++ .../command_str_consts/command_str_consts.go | 7 +- cli/cli/commands/cloud/cloud.go | 19 + cli/cli/commands/cloud/load/load.go | 133 +++++ cli/cli/commands/enclave/inspect/inspect.go | 2 +- cli/cli/commands/enclave/rm/rm.go | 2 +- cli/cli/commands/kurtosis_context/add/add.go | 16 +- .../kurtosis_context/context_switch/switch.go | 9 +- cli/cli/commands/kurtosis_context/rm/rm.go | 2 +- cli/cli/commands/root.go | 2 + cli/cli/go.mod | 4 +- cli/cli/go.sum | 4 +- .../config_overrides_deserializers.go | 1 + .../config_overrides_migrators.go | 1 + .../config_version_emptystructs.go | 1 + .../v2/kurtosis_cloud_config_v2.go | 16 + .../v2/kurtosis_config_v2.go | 1 + .../resolved_config/kurtosis_cloud_config.go | 7 + .../kurtosis_cluster_config.go | 2 +- .../kurtosis_cluster_config_test.go | 2 +- .../resolved_config/kurtosis_config.go | 43 ++ .../resolved_config/kurtosis_config_test.go | 27 +- cli/scripts/build.sh | 2 - cloud/api/golang/go.mod | 16 + cloud/api/golang/go.sum | 20 + .../kurtosis_backend_server_api.pb.go | 529 ++++++++++++++++++ .../kurtosis_backend_server_api_grpc.pb.go | 182 ++++++ cloud/api/golang/scripts/build.sh | 20 + .../kurtosis_backend_server_api.proto | 42 ++ cloud/api/scripts/build.sh | 32 ++ .../api/scripts/regenerate-proto-bindings.sh | 72 +++ cloud/api/supported-languages.txt | 2 + .../docker/docker_manager/docker_manager.go | 4 +- go.work | 1 + go.work.sum | 44 +- name_generator/go.sum | 11 + 38 files changed, 1375 insertions(+), 27 deletions(-) create mode 100644 api/golang/engine/lib/cloud/cloud.go create mode 100644 cli/cli/command_framework/highlevel/instance_id_arg/instance_id_arg.go create mode 100644 cli/cli/commands/cloud/cloud.go create mode 100644 cli/cli/commands/cloud/load/load.go create mode 100644 cli/cli/kurtosis_config/overrides_objects/v2/kurtosis_cloud_config_v2.go create mode 100644 cli/cli/kurtosis_config/resolved_config/kurtosis_cloud_config.go create mode 100644 cloud/api/golang/go.mod create mode 100644 cloud/api/golang/go.sum create mode 100644 cloud/api/golang/kurtosis_backend_server_rpc_api_bindings/kurtosis_backend_server_api.pb.go create mode 100644 cloud/api/golang/kurtosis_backend_server_rpc_api_bindings/kurtosis_backend_server_api_grpc.pb.go create mode 100755 cloud/api/golang/scripts/build.sh create mode 100644 cloud/api/protobuf/kurtosis_backend_server_api.proto create mode 100644 cloud/api/scripts/build.sh create mode 100755 cloud/api/scripts/regenerate-proto-bindings.sh create mode 100644 cloud/api/supported-languages.txt diff --git a/api/golang/engine/lib/cloud/cloud.go b/api/golang/engine/lib/cloud/cloud.go new file mode 100644 index 0000000000..c2a410afa0 --- /dev/null +++ b/api/golang/engine/lib/cloud/cloud.go @@ -0,0 +1,55 @@ +package cloud + +import ( + "crypto/tls" + "crypto/x509" + api "github.com/kurtosis-tech/kurtosis/cloud/api/golang/kurtosis_backend_server_rpc_api_bindings" + "github.com/kurtosis-tech/stacktrace" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +func CreateCloudClient(connectionStr string, caCertChain string) (api.KurtosisCloudBackendServerClient, error) { + caCertChainBytes := []byte(caCertChain) + p := x509.NewCertPool() + p.AppendCertsFromPEM(caCertChainBytes) + + tlsConfig := &tls.Config{ + Rand: nil, + Time: nil, + Certificates: nil, + NameToCertificate: nil, + GetCertificate: nil, + GetClientCertificate: nil, + GetConfigForClient: nil, + VerifyPeerCertificate: nil, + VerifyConnection: nil, + RootCAs: p, + NextProtos: nil, + ServerName: "", + ClientAuth: 0, + ClientCAs: nil, + InsecureSkipVerify: false, + CipherSuites: nil, + PreferServerCipherSuites: false, + SessionTicketsDisabled: false, + SessionTicketKey: [32]byte{}, + ClientSessionCache: nil, + MinVersion: 0, + MaxVersion: 0, + CurvePreferences: nil, + DynamicRecordSizingDisabled: false, + Renegotiation: 0, + KeyLogWriter: nil, + } + conn, err := grpc.Dial(connectionStr, grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig))) + if err != nil { + return nil, stacktrace.Propagate( + err, + "An error occurred creating a connection to the Kurtosis Cloud server at '%v'", + connectionStr, + ) + } + client := api.NewKurtosisCloudBackendServerClient(conn) + return client, nil +} diff --git a/api/golang/engine/lib/kurtosis_context/kurtosis_context.go b/api/golang/engine/lib/kurtosis_context/kurtosis_context.go index c00b36a800..af084f6f77 100644 --- a/api/golang/engine/lib/kurtosis_context/kurtosis_context.go +++ b/api/golang/engine/lib/kurtosis_context/kurtosis_context.go @@ -74,7 +74,7 @@ func NewKurtosisContextFromLocalEngine() (*KurtosisContext, error) { return nil, stacktrace.Propagate(err, "An error occurred validating the Kurtosis engine API version") } - // portal is still optional as it is incubating. For local context, everything will run fine if poral is not + // portal is still optional as it is incubating. For local context, everything will run fine if portal is not // present. For remote context, is it expected that the caller checks that the portal is present before or after // the Kurtosis Context is built, to avoid unexpected failures downstream portalClient, err := CreatePortalDaemonClient(portalIsRequired) diff --git a/cli/cli/command_framework/highlevel/instance_id_arg/instance_id_arg.go b/cli/cli/command_framework/highlevel/instance_id_arg/instance_id_arg.go new file mode 100644 index 0000000000..3e45a3f6ef --- /dev/null +++ b/cli/cli/command_framework/highlevel/instance_id_arg/instance_id_arg.go @@ -0,0 +1,67 @@ +package instance_id_arg + +import ( + "context" + "github.com/kurtosis-tech/kurtosis/cli/cli/command_framework/lowlevel/args" + "github.com/kurtosis-tech/kurtosis/cli/cli/command_framework/lowlevel/flags" + "github.com/kurtosis-tech/stacktrace" +) + +const ( + defaultIsRequired = true + defaultValueEmpty = "" + validInstanceIdLength = 32 +) + +// InstanceIdentifierArg pre-builds instance identifier arg which has tab-completion and validation ready out-of-the-box +func InstanceIdentifierArg( + // The arg key where this context identifier argument will be stored + argKey string, + isGreedy bool, +) *args.ArgConfig { + + validate := getValidationFunc(argKey, isGreedy) + + return &args.ArgConfig{ + Key: argKey, + IsOptional: defaultIsRequired, + DefaultValue: defaultValueEmpty, + IsGreedy: isGreedy, + ValidationFunc: validate, + ArgCompletionProvider: args.NewManualCompletionsProvider(getCompletionsFunc()), + } +} + +func getCompletionsFunc() func(ctx context.Context, flags *flags.ParsedFlags, previousArgs *args.ParsedArgs) ([]string, error) { + return func(ctx context.Context, flags *flags.ParsedFlags, previousArgs *args.ParsedArgs) ([]string, error) { + // TODO: Given the instance id and the API Key, we could potentially query the API for instance ids to + // auto complete the typing but those endpoints don't exist (yet). + return []string{}, nil + } +} + +func getValidationFunc(argKey string, isGreedy bool) func(context.Context, *flags.ParsedFlags, *args.ParsedArgs) error { + return func(ctx context.Context, flags *flags.ParsedFlags, args *args.ParsedArgs) error { + var instanceIdsToValidate []string + if isGreedy { + instanceID, err := args.GetGreedyArg(argKey) + if err != nil { + return stacktrace.Propagate(err, "Expected a value for greedy arg '%v' but didn't find one", argKey) + } + instanceIdsToValidate = instanceID + } else { + instanceID, err := args.GetNonGreedyArg(argKey) + if err != nil { + return stacktrace.Propagate(err, "Expected a value for non-greedy arg '%v' but didn't find one", argKey) + } + instanceIdsToValidate = []string{instanceID} + } + + for _, instanceIdToValidate := range instanceIdsToValidate { + if len(instanceIdToValidate) < validInstanceIdLength { + return stacktrace.NewError("Instance Id is not valid: %s", instanceIdsToValidate) + } + } + return nil + } +} diff --git a/cli/cli/command_str_consts/command_str_consts.go b/cli/cli/command_str_consts/command_str_consts.go index 17bb4b8cc1..926766bdb1 100644 --- a/cli/cli/command_str_consts/command_str_consts.go +++ b/cli/cli/command_str_consts/command_str_consts.go @@ -6,14 +6,15 @@ import ( "path" ) -// We put all the command strings here so that when we need to give users remediation instructions, we can give them the -// -// commands they need to run +// We put all the command strings here so that when we need to give users remediation instructions, +// we can give them the commands they need to run var KurtosisCmdStr = path.Base(os.Args[0]) const ( Analytics = "analytics" CleanCmdStr = "clean" + CloudCmdStr = "cloud" + CloudLoadCmdStr = "load" ClusterCmdStr = "cluster" ClusterSetCmdStr = "set" ClusterGetCmdStr = "get" diff --git a/cli/cli/commands/cloud/cloud.go b/cli/cli/commands/cloud/cloud.go new file mode 100644 index 0000000000..c770ec09d7 --- /dev/null +++ b/cli/cli/commands/cloud/cloud.go @@ -0,0 +1,19 @@ +package cloud + +import ( + "github.com/kurtosis-tech/kurtosis/cli/cli/command_str_consts" + "github.com/kurtosis-tech/kurtosis/cli/cli/commands/cloud/load" + "github.com/spf13/cobra" +) + +// CloudCmd Suppressing exhaustruct requirement because this struct has ~40 properties +// nolint: exhaustruct +var CloudCmd = &cobra.Command{ + Use: command_str_consts.CloudCmdStr, + Short: "Manage Kurtosis cloud instances", + RunE: nil, +} + +func init() { + CloudCmd.AddCommand(load.LoadCmd.MustGetCobraCommand()) +} diff --git a/cli/cli/commands/cloud/load/load.go b/cli/cli/commands/cloud/load/load.go new file mode 100644 index 0000000000..b9008638ba --- /dev/null +++ b/cli/cli/commands/cloud/load/load.go @@ -0,0 +1,133 @@ +package load + +import ( + "context" + "encoding/base64" + "fmt" + "github.com/kurtosis-tech/kurtosis/api/golang/engine/lib/cloud" + "github.com/kurtosis-tech/kurtosis/cli/cli/command_framework/highlevel/instance_id_arg" + "github.com/kurtosis-tech/kurtosis/cli/cli/command_framework/lowlevel" + "github.com/kurtosis-tech/kurtosis/cli/cli/command_framework/lowlevel/args" + "github.com/kurtosis-tech/kurtosis/cli/cli/command_framework/lowlevel/flags" + "github.com/kurtosis-tech/kurtosis/cli/cli/command_str_consts" + "github.com/kurtosis-tech/kurtosis/cli/cli/commands/kurtosis_context/add" + "github.com/kurtosis-tech/kurtosis/cli/cli/commands/kurtosis_context/context_switch" + "github.com/kurtosis-tech/kurtosis/cli/cli/kurtosis_config" + "github.com/kurtosis-tech/kurtosis/cli/cli/kurtosis_config/resolved_config" + api "github.com/kurtosis-tech/kurtosis/cloud/api/golang/kurtosis_backend_server_rpc_api_bindings" + "github.com/kurtosis-tech/kurtosis/contexts-config-store/store" + "github.com/kurtosis-tech/stacktrace" + "github.com/sirupsen/logrus" + "os" +) + +const ( + instanceIdentifierArgKey = "instance-id" + instanceIdentifierArgIsGreedy = false + kurtosisCloudApiKeyEnvVarArg = "KURTOSIS_CLOUD_API_KEY" +) + +var LoadCmd = &lowlevel.LowlevelKurtosisCommand{ + CommandStr: command_str_consts.CloudLoadCmdStr, + ShortDescription: "Load a Kurtosis Cloud instance", + LongDescription: "Load a remote Kurtosis Cloud instance by providing the instance id." + + "Note, the remote instance must be in a running state for this operation to complete successfully", + Flags: []*flags.FlagConfig{}, + Args: []*args.ArgConfig{ + instance_id_arg.InstanceIdentifierArg(instanceIdentifierArgKey, instanceIdentifierArgIsGreedy), + }, + PreValidationAndRunFunc: nil, + RunFunc: run, + PostValidationAndRunFunc: nil, +} + +func run(ctx context.Context, _ *flags.ParsedFlags, args *args.ParsedArgs) error { + instanceID, err := args.GetNonGreedyArg(instanceIdentifierArgKey) + if err != nil { + return stacktrace.Propagate(err, "Expected a value for instance id arg '%v' but none was found; "+ + "this is a bug in the Kurtosis CLI!", instanceIdentifierArgKey) + } + logrus.Infof("Loading cloud instance %s", instanceID) + + apiKey, err := loadApiKey() + if err != nil { + return stacktrace.Propagate(err, "Could not load an API Key. Check that it's defined using the "+ + "%s env var and it's a valid (active) key", kurtosisCloudApiKeyEnvVarArg) + } + + cloudConfig, err := getCloudConfig() + if err != nil { + return stacktrace.Propagate(err, "An error occured while loading the Cloud Config") + } + // Create the connection + connectionStr := fmt.Sprintf("%s:%d", cloudConfig.ApiUrl, cloudConfig.Port) + client, err := cloud.CreateCloudClient(connectionStr, cloudConfig.CertificateChain) + if err != nil { + return stacktrace.Propagate(err, "Error building client for Kurtosis Cloud") + } + + getConfigArgs := &api.GetCloudInstanceConfigArgs{ + ApiKey: *apiKey, + InstanceId: instanceID, + } + result, err := client.GetCloudInstanceConfig(ctx, getConfigArgs) + if err != nil { + return stacktrace.Propagate(err, "An error occurred while calling the Kurtosis Cloud API") + } + decodedConfigBytes, err := base64.StdEncoding.DecodeString(result.ContextConfig) + if err != nil { + return stacktrace.Propagate(err, "Failed to base64 decode context config") + } + + parsedContext, err := add.ParseContextData(decodedConfigBytes) + if err != nil { + return stacktrace.Propagate(err, "Unable to decode context config") + } + + contextsConfigStore := store.GetContextsConfigStore() + // We first have to remove the context incase it's already loaded + err = contextsConfigStore.RemoveContext(parsedContext.Uuid) + if err != nil { + return stacktrace.Propagate(err, "While attempting to reload the context with uuid %s an error occurred while removing it from the context store", parsedContext.Uuid) + } + if add.AddContext(parsedContext) != nil { + return stacktrace.Propagate(err, "Unable to add context to context store") + } + contextIdentifier := parsedContext.GetName() + return context_switch.SwitchContext(ctx, contextIdentifier) +} + +func loadApiKey() (*string, error) { + apiKey := os.Getenv(kurtosisCloudApiKeyEnvVarArg) + if len(apiKey) < 1 { + return nil, stacktrace.NewError("No API Key was found. An API Key must be provided as env var %s", kurtosisCloudApiKeyEnvVarArg) + } + logrus.Info("Successfully Loaded API Key...") + return &apiKey, nil +} + +func getCloudConfig() (*resolved_config.KurtosisCloudConfig, error) { + // Get the configuration + kurtosisConfigStore := kurtosis_config.GetKurtosisConfigStore() + configProvider := kurtosis_config.NewKurtosisConfigProvider(kurtosisConfigStore) + kurtosisConfig, err := configProvider.GetOrInitializeConfig() + if err != nil { + return nil, stacktrace.Propagate(err, "Failed to get or initialize Kurtosis configuration") + } + if kurtosisConfig.GetCloudConfig() == nil { + return nil, stacktrace.Propagate(err, "No cloud config was found. This is an internal Kurtosis error.") + } + cloudConfig := kurtosisConfig.GetCloudConfig() + + if cloudConfig.Port == 0 { + cloudConfig.Port = resolved_config.DefaultCloudConfigPort + } + if len(cloudConfig.ApiUrl) < 1 { + cloudConfig.ApiUrl = resolved_config.DefaultCloudConfigApiUrl + } + if len(cloudConfig.CertificateChain) < 1 { + cloudConfig.CertificateChain = resolved_config.DefaultCertificateChain + } + + return cloudConfig, nil +} diff --git a/cli/cli/commands/enclave/inspect/inspect.go b/cli/cli/commands/enclave/inspect/inspect.go index 2593095e56..8e024ef19d 100644 --- a/cli/cli/commands/enclave/inspect/inspect.go +++ b/cli/cli/commands/enclave/inspect/inspect.go @@ -90,7 +90,7 @@ func run( ) error { enclaveIdentifier, err := args.GetNonGreedyArg(enclaveIdentifierArgKey) if err != nil { - return stacktrace.Propagate(err, "Expected a value for non-greedy enclave identifier arg '%v' but none was found; this is a bug with Kurtosis!", enclaveIdentifierArgKey) + return stacktrace.Propagate(err, "Expected a value for non-greedy enclave identifier arg '%v' but none was found; this is a bug in the Kurtosis CLI!", enclaveIdentifierArgKey) } showFullUuids, err := flags.GetBool(fullUuidsFlagKey) diff --git a/cli/cli/commands/enclave/rm/rm.go b/cli/cli/commands/enclave/rm/rm.go index 2f20b41f16..fa96fded25 100644 --- a/cli/cli/commands/enclave/rm/rm.go +++ b/cli/cli/commands/enclave/rm/rm.go @@ -67,7 +67,7 @@ func run( ) error { enclaveIdentifiers, err := args.GetGreedyArg(enclaveIdentifiersArgKey) if err != nil { - return stacktrace.Propagate(err, "Expected a value for greedy enclave identifier arg '%v' but none was found; this is a bug with Kurtosis!", enclaveIdentifiersArgKey) + return stacktrace.Propagate(err, "Expected a value for greedy enclave identifier arg '%v' but none was found; this is a bug in the Kurtosis CLI!", enclaveIdentifiersArgKey) } shouldForceRemove, err := flags.GetBool(shouldForceRemoveFlagKey) diff --git a/cli/cli/commands/kurtosis_context/add/add.go b/cli/cli/commands/kurtosis_context/add/add.go index 7cd94f5c5b..a59ab51ebb 100644 --- a/cli/cli/commands/kurtosis_context/add/add.go +++ b/cli/cli/commands/kurtosis_context/add/add.go @@ -44,17 +44,20 @@ func run(_ context.Context, _ *flags.ParsedFlags, args *args.ParsedArgs) error { contextFilePath, err := args.GetNonGreedyArg(contextFilePathArgKey) if err != nil { return stacktrace.Propagate(err, "Expected a value for context file arg '%v' but none was found; "+ - "this is a bug with Kurtosis!", contextFilePathArgKey) + "this is a bug in the Kurtosis CLI!", contextFilePathArgKey) } - contextsConfigStore := store.GetContextsConfigStore() newContextToAdd, err := parseContextFile(contextFilePath) if err != nil { return stacktrace.Propagate(err, "Unable to read content of context file at '%s'", contextFilePath) } + return AddContext(newContextToAdd) +} +func AddContext(newContextToAdd *generated.KurtosisContext) error { logrus.Infof("Adding new context '%s'", newContextToAdd.GetName()) - if err = contextsConfigStore.AddNewContext(newContextToAdd); err != nil { + contextsConfigStore := store.GetContextsConfigStore() + if err := contextsConfigStore.AddNewContext(newContextToAdd); err != nil { return stacktrace.Propagate(err, "New context '%s' with UUID '%s' could not be added to the list of "+ "contexts already configured", newContextToAdd.GetName(), newContextToAdd.GetUuid().GetValue()) } @@ -67,10 +70,13 @@ func parseContextFile(contextFilePath string) (*generated.KurtosisContext, error if err != nil { return nil, stacktrace.Propagate(err, "Unable to read context of context file") } + return ParseContextData(contextFileContent) +} +func ParseContextData(contextContent []byte) (*generated.KurtosisContext, error) { newContext := new(generated.KurtosisContext) - if err = protojson.Unmarshal(contextFileContent, newContext); err != nil { - return nil, stacktrace.Propagate(err, "Content of context file at does not seem to be valid. It couldn't be parsed.") + if err := protojson.Unmarshal(contextContent, newContext); err != nil { + return nil, stacktrace.Propagate(err, "Content of context file could not be parsed.") } return newContext, nil } diff --git a/cli/cli/commands/kurtosis_context/context_switch/switch.go b/cli/cli/commands/kurtosis_context/context_switch/switch.go index 41ee856ec7..39612c6b11 100644 --- a/cli/cli/commands/kurtosis_context/context_switch/switch.go +++ b/cli/cli/commands/kurtosis_context/context_switch/switch.go @@ -45,9 +45,16 @@ var ContextSwitchCmd = &lowlevel.LowlevelKurtosisCommand{ func run(ctx context.Context, _ *flags.ParsedFlags, args *args.ParsedArgs) error { contextIdentifier, err := args.GetNonGreedyArg(contextIdentifierArgKey) if err != nil { - return stacktrace.Propagate(err, "Expected a value for context identifier arg '%v' but none was found; this is a bug with Kurtosis!", contextIdentifierArgKey) + return stacktrace.Propagate(err, "Expected a value for context identifier arg '%v' but none was found; this is a bug in the Kurtosis CLI!", contextIdentifierArgKey) } + return SwitchContext(ctx, contextIdentifier) +} + +func SwitchContext( + ctx context.Context, + contextIdentifier string, +) error { isContextSwitchSuccessful := false logrus.Info("Switching context...") diff --git a/cli/cli/commands/kurtosis_context/rm/rm.go b/cli/cli/commands/kurtosis_context/rm/rm.go index dfa157e1e4..9d62f27ca8 100644 --- a/cli/cli/commands/kurtosis_context/rm/rm.go +++ b/cli/cli/commands/kurtosis_context/rm/rm.go @@ -33,7 +33,7 @@ var ContextRmCmd = &lowlevel.LowlevelKurtosisCommand{ func run(_ context.Context, _ *flags.ParsedFlags, args *args.ParsedArgs) error { contextIdentifiers, err := args.GetGreedyArg(contextIdentifiersArgKey) if err != nil { - return stacktrace.Propagate(err, "Expected a value for greedy context identifiers arg '%v' but none was found; this is a bug with Kurtosis!", contextIdentifiersArgKey) + return stacktrace.Propagate(err, "Expected a value for greedy context identifiers arg '%v' but none was found; this is a bug in the Kurtosis CLI!", contextIdentifiersArgKey) } contextsConfigStore := store.GetContextsConfigStore() diff --git a/cli/cli/commands/root.go b/cli/cli/commands/root.go index 105a74b6fa..e6eb8a0915 100644 --- a/cli/cli/commands/root.go +++ b/cli/cli/commands/root.go @@ -12,6 +12,7 @@ import ( "github.com/kurtosis-tech/kurtosis/cli/cli/command_str_consts" "github.com/kurtosis-tech/kurtosis/cli/cli/commands/analytics" "github.com/kurtosis-tech/kurtosis/cli/cli/commands/clean" + "github.com/kurtosis-tech/kurtosis/cli/cli/commands/cloud" "github.com/kurtosis-tech/kurtosis/cli/cli/commands/cluster" "github.com/kurtosis-tech/kurtosis/cli/cli/commands/config" "github.com/kurtosis-tech/kurtosis/cli/cli/commands/discord" @@ -109,6 +110,7 @@ func init() { RootCmd.AddCommand(clean.CleanCmd.MustGetCobraCommand()) RootCmd.AddCommand(cluster.ClusterCmd) RootCmd.AddCommand(kurtosis_context.ContextCmd) + RootCmd.AddCommand(cloud.CloudCmd) RootCmd.AddCommand(kurtosisdump.KurtosisDump.MustGetCobraCommand()) RootCmd.AddCommand(config.ConfigCmd) RootCmd.AddCommand(discord.DiscordCmd.MustGetCobraCommand()) diff --git a/cli/cli/go.mod b/cli/cli/go.mod index 31799a7bd8..bef4083cea 100644 --- a/cli/cli/go.mod +++ b/cli/cli/go.mod @@ -4,6 +4,7 @@ go 1.19 replace ( github.com/kurtosis-tech/kurtosis/api/golang => ../../api/golang + github.com/kurtosis-tech/kurtosis/cloud/api/golang => ../../cloud/api/golang github.com/kurtosis-tech/kurtosis/container-engine-lib => ../../container-engine-lib github.com/kurtosis-tech/kurtosis/contexts-config-store => ../../contexts-config-store github.com/kurtosis-tech/kurtosis/engine/launcher => ../../engine/launcher @@ -47,7 +48,8 @@ require ( github.com/google/uuid v1.3.0 github.com/joho/godotenv v1.5.1 github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20230712110324-ce92904bb514 - github.com/kurtosis-tech/kurtosis/name_generator v0.0.0-20230727131617-20b635a2fc7e + github.com/kurtosis-tech/kurtosis/cloud/api/golang v0.0.0 + github.com/kurtosis-tech/kurtosis/name_generator v0.0.0-20230727152609-768e95d2dbeb github.com/kurtosis-tech/metrics-library/golang v0.0.0-20230727131823-40788a849ce5 github.com/kurtosis-tech/minimal-grpc-server/golang v0.0.0-20230710164206-90b674acb269 github.com/kurtosis-tech/vscode-kurtosis/starlark-lsp v0.0.0-20230406131103-c466e04f1b89 diff --git a/cli/cli/go.sum b/cli/cli/go.sum index 67d99e5513..51623e7d4d 100644 --- a/cli/cli/go.sum +++ b/cli/cli/go.sum @@ -358,8 +358,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20230712110324-ce92904bb514 h1:FBM2wGL9BTzj+qVs+Jd8l1mYAGd2uaKJdL7Ccei2DGU= github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20230712110324-ce92904bb514/go.mod h1:pHSIQlUtd+zPdILuvu3uCydjypzJk/wLex9bePmuqWA= -github.com/kurtosis-tech/kurtosis/name_generator v0.0.0-20230727131617-20b635a2fc7e h1:edrARHJ2xOR8kcE+nW32iJMGtImwzJqTkjcUHTbovmk= -github.com/kurtosis-tech/kurtosis/name_generator v0.0.0-20230727131617-20b635a2fc7e/go.mod h1:BReV/l+0pvK7K9wf8MN41ViQBSQH30j+YJ7V4glf19A= +github.com/kurtosis-tech/kurtosis/name_generator v0.0.0-20230727152609-768e95d2dbeb h1:lHfuk0gqCyaaR2GbFK0dG4e6w0pkYzHEixJHdnvlwyo= +github.com/kurtosis-tech/kurtosis/name_generator v0.0.0-20230727152609-768e95d2dbeb/go.mod h1:BReV/l+0pvK7K9wf8MN41ViQBSQH30j+YJ7V4glf19A= github.com/kurtosis-tech/metrics-library/golang v0.0.0-20230727131823-40788a849ce5 h1:OVnlFVT5ooscDchTKMK6o46/s25XlBDEliSZqp63FfY= github.com/kurtosis-tech/metrics-library/golang v0.0.0-20230727131823-40788a849ce5/go.mod h1:tteWV+M47xMHxqCIPQmdmgPW80rhN8YfzrgRRWbQhOw= github.com/kurtosis-tech/minimal-grpc-server/golang v0.0.0-20230710164206-90b674acb269 h1:yOo1I1iAyp0oYcGJ8AEAvt95QmpKNL1NYm1ZDqJW/LU= diff --git a/cli/cli/kurtosis_config/overrides_deserializers/config_overrides_deserializers.go b/cli/cli/kurtosis_config/overrides_deserializers/config_overrides_deserializers.go index 103d3feed1..681255ea13 100644 --- a/cli/cli/kurtosis_config/overrides_deserializers/config_overrides_deserializers.go +++ b/cli/cli/kurtosis_config/overrides_deserializers/config_overrides_deserializers.go @@ -25,6 +25,7 @@ var AllConfigOverridesDeserializers = map[config_version.ConfigVersion]configOve ConfigVersion: 0, ShouldSendMetrics: nil, KurtosisClusters: nil, + CloudConfig: nil, } if err := yaml.Unmarshal(configFileBytes, overrides); err != nil { return nil, stacktrace.Propagate(err, "An error occurred unmarshalling Kurtosis config YAML file content '%v'", string(configFileBytes)) diff --git a/cli/cli/kurtosis_config/overrides_migrators/config_overrides_migrators.go b/cli/cli/kurtosis_config/overrides_migrators/config_overrides_migrators.go index e3a8adeb09..cd77a6abf7 100644 --- a/cli/cli/kurtosis_config/overrides_migrators/config_overrides_migrators.go +++ b/cli/cli/kurtosis_config/overrides_migrators/config_overrides_migrators.go @@ -68,6 +68,7 @@ func migrateFromV1(uncastedConfig interface{}) (interface{}, error) { ConfigVersion: config_version.ConfigVersion_v2, ShouldSendMetrics: castedOldConfig.ShouldSendMetrics, KurtosisClusters: newClusters, + CloudConfig: nil, } return newConfig, nil diff --git a/cli/cli/kurtosis_config/overrides_objects/config_version_emptystructs.go b/cli/cli/kurtosis_config/overrides_objects/config_version_emptystructs.go index 1dcce9d17b..5c4146d90c 100644 --- a/cli/cli/kurtosis_config/overrides_objects/config_version_emptystructs.go +++ b/cli/cli/kurtosis_config/overrides_objects/config_version_emptystructs.go @@ -21,6 +21,7 @@ var AllConfigVersionEmptyStructs = map[config_version.ConfigVersion]interface{}{ ConfigVersion: 0, ShouldSendMetrics: nil, KurtosisClusters: nil, + CloudConfig: nil, }, config_version.ConfigVersion_v1: &v1.KurtosisConfigV1{ ConfigVersion: 0, diff --git a/cli/cli/kurtosis_config/overrides_objects/v2/kurtosis_cloud_config_v2.go b/cli/cli/kurtosis_config/overrides_objects/v2/kurtosis_cloud_config_v2.go new file mode 100644 index 0000000000..556567cb1c --- /dev/null +++ b/cli/cli/kurtosis_config/overrides_objects/v2/kurtosis_cloud_config_v2.go @@ -0,0 +1,16 @@ +package v2 + +/* +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + DO NOT CHANGE THIS FILE! + If you change this file, it will break config for users who have instantiated an + overrides file with this version of config overrides! + Instead, to make changes, you will need to add a new version of the config +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +*/ + +type KurtosisCloudConfigV2 struct { + ApiUrl *string `yaml:"api-url,omitempty"` + Port *uint `yaml:"port,omitempty"` + CertificateChain *string `yaml:"certificate-chain,omitempty"` +} diff --git a/cli/cli/kurtosis_config/overrides_objects/v2/kurtosis_config_v2.go b/cli/cli/kurtosis_config/overrides_objects/v2/kurtosis_config_v2.go index 3d093f6eef..51ea002d0e 100644 --- a/cli/cli/kurtosis_config/overrides_objects/v2/kurtosis_config_v2.go +++ b/cli/cli/kurtosis_config/overrides_objects/v2/kurtosis_config_v2.go @@ -22,4 +22,5 @@ type KurtosisConfigV2 struct { ShouldSendMetrics *bool `yaml:"should-send-metrics,omitempty"` KurtosisClusters map[string]*KurtosisClusterConfigV2 `yaml:"kurtosis-clusters,omitempty"` + CloudConfig *KurtosisCloudConfigV2 `yaml:"cloud-config,omitempty"` } diff --git a/cli/cli/kurtosis_config/resolved_config/kurtosis_cloud_config.go b/cli/cli/kurtosis_config/resolved_config/kurtosis_cloud_config.go new file mode 100644 index 0000000000..a905ebf750 --- /dev/null +++ b/cli/cli/kurtosis_config/resolved_config/kurtosis_cloud_config.go @@ -0,0 +1,7 @@ +package resolved_config + +type KurtosisCloudConfig struct { + ApiUrl string + Port uint + CertificateChain string +} diff --git a/cli/cli/kurtosis_config/resolved_config/kurtosis_cluster_config.go b/cli/cli/kurtosis_config/resolved_config/kurtosis_cluster_config.go index e2c0f3dc33..3cc337a51f 100644 --- a/cli/cli/kurtosis_config/resolved_config/kurtosis_cluster_config.go +++ b/cli/cli/kurtosis_config/resolved_config/kurtosis_cluster_config.go @@ -2,9 +2,9 @@ package resolved_config import ( "context" + v2 "github.com/kurtosis-tech/kurtosis/cli/cli/kurtosis_config/overrides_objects/v2" "strings" - v2 "github.com/kurtosis-tech/kurtosis/cli/cli/kurtosis_config/overrides_objects/v2" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_kurtosis_backend/backend_creator" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/kubernetes/kubernetes_kurtosis_backend" "github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface" diff --git a/cli/cli/kurtosis_config/resolved_config/kurtosis_cluster_config_test.go b/cli/cli/kurtosis_config/resolved_config/kurtosis_cluster_config_test.go index 4ec0b6b7ca..86314fcc3c 100644 --- a/cli/cli/kurtosis_config/resolved_config/kurtosis_cluster_config_test.go +++ b/cli/cli/kurtosis_config/resolved_config/kurtosis_cluster_config_test.go @@ -1,7 +1,7 @@ package resolved_config import ( - "github.com/kurtosis-tech/kurtosis/cli/cli/kurtosis_config/overrides_objects/v2" + v2 "github.com/kurtosis-tech/kurtosis/cli/cli/kurtosis_config/overrides_objects/v2" "github.com/stretchr/testify/require" "testing" ) diff --git a/cli/cli/kurtosis_config/resolved_config/kurtosis_config.go b/cli/cli/kurtosis_config/resolved_config/kurtosis_config.go index 02b98fe8b5..82db825985 100644 --- a/cli/cli/kurtosis_config/resolved_config/kurtosis_config.go +++ b/cli/cli/kurtosis_config/resolved_config/kurtosis_config.go @@ -15,6 +15,11 @@ const ( defaultMinikubeClusterKubernetesClusterNameStr = "minikube" defaultMinikubeStorageClass = "standard" defaultMinikubeEnclaveDataVolumeMB = uint(10) + DefaultCloudConfigApiUrl = "cloud.kurtosis.com" + DefaultCloudConfigPort = uint(8080) + // TODO: We'll need to pull this more dynamic. For now placing here: + // Certificate chain obtained by running: openssl s_client -connect cloud.kurtosis.com:8080 -showcerts + DefaultCertificateChain = "-----BEGIN CERTIFICATE-----\nMIIF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YGA1Ud\nHwQfMB0wG6AZoBeGFWh0dHA6Ly9zLnNzMi51cy9yLmNybDARBgNVHSAECjAIMAYG\nBFUdIAAwDQYJKoZIhvcNAQELBQADggEBACMd44pXyn3pF3lM8R5V/cxTbj5HD9/G\nVfKyBDbtgB9TxF00KGu+x1X8Z+rLP3+QsjPNG1gQggL4+C/1E2DUBc7xgQjB3ad1\nl08YuW3e95ORCLp+QCztweq7dp4zBncdDQh/U90bZKuCJ/Fp1U1ervShw3WnWEQt\n8jxwmKy6abaVd38PMV4s/KCHOkdp8Hlf9BRUpJVeEXgSYCfOn8J3/yNTd126/+pZ\n59vPr5KW7ySaNRB6nJHGDn2Z9j8Z3/VyVOEVqQdZe4O/Ui5GjLIAZHYcSNPYeehu\nVsyuLAOQ1xk4meTKCRlb/weWsKh/NEnfVqn3sF/tM+2MR7cwA130A4w=\n-----END CERTIFICATE-----" ) /* @@ -35,6 +40,7 @@ type KurtosisConfig struct { shouldSendMetrics bool clusters map[string]*KurtosisClusterConfig + cloudConfig *KurtosisCloudConfig } // NewKurtosisConfigFromOverrides constructs a new KurtosisConfig that uses the given overrides @@ -50,6 +56,7 @@ func NewKurtosisConfigFromOverrides(uncastedOverrides interface{}) (*KurtosisCon overrides: overrides, shouldSendMetrics: false, clusters: nil, + cloudConfig: nil, } // Get latest config version @@ -88,10 +95,40 @@ func NewKurtosisConfigFromOverrides(uncastedOverrides interface{}) (*KurtosisCon allClusterConfigs[clusterId] = clusterConfig } + cloudConfig := &KurtosisCloudConfig{ + ApiUrl: DefaultCloudConfigApiUrl, + Port: DefaultCloudConfigPort, + CertificateChain: DefaultCertificateChain, + } + if overrides.CloudConfig != nil { + if overrides.CloudConfig.ApiUrl != nil { + if len(*overrides.CloudConfig.ApiUrl) < 1 { + return nil, stacktrace.NewError("The CloudConfig ApiUrl must be nonempty") + } else { + cloudConfig.ApiUrl = *overrides.CloudConfig.ApiUrl + } + } + if overrides.CloudConfig.Port != nil { + if *overrides.CloudConfig.Port > uint(65535) { + return nil, stacktrace.NewError("The CloudConfig Port must be an integer and <= 65535") + } else { + cloudConfig.Port = *overrides.CloudConfig.Port + } + } + if overrides.CloudConfig.CertificateChain != nil { + if len(*overrides.CloudConfig.CertificateChain) < 1 { + return nil, stacktrace.NewError("The CloudConfig CertificateChain must be nonempty") + } else { + cloudConfig.CertificateChain = *overrides.CloudConfig.CertificateChain + } + } + } + return &KurtosisConfig{ overrides: overrides, shouldSendMetrics: shouldSendMetrics, clusters: allClusterConfigs, + cloudConfig: cloudConfig, }, nil } @@ -101,6 +138,7 @@ func NewKurtosisConfigFromRequiredFields(shouldSendMetrics bool) (*KurtosisConfi ConfigVersion: 0, ShouldSendMetrics: &shouldSendMetrics, KurtosisClusters: nil, + CloudConfig: nil, } result, err := NewKurtosisConfigFromOverrides(overrides) if err != nil { @@ -114,6 +152,7 @@ func NewKurtosisConfigWithMetricsSetFromExistingConfig(config *KurtosisConfig, s overrides: config.overrides, shouldSendMetrics: shouldSendMetrics, clusters: config.clusters, + cloudConfig: config.cloudConfig, } newConfig.overrides.ShouldSendMetrics = &shouldSendMetrics return newConfig @@ -131,6 +170,10 @@ func (kurtosisConfig *KurtosisConfig) GetOverrides() *v2.KurtosisConfigV2 { return kurtosisConfig.overrides } +func (kurtosisConfig *KurtosisConfig) GetCloudConfig() *KurtosisCloudConfig { + return kurtosisConfig.cloudConfig +} + // ==================================================================================================== // // Private Helpers diff --git a/cli/cli/kurtosis_config/resolved_config/kurtosis_config_test.go b/cli/cli/kurtosis_config/resolved_config/kurtosis_config_test.go index c01b19690c..bc3f27288b 100644 --- a/cli/cli/kurtosis_config/resolved_config/kurtosis_config_test.go +++ b/cli/cli/kurtosis_config/resolved_config/kurtosis_config_test.go @@ -3,7 +3,7 @@ package resolved_config import ( "github.com/kurtosis-tech/kurtosis/cli/cli/kurtosis_config/config_version" "github.com/kurtosis-tech/kurtosis/cli/cli/kurtosis_config/overrides_objects" - "github.com/kurtosis-tech/kurtosis/cli/cli/kurtosis_config/overrides_objects/v2" + v2 "github.com/kurtosis-tech/kurtosis/cli/cli/kurtosis_config/overrides_objects/v2" "github.com/stretchr/testify/require" "sort" "testing" @@ -54,6 +54,7 @@ func TestNewKurtosisConfigEmptyOverrides(t *testing.T) { ConfigVersion: 0, ShouldSendMetrics: nil, KurtosisClusters: nil, + CloudConfig: nil, }) // You can not initialize a Kurtosis config with empty overrides - it needs at least `ShouldSendMetrics` require.Error(t, err) @@ -66,6 +67,7 @@ func TestNewKurtosisConfigJustMetrics(t *testing.T) { ConfigVersion: version, ShouldSendMetrics: &shouldSendMetrics, KurtosisClusters: nil, + CloudConfig: nil, } config, err := NewKurtosisConfigFromOverrides(&originalOverrides) // You can not initialize a Kurtosis config with empty originalOverrides - it needs at least `ShouldSendMetrics` @@ -87,3 +89,26 @@ func TestNewKurtosisConfigOverridesAreLatestVersion(t *testing.T) { // check that overrides are actually the latest version require.Equal(t, latestVersion, overrides.ConfigVersion.String()) } + +func TestCloudConfigOverridesApiUrl(t *testing.T) { + version := config_version.ConfigVersion_v0 + shouldSendMetrics := true + apiUrl := "test.com" + originalOverrides := v2.KurtosisConfigV2{ + ConfigVersion: version, + ShouldSendMetrics: &shouldSendMetrics, + KurtosisClusters: nil, + CloudConfig: &v2.KurtosisCloudConfigV2{ + ApiUrl: &apiUrl, + Port: nil, + CertificateChain: nil, + }, + } + config, err := NewKurtosisConfigFromOverrides(&originalOverrides) + require.NoError(t, err) + + overrides := config.GetOverrides() + require.Equal(t, apiUrl, *overrides.CloudConfig.ApiUrl) + require.Nil(t, overrides.CloudConfig.Port) + require.Nil(t, overrides.CloudConfig.CertificateChain) +} diff --git a/cli/scripts/build.sh b/cli/scripts/build.sh index c7a940ae0a..1509e327ec 100755 --- a/cli/scripts/build.sh +++ b/cli/scripts/build.sh @@ -5,8 +5,6 @@ set -euo pipefail # Bash "strict mode" script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" root_dirpath="$(dirname "${script_dirpath}")" - - # ================================================================================================== # Constants # ================================================================================================== diff --git a/cloud/api/golang/go.mod b/cloud/api/golang/go.mod new file mode 100644 index 0000000000..ca8456a1bf --- /dev/null +++ b/cloud/api/golang/go.mod @@ -0,0 +1,16 @@ +module github.com/kurtosis-tech/kurtosis/cloud/api/golang + +go 1.19 + +require ( + google.golang.org/grpc v1.53.0 + google.golang.org/protobuf v1.28.1 +) + +require ( + github.com/golang/protobuf v1.5.2 // indirect + golang.org/x/net v0.7.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect + google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect +) diff --git a/cloud/api/golang/go.sum b/cloud/api/golang/go.sum new file mode 100644 index 0000000000..b4639f1f65 --- /dev/null +++ b/cloud/api/golang/go.sum @@ -0,0 +1,20 @@ +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/cloud/api/golang/kurtosis_backend_server_rpc_api_bindings/kurtosis_backend_server_api.pb.go b/cloud/api/golang/kurtosis_backend_server_rpc_api_bindings/kurtosis_backend_server_api.pb.go new file mode 100644 index 0000000000..4c0ab6babc --- /dev/null +++ b/cloud/api/golang/kurtosis_backend_server_rpc_api_bindings/kurtosis_backend_server_api.pb.go @@ -0,0 +1,529 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.20.3 +// source: kurtosis_backend_server_api.proto + +package kurtosis_backend_server_rpc_api_bindings + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CreateCloudInstanceConfigArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiKey string `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` +} + +func (x *CreateCloudInstanceConfigArgs) Reset() { + *x = CreateCloudInstanceConfigArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_kurtosis_backend_server_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateCloudInstanceConfigArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCloudInstanceConfigArgs) ProtoMessage() {} + +func (x *CreateCloudInstanceConfigArgs) ProtoReflect() protoreflect.Message { + mi := &file_kurtosis_backend_server_api_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCloudInstanceConfigArgs.ProtoReflect.Descriptor instead. +func (*CreateCloudInstanceConfigArgs) Descriptor() ([]byte, []int) { + return file_kurtosis_backend_server_api_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateCloudInstanceConfigArgs) GetApiKey() string { + if x != nil { + return x.ApiKey + } + return "" +} + +func (x *CreateCloudInstanceConfigArgs) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type CreateCloudInstanceConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceId string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` +} + +func (x *CreateCloudInstanceConfigResponse) Reset() { + *x = CreateCloudInstanceConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_kurtosis_backend_server_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateCloudInstanceConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCloudInstanceConfigResponse) ProtoMessage() {} + +func (x *CreateCloudInstanceConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_kurtosis_backend_server_api_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCloudInstanceConfigResponse.ProtoReflect.Descriptor instead. +func (*CreateCloudInstanceConfigResponse) Descriptor() ([]byte, []int) { + return file_kurtosis_backend_server_api_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateCloudInstanceConfigResponse) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +type GetCloudInstanceConfigArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiKey string `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` + InstanceId string `protobuf:"bytes,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` +} + +func (x *GetCloudInstanceConfigArgs) Reset() { + *x = GetCloudInstanceConfigArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_kurtosis_backend_server_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCloudInstanceConfigArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCloudInstanceConfigArgs) ProtoMessage() {} + +func (x *GetCloudInstanceConfigArgs) ProtoReflect() protoreflect.Message { + mi := &file_kurtosis_backend_server_api_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCloudInstanceConfigArgs.ProtoReflect.Descriptor instead. +func (*GetCloudInstanceConfigArgs) Descriptor() ([]byte, []int) { + return file_kurtosis_backend_server_api_proto_rawDescGZIP(), []int{2} +} + +func (x *GetCloudInstanceConfigArgs) GetApiKey() string { + if x != nil { + return x.ApiKey + } + return "" +} + +func (x *GetCloudInstanceConfigArgs) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +type LaunchResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceName string `protobuf:"bytes,1,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` + InstanceId string `protobuf:"bytes,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` + PublicDns string `protobuf:"bytes,3,opt,name=public_dns,json=publicDns,proto3" json:"public_dns,omitempty"` + IpAddress string `protobuf:"bytes,4,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` +} + +func (x *LaunchResult) Reset() { + *x = LaunchResult{} + if protoimpl.UnsafeEnabled { + mi := &file_kurtosis_backend_server_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LaunchResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LaunchResult) ProtoMessage() {} + +func (x *LaunchResult) ProtoReflect() protoreflect.Message { + mi := &file_kurtosis_backend_server_api_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LaunchResult.ProtoReflect.Descriptor instead. +func (*LaunchResult) Descriptor() ([]byte, []int) { + return file_kurtosis_backend_server_api_proto_rawDescGZIP(), []int{3} +} + +func (x *LaunchResult) GetInstanceName() string { + if x != nil { + return x.InstanceName + } + return "" +} + +func (x *LaunchResult) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +func (x *LaunchResult) GetPublicDns() string { + if x != nil { + return x.PublicDns + } + return "" +} + +func (x *LaunchResult) GetIpAddress() string { + if x != nil { + return x.IpAddress + } + return "" +} + +type GetCloudInstanceConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + InstanceId string `protobuf:"bytes,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` + ContextConfig string `protobuf:"bytes,3,opt,name=context_config,json=contextConfig,proto3" json:"context_config,omitempty"` + LaunchResult *LaunchResult `protobuf:"bytes,4,opt,name=launch_result,json=launchResult,proto3" json:"launch_result,omitempty"` + Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *GetCloudInstanceConfigResponse) Reset() { + *x = GetCloudInstanceConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_kurtosis_backend_server_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCloudInstanceConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCloudInstanceConfigResponse) ProtoMessage() {} + +func (x *GetCloudInstanceConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_kurtosis_backend_server_api_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCloudInstanceConfigResponse.ProtoReflect.Descriptor instead. +func (*GetCloudInstanceConfigResponse) Descriptor() ([]byte, []int) { + return file_kurtosis_backend_server_api_proto_rawDescGZIP(), []int{4} +} + +func (x *GetCloudInstanceConfigResponse) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetCloudInstanceConfigResponse) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +func (x *GetCloudInstanceConfigResponse) GetContextConfig() string { + if x != nil { + return x.ContextConfig + } + return "" +} + +func (x *GetCloudInstanceConfigResponse) GetLaunchResult() *LaunchResult { + if x != nil { + return x.LaunchResult + } + return nil +} + +func (x *GetCloudInstanceConfigResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +var File_kurtosis_backend_server_api_proto protoreflect.FileDescriptor + +var file_kurtosis_backend_server_api_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x6b, 0x75, 0x72, 0x74, 0x6f, 0x73, 0x69, 0x73, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x6b, 0x75, 0x72, 0x74, 0x6f, 0x73, 0x69, 0x73, 0x5f, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x51, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x72, 0x67, + 0x73, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x22, 0x44, 0x0a, 0x21, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x22, 0x56, 0x0a, 0x1a, 0x47, 0x65, 0x74, + 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x41, 0x72, 0x67, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, + 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, + 0x64, 0x22, 0x92, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x64, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x44, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x70, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x70, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xdc, 0x01, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x43, 0x6c, + 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x41, 0x0a, 0x0d, 0x6c, 0x61, + 0x75, 0x6e, 0x63, 0x68, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x6b, 0x75, 0x72, 0x74, 0x6f, 0x73, 0x69, 0x73, 0x5f, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, + 0x0c, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xd0, 0x02, 0x0a, 0x1a, 0x4b, 0x75, 0x72, 0x74, 0x6f, 0x73, + 0x69, 0x73, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x0b, 0x49, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, + 0x62, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x79, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x6b, + 0x75, 0x72, 0x74, 0x6f, 0x73, 0x69, 0x73, 0x5f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x72, 0x67, 0x73, 0x1a, 0x31, 0x2e, 0x6b, 0x75, + 0x72, 0x74, 0x6f, 0x73, 0x69, 0x73, 0x5f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x76, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, 0x2e, 0x6b, 0x75, 0x72, + 0x74, 0x6f, 0x73, 0x69, 0x73, 0x5f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x41, 0x72, 0x67, 0x73, 0x1a, 0x2e, 0x2e, 0x6b, 0x75, 0x72, 0x74, 0x6f, 0x73, 0x69, + 0x73, 0x5f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x65, 0x5a, 0x63, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x72, 0x74, 0x6f, 0x73, 0x69, 0x73, 0x2d, + 0x74, 0x65, 0x63, 0x68, 0x2f, 0x6b, 0x75, 0x72, 0x74, 0x6f, 0x73, 0x69, 0x73, 0x2d, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2d, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x6b, 0x75, 0x72, 0x74, 0x6f, 0x73, 0x69, 0x73, 0x5f, + 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x72, + 0x70, 0x63, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_kurtosis_backend_server_api_proto_rawDescOnce sync.Once + file_kurtosis_backend_server_api_proto_rawDescData = file_kurtosis_backend_server_api_proto_rawDesc +) + +func file_kurtosis_backend_server_api_proto_rawDescGZIP() []byte { + file_kurtosis_backend_server_api_proto_rawDescOnce.Do(func() { + file_kurtosis_backend_server_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_kurtosis_backend_server_api_proto_rawDescData) + }) + return file_kurtosis_backend_server_api_proto_rawDescData +} + +var file_kurtosis_backend_server_api_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_kurtosis_backend_server_api_proto_goTypes = []interface{}{ + (*CreateCloudInstanceConfigArgs)(nil), // 0: kurtosis_cloud.CreateCloudInstanceConfigArgs + (*CreateCloudInstanceConfigResponse)(nil), // 1: kurtosis_cloud.CreateCloudInstanceConfigResponse + (*GetCloudInstanceConfigArgs)(nil), // 2: kurtosis_cloud.GetCloudInstanceConfigArgs + (*LaunchResult)(nil), // 3: kurtosis_cloud.LaunchResult + (*GetCloudInstanceConfigResponse)(nil), // 4: kurtosis_cloud.GetCloudInstanceConfigResponse + (*emptypb.Empty)(nil), // 5: google.protobuf.Empty +} +var file_kurtosis_backend_server_api_proto_depIdxs = []int32{ + 3, // 0: kurtosis_cloud.GetCloudInstanceConfigResponse.launch_result:type_name -> kurtosis_cloud.LaunchResult + 5, // 1: kurtosis_cloud.KurtosisCloudBackendServer.IsAvailable:input_type -> google.protobuf.Empty + 0, // 2: kurtosis_cloud.KurtosisCloudBackendServer.CreateCloudInstance:input_type -> kurtosis_cloud.CreateCloudInstanceConfigArgs + 2, // 3: kurtosis_cloud.KurtosisCloudBackendServer.GetCloudInstanceConfig:input_type -> kurtosis_cloud.GetCloudInstanceConfigArgs + 5, // 4: kurtosis_cloud.KurtosisCloudBackendServer.IsAvailable:output_type -> google.protobuf.Empty + 1, // 5: kurtosis_cloud.KurtosisCloudBackendServer.CreateCloudInstance:output_type -> kurtosis_cloud.CreateCloudInstanceConfigResponse + 4, // 6: kurtosis_cloud.KurtosisCloudBackendServer.GetCloudInstanceConfig:output_type -> kurtosis_cloud.GetCloudInstanceConfigResponse + 4, // [4:7] is the sub-list for method output_type + 1, // [1:4] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_kurtosis_backend_server_api_proto_init() } +func file_kurtosis_backend_server_api_proto_init() { + if File_kurtosis_backend_server_api_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_kurtosis_backend_server_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCloudInstanceConfigArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kurtosis_backend_server_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCloudInstanceConfigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kurtosis_backend_server_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCloudInstanceConfigArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kurtosis_backend_server_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LaunchResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_kurtosis_backend_server_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCloudInstanceConfigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_kurtosis_backend_server_api_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_kurtosis_backend_server_api_proto_goTypes, + DependencyIndexes: file_kurtosis_backend_server_api_proto_depIdxs, + MessageInfos: file_kurtosis_backend_server_api_proto_msgTypes, + }.Build() + File_kurtosis_backend_server_api_proto = out.File + file_kurtosis_backend_server_api_proto_rawDesc = nil + file_kurtosis_backend_server_api_proto_goTypes = nil + file_kurtosis_backend_server_api_proto_depIdxs = nil +} diff --git a/cloud/api/golang/kurtosis_backend_server_rpc_api_bindings/kurtosis_backend_server_api_grpc.pb.go b/cloud/api/golang/kurtosis_backend_server_rpc_api_bindings/kurtosis_backend_server_api_grpc.pb.go new file mode 100644 index 0000000000..6861beb202 --- /dev/null +++ b/cloud/api/golang/kurtosis_backend_server_rpc_api_bindings/kurtosis_backend_server_api_grpc.pb.go @@ -0,0 +1,182 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.20.3 +// source: kurtosis_backend_server_api.proto + +package kurtosis_backend_server_rpc_api_bindings + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + KurtosisCloudBackendServer_IsAvailable_FullMethodName = "/kurtosis_cloud.KurtosisCloudBackendServer/IsAvailable" + KurtosisCloudBackendServer_CreateCloudInstance_FullMethodName = "/kurtosis_cloud.KurtosisCloudBackendServer/CreateCloudInstance" + KurtosisCloudBackendServer_GetCloudInstanceConfig_FullMethodName = "/kurtosis_cloud.KurtosisCloudBackendServer/GetCloudInstanceConfig" +) + +// KurtosisCloudBackendServerClient is the client API for KurtosisCloudBackendServer service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type KurtosisCloudBackendServerClient interface { + IsAvailable(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) + CreateCloudInstance(ctx context.Context, in *CreateCloudInstanceConfigArgs, opts ...grpc.CallOption) (*CreateCloudInstanceConfigResponse, error) + GetCloudInstanceConfig(ctx context.Context, in *GetCloudInstanceConfigArgs, opts ...grpc.CallOption) (*GetCloudInstanceConfigResponse, error) +} + +type kurtosisCloudBackendServerClient struct { + cc grpc.ClientConnInterface +} + +func NewKurtosisCloudBackendServerClient(cc grpc.ClientConnInterface) KurtosisCloudBackendServerClient { + return &kurtosisCloudBackendServerClient{cc} +} + +func (c *kurtosisCloudBackendServerClient) IsAvailable(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, KurtosisCloudBackendServer_IsAvailable_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kurtosisCloudBackendServerClient) CreateCloudInstance(ctx context.Context, in *CreateCloudInstanceConfigArgs, opts ...grpc.CallOption) (*CreateCloudInstanceConfigResponse, error) { + out := new(CreateCloudInstanceConfigResponse) + err := c.cc.Invoke(ctx, KurtosisCloudBackendServer_CreateCloudInstance_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kurtosisCloudBackendServerClient) GetCloudInstanceConfig(ctx context.Context, in *GetCloudInstanceConfigArgs, opts ...grpc.CallOption) (*GetCloudInstanceConfigResponse, error) { + out := new(GetCloudInstanceConfigResponse) + err := c.cc.Invoke(ctx, KurtosisCloudBackendServer_GetCloudInstanceConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// KurtosisCloudBackendServerServer is the server API for KurtosisCloudBackendServer service. +// All implementations should embed UnimplementedKurtosisCloudBackendServerServer +// for forward compatibility +type KurtosisCloudBackendServerServer interface { + IsAvailable(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + CreateCloudInstance(context.Context, *CreateCloudInstanceConfigArgs) (*CreateCloudInstanceConfigResponse, error) + GetCloudInstanceConfig(context.Context, *GetCloudInstanceConfigArgs) (*GetCloudInstanceConfigResponse, error) +} + +// UnimplementedKurtosisCloudBackendServerServer should be embedded to have forward compatible implementations. +type UnimplementedKurtosisCloudBackendServerServer struct { +} + +func (UnimplementedKurtosisCloudBackendServerServer) IsAvailable(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsAvailable not implemented") +} +func (UnimplementedKurtosisCloudBackendServerServer) CreateCloudInstance(context.Context, *CreateCloudInstanceConfigArgs) (*CreateCloudInstanceConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateCloudInstance not implemented") +} +func (UnimplementedKurtosisCloudBackendServerServer) GetCloudInstanceConfig(context.Context, *GetCloudInstanceConfigArgs) (*GetCloudInstanceConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCloudInstanceConfig not implemented") +} + +// UnsafeKurtosisCloudBackendServerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to KurtosisCloudBackendServerServer will +// result in compilation errors. +type UnsafeKurtosisCloudBackendServerServer interface { + mustEmbedUnimplementedKurtosisCloudBackendServerServer() +} + +func RegisterKurtosisCloudBackendServerServer(s grpc.ServiceRegistrar, srv KurtosisCloudBackendServerServer) { + s.RegisterService(&KurtosisCloudBackendServer_ServiceDesc, srv) +} + +func _KurtosisCloudBackendServer_IsAvailable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KurtosisCloudBackendServerServer).IsAvailable(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KurtosisCloudBackendServer_IsAvailable_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KurtosisCloudBackendServerServer).IsAvailable(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _KurtosisCloudBackendServer_CreateCloudInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCloudInstanceConfigArgs) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KurtosisCloudBackendServerServer).CreateCloudInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KurtosisCloudBackendServer_CreateCloudInstance_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KurtosisCloudBackendServerServer).CreateCloudInstance(ctx, req.(*CreateCloudInstanceConfigArgs)) + } + return interceptor(ctx, in, info, handler) +} + +func _KurtosisCloudBackendServer_GetCloudInstanceConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCloudInstanceConfigArgs) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KurtosisCloudBackendServerServer).GetCloudInstanceConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KurtosisCloudBackendServer_GetCloudInstanceConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KurtosisCloudBackendServerServer).GetCloudInstanceConfig(ctx, req.(*GetCloudInstanceConfigArgs)) + } + return interceptor(ctx, in, info, handler) +} + +// KurtosisCloudBackendServer_ServiceDesc is the grpc.ServiceDesc for KurtosisCloudBackendServer service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var KurtosisCloudBackendServer_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "kurtosis_cloud.KurtosisCloudBackendServer", + HandlerType: (*KurtosisCloudBackendServerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "IsAvailable", + Handler: _KurtosisCloudBackendServer_IsAvailable_Handler, + }, + { + MethodName: "CreateCloudInstance", + Handler: _KurtosisCloudBackendServer_CreateCloudInstance_Handler, + }, + { + MethodName: "GetCloudInstanceConfig", + Handler: _KurtosisCloudBackendServer_GetCloudInstanceConfig_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "kurtosis_backend_server_api.proto", +} diff --git a/cloud/api/golang/scripts/build.sh b/cloud/api/golang/scripts/build.sh new file mode 100755 index 0000000000..7fd5d8ec5a --- /dev/null +++ b/cloud/api/golang/scripts/build.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# 2021-07-08 WATERMARK, DO NOT REMOVE - This script was generated from the Kurtosis Bash script template + +set -euo pipefail # Bash "strict mode" +script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +lang_root_dirpath="$(dirname "${script_dirpath}")" + + + +# ================================================================================================== +# Constants +# ================================================================================================== + + +# ================================================================================================== +# Main Logic +# ================================================================================================== +cd "${lang_root_dirpath}" +CGO_ENABLED=0 go test ./... +go build ./... diff --git a/cloud/api/protobuf/kurtosis_backend_server_api.proto b/cloud/api/protobuf/kurtosis_backend_server_api.proto new file mode 100644 index 0000000000..78fe2a1e06 --- /dev/null +++ b/cloud/api/protobuf/kurtosis_backend_server_api.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package kurtosis_cloud; +// NOTE: It sucks that we have this Go-specific logic inside this file (which should be language-agnostic). However, the Protobuf team have +// taken a hard stance on this being the way it should be done, so we have to do it this way. +option go_package = "github.com/kurtosis-tech/kurtosis/cloud/api/golang/kurtosis_backend_server_rpc_api_bindings"; + +import "google/protobuf/empty.proto"; + +service KurtosisCloudBackendServer { + rpc IsAvailable (google.protobuf.Empty) returns (google.protobuf.Empty) {}; + rpc CreateCloudInstance(CreateCloudInstanceConfigArgs) returns (CreateCloudInstanceConfigResponse) {}; + rpc GetCloudInstanceConfig(GetCloudInstanceConfigArgs) returns (GetCloudInstanceConfigResponse) {}; +} + +message CreateCloudInstanceConfigArgs { + string api_key = 1; + string user_id = 2; +} + +message CreateCloudInstanceConfigResponse { + string instance_id = 1; +} + +message GetCloudInstanceConfigArgs { + string api_key = 1; + string instance_id = 2; +} + +message LaunchResult { + string instance_name = 1; + string instance_id = 2; + string public_dns = 3; + string ip_address = 4; +} + +message GetCloudInstanceConfigResponse { + string user_id = 1; + string instance_id = 2; + string context_config = 3; + LaunchResult launch_result = 4; + string status = 5; +} diff --git a/cloud/api/scripts/build.sh b/cloud/api/scripts/build.sh new file mode 100644 index 0000000000..f5420aacaa --- /dev/null +++ b/cloud/api/scripts/build.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# 2021-07-08 WATERMARK, DO NOT REMOVE - This script was generated from the Kurtosis Bash script template + +set -euo pipefail # Bash "strict mode" +script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +api_root_dirpath="$(dirname "${script_dirpath}")" + + + +# ================================================================================================== +# Constants +# ================================================================================================== +PROTOBUF_DIRNAME="protobuf" # Should be skipped; doesn't have a build.sh +BUILDSCRIPT_REL_DIRPATH="scripts/build.sh" + +# ================================================================================================== +# Main Logic +# ================================================================================================== +api_subproject_dirpaths="$(find "${api_root_dirpath}" -type d -maxdepth 1 -mindepth 1)" +for api_subproject_dirpath in ${api_subproject_dirpaths}; do + if [ "$(basename "${api_subproject_dirpath}")" == "${PROTOBUF_DIRNAME}" ]; then + continue + fi + if [ "${api_subproject_dirpath}" == "${script_dirpath}" ]; then + continue + fi + build_script_dirpath="${api_subproject_dirpath}/${BUILDSCRIPT_REL_DIRPATH}" + if ! bash "${build_script_dirpath}"; then + echo "Error: Build script '${build_script_dirpath}' failed" >&2 + exit 1 + fi +done diff --git a/cloud/api/scripts/regenerate-proto-bindings.sh b/cloud/api/scripts/regenerate-proto-bindings.sh new file mode 100755 index 0000000000..301cc94a2e --- /dev/null +++ b/cloud/api/scripts/regenerate-proto-bindings.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +# 2021-07-08 WATERMARK, DO NOT REMOVE - This script was generated from the Kurtosis Bash script template + +set -euo pipefail # Bash "strict mode" +script_dirpath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +root_dirpath="$(dirname "${script_dirpath}")" +repo_root_dirpath="$(dirname "${root_dirpath}")" + +# ================================================================================================== +# Constants +# ================================================================================================== +GO_MOD_FILE_MODULE_KEYWORD="module" + +# protobuf +api_proto_rel_dir="protobuf" + +# Golang +api_golang_proto_generated_rel_dir="golang" +api_go_mod_rel_file="golang/go.mod" + +# Typescript +#api_typescript_proto_generated_rel_dir="typescript/src/generated" + +# ================================================================================================== +# Main Logic +# ================================================================================================== + +api_proto_abs_dir="${root_dirpath}/${api_proto_rel_dir}" +api_google_dependency_abs_dir="${api_proto_abs_dir}/google" + +api_golang_proto_generated_abs_dir="${root_dirpath}/${api_golang_proto_generated_rel_dir}" +api_go_mod_abs_file="${root_dirpath}/${api_go_mod_rel_file}" +api_golang_module="$(grep "^${GO_MOD_FILE_MODULE_KEYWORD}" "${api_go_mod_abs_file}" | awk '{print $2}')" + +#api_typescript_proto_generated_abs_dir="${root_dirpath}/${api_typescript_proto_generated_rel_dir}" + + +cd "${root_dirpath}" + +# TODO: we should find a way to pull the monorepo "protobuf-bindings-generator.sh" to simplify all this +protoc \ + -I="${api_proto_abs_dir}" \ + --go_out="${api_golang_proto_generated_abs_dir}" \ + --go-grpc_out="${api_golang_proto_generated_abs_dir}" \ + --go_opt=module="${api_golang_module}" \ + --go-grpc_opt=module="${api_golang_module}" \ + --go-grpc_opt=require_unimplemented_servers=false \ + "${api_proto_abs_dir}"/*.proto + +#grpc_tools_node_protoc \ +# -I="${api_proto_abs_dir}" \ +# -I="${api_google_dependency_abs_dir}" \ +# "--js_out=import_style=commonjs,binary:${api_typescript_proto_generated_abs_dir}" \ +# `# NOTE: we pass the grpc_js option to generate code using '@grpc/grpc-js', as the old 'grpc' package is deprecated` \ +# "--grpc_out=grpc_js:${api_typescript_proto_generated_abs_dir}" \ +# "--plugin=protoc-gen-grpc=$(which grpc_tools_node_protoc_plugin)" \ +# `# NOTE: we pass mode=grpc-js to get Typescript definition files that use '@grpc/grpc-js' rather than 'grpc' `\ +# "--ts_out=service=grpc-node,mode=grpc-js:${api_typescript_proto_generated_abs_dir}" \ +# `# NOTE: those 2 google files are need for the google.api.http annotations inside client and server protos` \ +# "${api_proto_abs_dir}"/google/api/http.proto \ +# "${api_proto_abs_dir}"/google/api/annotations.proto \ +# "${api_proto_abs_dir}"/*.proto + +#grpc_tools_node_protoc \ +# -I="${api_proto_abs_dir}" \ +# -I="${api_google_dependency_abs_dir}" \ +# "--js_out=import_style=commonjs:${api_typescript_proto_generated_abs_dir}" \ +# "--grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:${api_typescript_proto_generated_abs_dir}" \ +# `# NOTE: those 2 google files are need for the google.api.http annotations inside client and server protos` \ +# "${api_google_dependency_abs_dir}"/api/http.proto \ +# "${api_google_dependency_abs_dir}"/api/annotations.proto \ +# "${api_proto_abs_dir}"/*.proto diff --git a/cloud/api/supported-languages.txt b/cloud/api/supported-languages.txt new file mode 100644 index 0000000000..6315160736 --- /dev/null +++ b/cloud/api/supported-languages.txt @@ -0,0 +1,2 @@ +golang +typescript diff --git a/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_manager.go b/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_manager.go index e098f576b5..324b1c4a7c 100644 --- a/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_manager.go +++ b/container-engine-lib/lib/backend_impls/docker/docker_manager/docker_manager.go @@ -1088,12 +1088,12 @@ func (manager *DockerManager) GetAvailableCPUAndMemory(ctx context.Context) (com // ================================================================================================================= func (manager *DockerManager) isImageAvailableLocally(ctx context.Context, imageName string) (bool, error) { referenceArg := filters.Arg("reference", imageName) - filters := filters.NewArgs(referenceArg) + filterArgs := filters.NewArgs(referenceArg) images, err := manager.dockerClient.ImageList( ctx, types.ImageListOptions{ All: true, - Filters: filters, + Filters: filterArgs, }) if err != nil { return false, stacktrace.Propagate(err, "Failed to list images.") diff --git a/go.work b/go.work index 8dca84b293..610bdf1989 100644 --- a/go.work +++ b/go.work @@ -2,6 +2,7 @@ go 1.19 use ( ./api/golang + ./cloud/api/golang ./cli/cli ./container-engine-lib ./contexts-config-store diff --git a/go.work.sum b/go.work.sum index c92156c157..73b45646d2 100644 --- a/go.work.sum +++ b/go.work.sum @@ -503,7 +503,9 @@ github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 h1:rFw4nCn9iMW+Vaj github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/v11 v11.0.0 h1:hqauxvFQxww+0mEU/2XHG6LT7eZternCZq+A5Yly2uM= github.com/apache/thrift v0.13.0 h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI= github.com/apache/thrift v0.16.0 h1:qEy6UW60iVOlUy+b9ZR0d5WzUWYGOo4HfopoyBaNmoY= @@ -546,6 +548,7 @@ github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe h1:QQ3GSy+MqSHxm/d8nCtnAiZdYFd45cYZPs8vOOIYKfk= github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= @@ -574,6 +577,8 @@ github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f h1:7T++XKzy4xg7PKy+bM+Sa9/oe1OC88yz2hXQUISoXfA= github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8= @@ -633,7 +638,6 @@ github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5 github.com/googleapis/gax-go v2.0.0+incompatible h1:j0GKcs05QVmm7yesiZq2+9cxHkNK9YM6zKx4D2qucQU= github.com/googleapis/gax-go/v2 v2.0.3 h1:siORttZ36U2R/WjiJuDz8znElWBiAlO9rVt+mqJt0Cc= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.7.1 h1:gF4c0zjUP2H/s/hEGyLA3I0fA2ZWjzYiONAD6cvPr8A= github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= @@ -650,6 +654,7 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6A github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= github.com/hashicorp/consul/api v1.3.0 h1:HXNYlRkkM/t+Y/Yhxtwcy02dlYwIaoxzvxPnS+cqy78= github.com/hashicorp/consul/sdk v0.3.0 h1:UOxjlb4xVNF93jak1mzzoBatyFju9nrkxpVwIp/QqxQ= @@ -748,6 +753,7 @@ github.com/performancecopilot/speed v3.0.0+incompatible h1:2WnRzIquHa5QxaJKShDkL github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= github.com/pkg/profile v1.2.1 h1:F++O52m40owAmADcojzM+9gyjmMOY/T4oYJkgFDH8RE= github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= @@ -767,6 +773,7 @@ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng= github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f h1:UFr9zpz4xgTnIE5yIMtWAMngCdZ9p/+q6lTbgelo80M= @@ -824,9 +831,9 @@ github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0= go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs= go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go4.org v0.0.0-20180809161055-417644f6feb5 h1:+hE86LblG4AyDgwMCLTE6FOlM9+qjHSYS+rKqxUVdsM= @@ -841,27 +848,55 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852 h1:xYq6+9AtI+xP3M4r0N1hCkHrInHDBohhquRgx9Kk6gI= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8= google.golang.org/api v0.30.0 h1:yfrXXP61wVuLb0vBcG6qaOoIoqYEzOQS8jum51jkv2w= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.125.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= +google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8 h1:Cpp2P6TPjujNoC5M2KHY6g7wfyLYfIWRZaSdIKfDasA= google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto v0.0.0-20230629202037-9506855d4529/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/cheggaaa/pb.v1 v1.0.25 h1:Ev7yu1/f6+d+b3pi5vPdRPc6nNtP1umSfcWiEfRqv6I= gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= @@ -869,6 +904,7 @@ gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/gcfg.v1 v1.2.3 h1:m8OOJ4ccYHnx2f4gQwpno8nAX5OGOh7RLaaz0pj3Ogs= gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919 h1:tmXTu+dfa+d9Evp8NpJdgOy6+rt8/x4yG7qPBrtNfLY= honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= diff --git a/name_generator/go.sum b/name_generator/go.sum index 02ae99e245..32a38081f9 100644 --- a/name_generator/go.sum +++ b/name_generator/go.sum @@ -1,12 +1,23 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=