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 go profiling for CI NSM images #85

Open
denis-tingaikin opened this issue Feb 1, 2022 · 1 comment
Open

Add go profiling for CI NSM images #85

denis-tingaikin opened this issue Feb 1, 2022 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@denis-tingaikin
Copy link
Member

denis-tingaikin commented Feb 1, 2022

To improve our CI testing we can add a CPU/memory profile capturing for each NSM application via docker target stage. This will allow us to detect memory/cpu regressions or improvements.

Implementation details

  1. Add for each application a new target ci
FROM go as ci
WORKDIR /build
COPY go.mod go.sum ./
COPY ./internal/imports imports
RUN go build ./imports
COPY . .
# TODO: Consider about adding a race flag
RUN go build -tags=ci -o /bin/app .
# TODO: correct this:
ENTRYPOINT ["go", "tool pprof app profile.output"]
  1. Add build tags based main.go for the application that will include import _ "net/http/pprof"
  2. Build image for the /ci with --target ci
  3. Add storing profile.output into https://github.com/networkservicemesh/integration-tests/tree/main/extensions/logs on test cleanup as CI artifact.
@denis-tingaikin denis-tingaikin added this to the v1.3.0 milestone Feb 1, 2022
@denis-tingaikin denis-tingaikin added the enhancement New feature or request label Feb 1, 2022
@denis-tingaikin denis-tingaikin changed the title Add ci docker image target for each application to capture memory and cpu usage Add go profiling for CI NSM images Feb 1, 2022
@denis-tingaikin
Copy link
Member Author

@edwarnicke Can we schedule this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Blocked
Development

No branches or pull requests

1 participant