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

support k8s websockets #1750

Merged

Conversation

christianvogt
Copy link
Contributor

@christianvogt christianvogt commented Sep 5, 2023

Closes: #1138

Description

Adds support for dynamic-plugin-sdk useK8sWatchResource using web sockets.

Note that this PR only adds support for web sockets but does not introduce any usage of web sockets to the application.

Backend:

  • Bump fastify to latest versions.
  • Add dependency @fastify/websocket.
  • Introduce a websocket proxy for route /wss/k8s.
  • Removed the work around for safeURLPassThrough as the related bug has been fixed in the dynamic-plugin-sdk.
  • Created a work around for https://issues.redhat.com/browse/RHCLOUD-28058
    • Return an empty response after successfully deleting a k8s resource.

Frontend:

  • Bumps dynamic-plugin-sdk and @openshift/dynamic-plugin-sdk-utils to latest versions.
  • This gives us access to the latest APIs which allow for static models to be used to bypass API discovery.
  • Isolates the dynamic-plugin-sdk redux store from our own by creating a custom redux context for ODH dashboards.
  • Add dev webpack proxy for websockets.

How Has This Been Tested?

Ad hoc testing with custom test page.
Smoke test current app.

Test Impact

None.

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Commits have been squashed into descriptive, self-contained units of work (e.g. 'WIP' and 'Implements feedback' style messages have been removed)
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit tests & storybook for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change (find relevant UX in the SMEs section).

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@christianvogt
Copy link
Contributor Author

/hold Target branch is TBD.

@openshift-ci openshift-ci bot added the do-not-merge/hold This PR is hold for some reason label Sep 5, 2023
@christianvogt christianvogt force-pushed the websockets branch 3 times, most recently from 3583677 to 42034c3 Compare September 5, 2023 21:47
@lucferbux
Copy link
Contributor

/hold Target branch is TBD.

I would say that this should go to something like f/performance since that's the main goal of it, let me create a tracker to sum up all the performance work we have at the moment.
@andrewballantyne What do you think?

@andrewballantyne
Copy link
Member

That works for me -- we should also talk about our merging strategy more -- I demoed a loose idea this morning but the process needs work. Things that are not feature roadmap items can't live in incubation forever. But that feature branch can be done now and we can work to improve the process behind the scenes.

@andrewballantyne andrewballantyne added the pr/no-tests-allowed Added by an official approver - this PR is allowed no tests. Omitted, a test must accompany the PR label Sep 7, 2023
@christianvogt christianvogt changed the base branch from main to f/performance September 7, 2023 21:14
@christianvogt christianvogt removed the do-not-merge/hold This PR is hold for some reason label Sep 7, 2023
backend/src/app.ts Outdated Show resolved Hide resolved
@lucferbux
Copy link
Contributor

That works for me -- we should also talk about our merging strategy more -- I demoed a loose idea this morning but the process needs work. Things that are not feature roadmap items can't live in incubation forever. But that feature branch can be done now and we can work to improve the process behind the scenes.

Yes, we can have a sprint for stability or something and then merge the feature branch, I'm open to any idea here.

@lucferbux
Copy link
Contributor

First rundown seems ok, I'm gonna try to get some time today or tomorrow to give a deeper look just in case.

Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

/lgtm
Tested, running successfully, nothing is broken.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: DaoDaoNoCode

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:

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

@openshift-merge-robot openshift-merge-robot merged commit 78398bc into opendatahub-io:f/performance Sep 25, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm pr/no-tests-allowed Added by an official approver - this PR is allowed no tests. Omitted, a test must accompany the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Investigate]: Websockets - The What, The How, The When
5 participants