From 0d2f1920f671f37187f92ad621cec9471c1c95a3 Mon Sep 17 00:00:00 2001 From: Ljubisa Date: Tue, 19 Nov 2024 15:01:57 +0100 Subject: [PATCH 1/3] chore: add public-testnet.yaml for checks in bee-testnet namespace --- config/public-testnet.yaml | 121 +++++++++++++++++++++++++++ pkg/check/settlements/settlements.go | 28 +++---- 2 files changed, 132 insertions(+), 17 deletions(-) create mode 100644 config/public-testnet.yaml diff --git a/config/public-testnet.yaml b/config/public-testnet.yaml new file mode 100644 index 00000000..42373409 --- /dev/null +++ b/config/public-testnet.yaml @@ -0,0 +1,121 @@ +clusters: + bee-testnet: + _inherit: "default" + namespace: bee-testnet + use-static-endpoints: true + node-groups: + bee: + mode: node + bee-config: default + config: default + count: 20 + endpoints: + - name: bee-1-0 + api-url: http://bee-1-0.bee-testnet.testnet.internal + - name: bee-1-1 + api-url: http://bee-1-1.bee-testnet.testnet.internal + - name: bee-1-2 + api-url: http://bee-1-2.bee-testnet.testnet.internal + - name: bee-1-3 + api-url: http://bee-1-3.bee-testnet.testnet.internal + - name: bee-1-4 + api-url: http://bee-1-4.bee-testnet.testnet.internal + - name: bee-2-0 + api-url: http://bee-2-0.bee-testnet.testnet.internal + - name: bee-2-1 + api-url: http://bee-2-1.bee-testnet.testnet.internal + - name: bee-2-2 + api-url: http://bee-2-2.bee-testnet.testnet.internal + - name: bee-2-3 + api-url: http://bee-2-3.bee-testnet.testnet.internal + - name: bee-2-4 + api-url: http://bee-2-4.bee-testnet.testnet.internal + - name: bee-3-0 + api-url: http://bee-3-0.bee-testnet.testnet.internal + - name: bee-3-1 + api-url: http://bee-3-1.bee-testnet.testnet.internal + - name: bee-3-2 + api-url: http://bee-3-2.bee-testnet.testnet.internal + - name: bee-3-3 + api-url: http://bee-3-3.bee-testnet.testnet.internal + - name: bee-3-4 + api-url: http://bee-3-4.bee-testnet.testnet.internal + - name: bee-4-0 + api-url: http://bee-4-0.bee-testnet.testnet.internal + - name: bee-4-1 + api-url: http://bee-4-1.bee-testnet.testnet.internal + - name: bee-4-2 + api-url: http://bee-4-2.bee-testnet.testnet.internal + - name: bee-4-3 + api-url: http://bee-4-3.bee-testnet.testnet.internal + - name: bee-4-4 + api-url: http://bee-4-4.bee-testnet.testnet.internal + +checks: + pt-retrieval: + options: + chunks-per-node: 3 + postage-amount: 140000000 + postage-depth: 17 + upload-node-count: 3 + timeout: 15m + type: retrieval + pt-settlements: + options: + dry-run: false + expect-settlements: true + file-name: settlements + file-size: 14680064 # 14mb = 14*1024*1024 + postage-amount: 140000000 + postage-depth: 20 + threshold: 100000000 + upload-node-count: 3 + wait-before-download: 15s + timeout: 15m + type: settlements + pt-manifest: + options: + files-in-collection: 10 + max-pathname-length: 64 + postage-amount: 140000000 + postage-depth: 17 + timeout: 5m + type: manifest + pt-pss: + options: + count: 3 + address-prefix: 2 + postage-amount: 140000000 + postage-depth: 17 + request-timeout: 5m + timeout: 30m + type: pss + pt-soc: + options: + postage-amount: 140000000 + postage-depth: 17 + request-timeout: 5m + timeout: 5m + type: soc + pt-pushsync-chunks: + options: + chunks-per-node: 3 + mode: chunks + postage-amount: 140000000 + postage-depth: 17 + retries: 5 + retry-delay: 15s + upload-node-count: 3 + exclude-node-group: + - light + - bootnode + timeout: 30m + type: pushsync + pt-postage: + type: postage + timeout: 30m + options: + postage-amount: 140000000 + postage-depth: 17 + postage-topup-amount: 100 + postage-new-depth: 18 diff --git a/pkg/check/settlements/settlements.go b/pkg/check/settlements/settlements.go index 613d086d..98fd55c4 100644 --- a/pkg/check/settlements/settlements.go +++ b/pkg/check/settlements/settlements.go @@ -75,7 +75,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int if o.DryRun { c.logger.Info("running settlements (dry mode)") - return dryRun(ctx, cluster, o, c.logger) + return dryRun(ctx, cluster, c.logger) } rnd := random.PseudoGenerator(o.Seed) @@ -97,7 +97,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int return err } - if err := validateSettlements(overlays, accounting, settlements, c.logger); err != nil { + if err := validateSettlements(accounting, settlements, c.logger); err != nil { return fmt.Errorf("invalid initial settlements: %s", err.Error()) } c.logger.Info("Settlements are valid") @@ -152,8 +152,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int settlementsHappened = true } - err = validateSettlements(overlays, accounting, settlements, c.logger) - if err != nil { + if err = validateSettlements(accounting, settlements, c.logger); err != nil { c.logger.Infof("Invalid settlements after uploading a file: %s", err.Error()) c.logger.Info("Retrying ...") continue @@ -203,7 +202,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int settlementsHappened = true } - err = validateSettlements(overlays, accounting, settlements, c.logger) + err = validateSettlements(accounting, settlements, c.logger) if err != nil { c.logger.Infof("Invalid settlements after downloading a file: %s", err.Error()) c.logger.Info("Retrying ...") @@ -228,12 +227,7 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int } // dryRun executes settlements validation check without files uploading/downloading -func dryRun(ctx context.Context, cluster orchestration.Cluster, o Options, logger logging.Logger) (err error) { - overlays, err := cluster.FlattenOverlays(ctx) - if err != nil { - return err - } - +func dryRun(ctx context.Context, cluster orchestration.Cluster, logger logging.Logger) (err error) { accounting, err := cluster.FlattenAccounting(ctx) if err != nil { return err @@ -244,7 +238,7 @@ func dryRun(ctx context.Context, cluster orchestration.Cluster, o Options, logge return err } - if err := validateSettlements(overlays, accounting, settlements, logger); err != nil { + if err := validateSettlements(accounting, settlements, logger); err != nil { return fmt.Errorf("invalid settlements") } logger.Info("Settlements are valid") @@ -253,7 +247,7 @@ func dryRun(ctx context.Context, cluster orchestration.Cluster, o Options, logge } // validateSettlements checks if settlements are valid -func validateSettlements(overlays orchestration.NodeGroupOverlays, accounting orchestration.NodeGroupAccounting, settlements orchestration.NodeGroupSettlements, logger logging.Logger) (err error) { +func validateSettlements(accounting orchestration.NodeGroupAccounting, settlements orchestration.NodeGroupSettlements, logger logging.Logger) (err error) { // threshold validation for node, v := range accounting { for _, peerInfo := range v { @@ -273,10 +267,10 @@ func validateSettlements(overlays orchestration.NodeGroupOverlays, accounting or for peer, peerInfo := range v { diff := peerInfo.Balance + accounting[peer][node].Balance if diff != 0 { - logger.Infof("Node %s has asymmetric balance with peer %s\n", node, peer) - logger.Infof("Node %s has balance %d with peer %s\n", node, peerInfo.Balance, peer) - logger.Infof("Peer %s has balance %d with node %s\n", peer, accounting[peer][node].Balance, node) - logger.Infof("Difference: %d\n", diff) + logger.Infof("Node %s has asymmetric balance with peer %s", node, peer) + logger.Infof("Node %s has balance %d with peer %s", node, peerInfo.Balance, peer) + logger.Infof("Peer %s has balance %d with node %s", peer, accounting[peer][node].Balance, node) + logger.Infof("Difference: %d", diff) noBalanceSymmetry = true } } From c4491cfbf0227f7eb79920bc332d04e131da6de0 Mon Sep 17 00:00:00 2001 From: Ljubisa Date: Wed, 20 Nov 2024 14:13:44 +0100 Subject: [PATCH 2/3] chore: add pt-gsoc check --- README.md | 22 ++++++++++++++++++++++ cmd/beekeeper/cmd/check.go | 2 ++ config/public-testnet.yaml | 7 +++++++ 3 files changed, 31 insertions(+) diff --git a/README.md b/README.md index ed366631..06dcc0eb 100644 --- a/README.md +++ b/README.md @@ -450,3 +450,25 @@ example: --tracing-port string port to send tracing data --tracing-service-name string service name identifier for tracing (default "beekeeper") ``` + +## Public Testnet Checks + +### One by one + +```shell +./dist/beekeeper check --cluster-name=bee-testnet --checks=pingpong +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-retrieval +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-settlements +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-manifest +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-pss +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-soc +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-pushsync-chunks +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-postage +./dist/beekeeper check --cluster-name=bee-testnet --checks=pt-gsoc +``` + +### All at once, sequentially + +```shell +./dist/beekeeper check --cluster-name=bee-testnet --timeout=2h --checks=pingpong,pt-retrieval,pt-settlements,pt-manifest,pt-pss,pt-soc,pt-pushsync-chunks,pt-postage +``` diff --git a/cmd/beekeeper/cmd/check.go b/cmd/beekeeper/cmd/check.go index eeda92ce..41dc4bcd 100644 --- a/cmd/beekeeper/cmd/check.go +++ b/cmd/beekeeper/cmd/check.go @@ -22,6 +22,7 @@ func (c *command) initCheckCmd() (err error) { optionNameMetricsEnabled = "metrics-enabled" optionNameSeed = "seed" optionNameTimeout = "timeout" + optionNameParallel = "parallel" optionNameMetricsPusherAddress = "metrics-pusher-address" // TODO: optionNameStages = "stages" ) @@ -152,6 +153,7 @@ func (c *command) initCheckCmd() (err error) { cmd.Flags().Bool(optionNameCreateCluster, false, "creates cluster before executing checks") cmd.Flags().StringSlice(optionNameChecks, []string{"pingpong"}, "list of checks to execute") cmd.Flags().Bool(optionNameMetricsEnabled, true, "enable metrics") + cmd.Flags().Int(optionNameParallel, 1, "number of checks to run in parallel") cmd.Flags().Int64(optionNameSeed, -1, "seed, -1 for random") cmd.Flags().Duration(optionNameTimeout, 30*time.Minute, "timeout") diff --git a/config/public-testnet.yaml b/config/public-testnet.yaml index 42373409..7b74cc80 100644 --- a/config/public-testnet.yaml +++ b/config/public-testnet.yaml @@ -119,3 +119,10 @@ checks: postage-depth: 17 postage-topup-amount: 100 postage-new-depth: 18 + pt-gsoc: + options: + postage-amount: 140000000 + postage-depth: 20 + postage-label: gsoc-label + timeout: 10m + type: gsoc From 77ab50c10bf9c5096d734a5a6a290d5812bc5dad Mon Sep 17 00:00:00 2001 From: Ljubisa Gacevic Date: Thu, 21 Nov 2024 12:19:58 +0100 Subject: [PATCH 3/3] fix(checks): remove parallel option --- README.md | 2 +- cmd/beekeeper/cmd/check.go | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 06dcc0eb..9f8f95c2 100644 --- a/README.md +++ b/README.md @@ -470,5 +470,5 @@ example: ### All at once, sequentially ```shell -./dist/beekeeper check --cluster-name=bee-testnet --timeout=2h --checks=pingpong,pt-retrieval,pt-settlements,pt-manifest,pt-pss,pt-soc,pt-pushsync-chunks,pt-postage +./dist/beekeeper check --cluster-name=bee-testnet --timeout=2h --checks=pingpong,pt-retrieval,pt-settlements,pt-manifest,pt-pss,pt-soc,pt-pushsync-chunks,pt-postage,pt-gsoc ``` diff --git a/cmd/beekeeper/cmd/check.go b/cmd/beekeeper/cmd/check.go index 41dc4bcd..eeda92ce 100644 --- a/cmd/beekeeper/cmd/check.go +++ b/cmd/beekeeper/cmd/check.go @@ -22,7 +22,6 @@ func (c *command) initCheckCmd() (err error) { optionNameMetricsEnabled = "metrics-enabled" optionNameSeed = "seed" optionNameTimeout = "timeout" - optionNameParallel = "parallel" optionNameMetricsPusherAddress = "metrics-pusher-address" // TODO: optionNameStages = "stages" ) @@ -153,7 +152,6 @@ func (c *command) initCheckCmd() (err error) { cmd.Flags().Bool(optionNameCreateCluster, false, "creates cluster before executing checks") cmd.Flags().StringSlice(optionNameChecks, []string{"pingpong"}, "list of checks to execute") cmd.Flags().Bool(optionNameMetricsEnabled, true, "enable metrics") - cmd.Flags().Int(optionNameParallel, 1, "number of checks to run in parallel") cmd.Flags().Int64(optionNameSeed, -1, "seed, -1 for random") cmd.Flags().Duration(optionNameTimeout, 30*time.Minute, "timeout")