diff --git a/cmd/beekeeper/cmd/cluster.go b/cmd/beekeeper/cmd/cluster.go index 5ac37971..4b4215e5 100644 --- a/cmd/beekeeper/cmd/cluster.go +++ b/cmd/beekeeper/cmd/cluster.go @@ -51,7 +51,7 @@ func (c *command) deleteCluster(ctx context.Context, clusterName string, cfg *co nName = v.Nodes[i].Name } if err := g.DeleteNode(ctx, nName); err != nil { - return fmt.Errorf("deleting node %s from the node group %s", nName, ngName) + return fmt.Errorf("deleting node %s from the node group %s: %w", nName, ngName, err) } if deleteStorage && *ngConfig.PersistenceEnabled { @@ -77,7 +77,7 @@ func (c *command) deleteCluster(ctx context.Context, clusterName string, cfg *co nName = v.Nodes[i].Name } if err := ng.DeleteNode(ctx, nName); err != nil { - return fmt.Errorf("deleting node %s from the node group %s", nName, ngName) + return fmt.Errorf("deleting node %s from the node group %s: %w", nName, ngName, err) } if deleteStorage && *ngConfig.PersistenceEnabled { @@ -91,7 +91,7 @@ func (c *command) deleteCluster(ctx context.Context, clusterName string, cfg *co for i := 0; i < v.Count; i++ { nName := fmt.Sprintf("%s-%d", ngName, i) if err := ng.DeleteNode(ctx, nName); err != nil { - return fmt.Errorf("deleting node %s from the node group %s", nName, ngName) + return fmt.Errorf("deleting node %s from the node group %s: %w", nName, ngName, err) } if deleteStorage && *ngConfig.PersistenceEnabled { diff --git a/cmd/beekeeper/cmd/cmd.go b/cmd/beekeeper/cmd/cmd.go index 78760121..ba43bfa2 100644 --- a/cmd/beekeeper/cmd/cmd.go +++ b/cmd/beekeeper/cmd/cmd.go @@ -26,6 +26,7 @@ import ( const ( optionNameConfigDir = "config-dir" optionNameConfigGitRepo = "config-git-repo" + optionNameConfigGitDir = "config-git-dir" optionNameConfigGitBranch = "config-git-branch" optionNameConfigGitUsername = "config-git-username" optionNameConfigGitPassword = "config-git-password" @@ -146,6 +147,7 @@ func (c *command) initGlobalFlags() { globalFlags.StringVar(&c.globalConfigFile, "config", "", "config file (default is $HOME/.beekeeper.yaml)") globalFlags.String(optionNameConfigDir, filepath.Join(c.homeDir, "/.beekeeper/"), "config directory (default is $HOME/.beekeeper/)") globalFlags.String(optionNameConfigGitRepo, "", "Git repository with configurations (uses config directory when Git repo is not specified) (default \"\")") + globalFlags.String(optionNameConfigGitDir, ".", "Git directory in the repository with configurations (default \".\")") globalFlags.String(optionNameConfigGitBranch, "main", "Git branch") globalFlags.String(optionNameConfigGitUsername, "", "Git username (needed for private repos)") globalFlags.String(optionNameConfigGitPassword, "", "Git password or personal access tokens (needed for private repos)") @@ -226,16 +228,20 @@ func (c *command) initConfig() (err error) { return fmt.Errorf("cloning repo %s: %w ", c.globalConfig.GetString(optionNameConfigGitRepo), err) } - files, err := fs.ReadDir(".") + dir := c.globalConfig.GetString(optionNameConfigGitDir) + + files, err := fs.ReadDir(dir) if err != nil { - return err + return fmt.Errorf("reading git config dir: %w", err) } + yamlFiles := []config.YamlFile{} for _, file := range files { if file.IsDir() || (!strings.HasSuffix(file.Name(), ".yaml") && !strings.HasSuffix(file.Name(), ".yml")) { continue } - f, err := fs.Open(file.Name()) + filePath := filepath.Join(dir, file.Name()) + f, err := fs.Open(filePath) if err != nil { return fmt.Errorf("opening file %s: %w ", file.Name(), err) } diff --git a/config/beekeeper-local.yaml b/config/beekeeper-local.yaml index 3af979e8..420f7385 100644 --- a/config/beekeeper-local.yaml +++ b/config/beekeeper-local.yaml @@ -1,8 +1,9 @@ -#config-dir: $HOME/.beekeeper -#config-git-repo: "" -#config-git-branch: main -#config-git-username: -#config-git-password: +# config-dir: $HOME/.beekeeper +# config-git-repo: "https://github.com/ethersphere/beekeeper" +# config-git-dir: "" +# config-git-branch: main +# config-git-username: +# config-git-password: enable-k8s: true in-cluster: false kubeconfig: "~/.kube/config" diff --git a/config/public-testnet.yaml b/config/public-testnet.yaml index 7b74cc80..36b30245 100644 --- a/config/public-testnet.yaml +++ b/config/public-testnet.yaml @@ -126,3 +126,20 @@ checks: postage-label: gsoc-label timeout: 10m type: gsoc + pt-testnet-load: + options: + content-size: 50000000 + postage-amount: 1000000000 # 1024/15*60*60*24*7 + postage-depth: 24 + duration: 12h + uploader-count: 2 + downloader-count: 0 + max-use-batch: 1h + upload-groups: + - bee-1 + - bee-2 + download-groups: + - bee-3 + - bee-4 + timeout: 12h + type: load diff --git a/config/staging.yaml b/config/staging.yaml index d829d77f..d0ab3e74 100644 --- a/config/staging.yaml +++ b/config/staging.yaml @@ -4,7 +4,7 @@ clusters: staging: _inherit: "" name: bee - namespace: beekeeper + namespace: staging disable-namespace: false api-domain: testnet.internal api-insecure-tls: true @@ -38,3 +38,22 @@ bee-configs: swap-factory-address: "" verbosity: 4 welcome-message: Welcome to the bee staging environment created by Beekeeper! + +checks: + st-testnet-load: + options: + content-size: 50000000 + postage-amount: 1000000000 + postage-depth: 24 + duration: 12h + uploader-count: 2 + downloader-count: 0 + max-use-batch: 1h + upload-groups: + - bee-1 + - bee-2 + download-groups: + - bee-3 + - bee-4 + timeout: 12h + type: load