Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Rework reading pod's information for resource monitor plugin #1089

Merged
merged 9 commits into from
May 7, 2021

Conversation

svor
Copy link
Contributor

@svor svor commented Apr 22, 2021

Signed-off-by: svor [email protected]

What does this PR do?

Rework the process of reading pod's information for resource monitor plugin

Screenshot/screencast of this PR

Tested on local minikube and on OCP 4.6.24

screenshot-nimbus-capture-2021 04 22-13_19_27

What issues does this PR fix or reference?

eclipse-che/che#18812

How to test this PR?

This PR depends on eclipse-che/che-operator#793 and eclipse-che/che#19651

To test this PR need to deploy che with custom che-operator image which should include changes from eclipse-che/che-operator#793 and custom cheimage which should include changes from eclipse-che/che#19651.

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Happy Path Channel

HAPPY_PATH_CHANNEL=stable

@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #1089 (1600476) into master (eeb4526) will increase coverage by 2.76%.
The diff coverage is 55.35%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1089      +/-   ##
==========================================
+ Coverage   29.45%   32.21%   +2.76%     
==========================================
  Files         277      281       +4     
  Lines        9336     9541     +205     
  Branches     1380     1377       -3     
==========================================
+ Hits         2750     3074     +324     
+ Misses       6487     6465      -22     
+ Partials       99        2      -97     
Impacted Files Coverage Δ
...theia-about/src/browser/about-che-theia-dialog.tsx 0.00% <ø> (ø)
...ovisioner/src/node/git-configuration-controller.ts 0.00% <0.00%> (ø)
...eia-plugin-remote/src/node/hosted-plugin-remote.ts 0.00% <0.00%> (ø)
...theia-plugin-remote/src/node/plugin-host-custom.ts 0.00% <0.00%> (ø)
...in-remote/src/node/plugin-remote-backend-module.ts 0.00% <0.00%> (ø)
...theia-plugin-remote/src/node/plugin-remote-init.ts 0.00% <0.00%> (ø)
...-che-theia-plugin-remote/src/node/plugin-remote.ts 0.00% <0.00%> (ø)
...ugin-remote/src/node/server-plugin-proxy-runner.ts 0.00% <0.00%> (ø)
...plugin-remote/src/node/terminal-container-aware.ts 0.00% <0.00%> (ø)
...a-plugin-remote/src/node/webviews-content-aware.ts 0.00% <0.00%> (ø)
... and 110 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a0e12b3...1600476. Read the comment docs.

@che-bot

This comment has been minimized.

Copy link
Contributor

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

hi, why the plug-in can't get the pod using the kubernetes API instead of adding a getPod method to the che API ?

@svor
Copy link
Contributor Author

svor commented Apr 22, 2021

hello @benoitf, thank you for the review.
As I remember we decided to not add k8s API library as a dependency into the plugin to avoid some extra memory requirements. Why do you find it as a problemm I mean to add a method into che API. The implementation of this method is using k8s API and all plugins can reuse this method easely

@benoitf
Copy link
Contributor

benoitf commented Apr 22, 2021

hi @svor what is worrying me is that we return undefined any type so it's hard to know from consumer what you're handling and how to know what is inside this struct.

if a plug-in uses the kubernetes API then they can grab any information they want from the cluster, not only pods

@svor
Copy link
Contributor Author

svor commented Apr 22, 2021

hi @svor what is worrying me is that we return undefined any type so it's hard to know from consumer what you're handling and how to know what is inside this struct.

It is not a problem, we can return an object, I'll rework it

@svor svor requested a review from benoitf May 6, 2021 08:32
Copy link
Contributor

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

Hello,

HlqRxprPWo.mp4

when testing, when workspace is starting, I've for some time a "No resource available" with a 404 error
So I don't know if it's because plug-in do not wait some events to start ?

@svor
Copy link
Contributor Author

svor commented May 6, 2021

@benoitf The plugin tries to read metrics of workspace pod from Metrics server if it is alive. There are no some special events to wait, probably, when the workspace just started, Metrics server doesn't have information about workspace pod (it is not ready yet), that's why it returns 404. But when it will be available, we can see it on the status bar. I don't find it as a problem, do you think it is not user friendly?

@benoitf
Copy link
Contributor

benoitf commented May 6, 2021

@svor yes I don't think it's user friendly so maybe we wait to display information instead of saying it's not there and we can see 404 errors (can be a follow up)

Copy link
Contributor

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

user experience might be improved when starting a workspace but can be a follow-up

@artaleks9
Copy link

[crw-ci-test --rebuild]

@che-bot

This comment has been minimized.

@svor
Copy link
Contributor Author

svor commented May 6, 2021

@benoitf what do you think about this version, is it better? (it has big resolution but I hope you can detect changes :-) ):

screencast-che-eclipse-che.192.168.99.208.nip.io-2021.05.06-15_48_50.mp4

@benoitf
Copy link
Contributor

benoitf commented May 6, 2021

@svor yes much better, also if we do know metrics are coming, we could display Initializing or Waiting metrics... in the output (and/or display spinner icon)

@che-bot

This comment has been minimized.

@che-bot
Copy link
Contributor

che-bot commented May 6, 2021

✅ E2E Happy path tests succeed 🎉

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:1089
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:1089

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@svor svor merged commit 82371d2 into eclipse-che:master May 7, 2021
@che-bot che-bot added this to the 7.31 milestone May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants