Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pprof server to fleet-manager and unlimited evals in testing&develop #1431

Merged
merged 11 commits into from
Nov 13, 2023

Conversation

SimonBaeumer
Copy link
Member

@SimonBaeumer SimonBaeumer commented Nov 2, 2023

Description

  • Add pprof server to fleet-manager on port 6060
  • Add name parameter to create-central.sh
  • Allow more instance for eval instances in development
  • Increase data-plane capacity in development

Checklist (Definition of Done)

  • Unit and integration tests added
  • Added test description under Test manual
  • Documentation added if necessary (i.e. changes to dev setup, test execution, ...)
  • CI and all relevant tests are passing
  • Add the ticket number to the PR title if available, i.e. ROX-12345: ...
  • Discussed security and business related topics privately. Will move any security and business related topics that arise to private communication channel.
  • Add secret to app-interface Vault or Secrets Manager if necessary
  • RDS changes were e2e tested manually
  • Check AWS limits are reasonable for changes provisioning new resources

Test manual

  • /

@SimonBaeumer SimonBaeumer requested a review from ludydoo November 2, 2023 15:17
@SimonBaeumer SimonBaeumer temporarily deployed to development November 2, 2023 15:17 — with GitHub Actions Inactive
@SimonBaeumer SimonBaeumer requested a review from kovayur November 2, 2023 15:17
@SimonBaeumer SimonBaeumer temporarily deployed to development November 2, 2023 15:17 — with GitHub Actions Inactive
@openshift-ci openshift-ci bot added the approved label Nov 2, 2023
@SimonBaeumer SimonBaeumer temporarily deployed to development November 2, 2023 15:17 — with GitHub Actions Inactive
@SimonBaeumer SimonBaeumer changed the title Add pprof server to fleet-manager Add pprof server to fleet-manager and unlimited evals in testing&develop Nov 2, 2023
@SimonBaeumer SimonBaeumer requested a review from ebensh November 2, 2023 15:17
@@ -3,6 +3,7 @@ package services
import (
"context"
"fmt"
"github.com/stackrox/acs-fleet-manager/pkg/environments"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import should be in the block below no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sí, done

}

func (p *PprofServer) Listen() (net.Listener, error) {
return nil, nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the listener here for the pprof server ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because Listen-func is used only for Listen and not for starting the server. Only the API Server uses the Listen function.

See docs here on the funs for more info:

// Listen only starts the listener, not the server.
// Useful for breaking up ListenAndServer (Start) when you require the server to be listening before continuing
func (s *APIServer) Listen() (listener net.Listener, err error) {
l, err := net.Listen("tcp", s.serverConfig.BindAddress)
if err != nil {
return l, fmt.Errorf("starting the listener: %w", err)
}
return l, nil
}
// Start ...
func (s *APIServer) Start() {
go s.Run()
}
// Run Start listening on the configured port and start the server. This is a convenience wrapper for Listen() and Serve(listener Listener)
func (s *APIServer) Run() {
listener, err := s.Listen()
if err != nil {
glog.Fatalf("Unable to start API server: %s", err)
}
// Before we start processing requests, wait
// for the server to be ready to run.
for _, condition := range s.readyConditions {
condition.Wait()
}
s.Serve(listener)
}

Comment on lines 1483 to 1495
- apiVersion: v1
kind: Service
metadata:
name: fleet-manager-pprof
labels:
app: fleet-manager
port: pprof
spec:
selector:
app: fleet-manager
ports:
- port: 6060
targetPort: 6060
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about creating a service for it. Because fleet-manager runs with multiple replicas, we never know which one we hit. We should just do a port forward and use that rather than creating a service for it ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, removed it!

Copy link
Contributor

@kovayur kovayur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I echo Ludovic's review

Copy link
Contributor

openshift-ci bot commented Nov 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ludydoo, SimonBaeumer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [SimonBaeumer,ludydoo]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@SimonBaeumer SimonBaeumer merged commit bc7c229 into main Nov 13, 2023
6 checks passed
@SimonBaeumer SimonBaeumer deleted the sb/add-pprof-server branch November 13, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants