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

feat: adds redhat-resource-optimization plugin #810

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

jkilzi
Copy link
Contributor

@jkilzi jkilzi commented Aug 5, 2024

Hey, I just made a Pull Request!

Based on Project Koku, the Resource Optimization plugin allows users to visualize usage trends and receive optimization recommendations for containers running on OpenShift clusters.

image
image

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@jkilzi jkilzi requested review from backstage-service and a team as code owners August 5, 2024 15:47
@jkilzi jkilzi requested a review from BethGriggs August 5, 2024 15:47
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Aug 5, 2024

Changed Packages

Package Name Package Path Changeset Bump Current Version
app workspaces/redhat-resource-optimization/packages/app none v0.0.0
backend workspaces/redhat-resource-optimization/packages/backend none v0.0.0
@backstage-community/plugin-redhat-resource-optimization-backend workspaces/redhat-resource-optimization/plugins/redhat-resource-optimization-backend major v0.1.0
@backstage-community/plugin-redhat-resource-optimization-common workspaces/redhat-resource-optimization/plugins/redhat-resource-optimization-common major v0.1.0
@backstage-community/plugin-redhat-resource-optimization workspaces/redhat-resource-optimization/plugins/redhat-resource-optimization major v0.1.0

@jkilzi jkilzi force-pushed the resource-optimization/stable branch 2 times, most recently from 0045dcc to 20ab6c3 Compare August 5, 2024 17:20
.github/CODEOWNERS Outdated Show resolved Hide resolved
@BethGriggs
Copy link
Collaborator

BethGriggs commented Aug 6, 2024

One last comment, from reading I gather the implementation is OpenShift specific - is that correct? If so, I wonder if /workspaces/resource-optimization and @backstage-community/plugin-resource-optimization are slightly too generic and we should include openshift in the naming. As this is under a community namespace/shared scope we may need to be more specific.

@jkilzi
Copy link
Contributor Author

jkilzi commented Aug 6, 2024

One last comment, from reading I gather the implementation is OpenShift specific - is that correct? If so, I wonder if /workspaces/resource-optimization and @backstage-community/plugin-resource-optimization are slightly too generic and we should include openshift in the naming. As this is under a community namespace/shared scope we may need to be more specific.

Makes sense. Let me get back to you on this.

@jkilzi
Copy link
Contributor Author

jkilzi commented Aug 6, 2024

One last comment, from reading I gather the implementation is OpenShift specific - is that correct? If so, I wonder if /workspaces/resource-optimization and @backstage-community/plugin-resource-optimization are slightly too generic and we should include openshift in the naming. As this is under a community namespace/shared scope we may need to be more specific.

Makes sense. Let me get back to you on this.

We'll change the workspace name and the pluginId to redhat-resource-optimization since it will provide optimization recommendations for other Red Hat products and services in the future.

@jkilzi jkilzi marked this pull request as draft August 6, 2024 19:50
@jkilzi jkilzi marked this pull request as ready for review August 6, 2024 19:56
@jkilzi jkilzi requested a review from BethGriggs August 6, 2024 19:56
@backstage-goalie
Copy link
Contributor

Thanks for the contribution!
All commits need to be DCO signed before they are reviewed. Please refer to the the DCO section in CONTRIBUTING.md or the DCO status for more info.

@jkilzi jkilzi force-pushed the resource-optimization/stable branch 4 times, most recently from ab3e260 to 97573c8 Compare August 6, 2024 21:09
@jkilzi
Copy link
Contributor Author

jkilzi commented Aug 6, 2024

@BethGriggs, the only pending topic right now is about the codeowners file.
All the other review comments have been addressed.

@jkilzi jkilzi force-pushed the resource-optimization/stable branch 2 times, most recently from 48e02c3 to 1dd46f4 Compare August 8, 2024 06:00
@BethGriggs
Copy link
Collaborator

I think the last step is to resolve the issue with M .yarn/install-state.gz causing CI failures:

Run if files=$(git ls-files --exclude-standard --others --modified) && [[ -z "$files" ]]; then

Working directory has been modified:

 M .yarn/install-state.gz

jkilzi and others added 2 commits August 8, 2024 11:23
- (refactor) Adds the new workspace's lockfile
- (refactor) adds the cost-management FE plugin
- (refactor) removes react-dom and react-router-dom from the peerDeps
- (refactor) updates yarn.lock
- (refactor) adds a basic app-config.yaml with untested proxy settings
- (refactor) adds cost-management-client
- (refactor) adds CostManagementIcon.tsx
- (refactor) adds sample packages/app and packages/backend
- (refactor) converts the cost-management client into the recommendations client
- (refactor) Introduces the combined cost-management client
- (fix) fixes issues with overlapping symbols
- (refactor) Refactors the cost-management plugin
- (refactor) Renames the cost-management-client package to cost-management-common
- (refactor) Renames src/api/ApiRefs.ts to src/api/ref.ts
- (refactor) simplifies getting the proxy's baseUrl
- (fix) fixes the client generator script
- (refactor) Adds changeOrigin to the proxy settings
- (refactor) created first page using material UI components
- (refactor) updated config for FE
- (refactor) removed custom webpack config file
- consuming API response in the table
- (refactor) added util method to handle API JSON response
- (refactor) introduces JSONUtils.toCamelCaseObjectKeys
- (refactor) adds new workspace for resource-optimization
- (refactor) adds placeholder for the FE and Common plug-ins
- (refactor) adds app-config.yaml
- (refactor) adds react-related missing peer-deps
- (refactor) adds resource-optimization-common as a dependency to the FE plug-in
- (refactor) adds a sample app and backend for showcase purposes
- (refactor) Adds also a PoC for the plugin icon
- (refactor) migrates the old common package to resource-optimization
- (fix) fixes an eslint issue related to lodash
- (refactor) updates the icon snapshot
- (refactor) updates json.test.ts
- (refactor) adds initial code for the BE plugin
- (fix) fixes the plugin icon
- (refactor) changes the plugin name in the navbar
- (refactor) adds 2 variants for the plugin icon
- (refactor) added UI for the first page of resource optimization plugin & fixed endpoint in config (#2)
- (fix) fixes an issue in toCamelCaseObjectKeys function
- (refactor) introduces the resource-optimization-backend
- (fix) fixes the token renewal mechanism
- (refactor) Improved the keys serialization/deserialization issue (use camelCase when receiving, but snake_case when sending data)
- (refactor) The plugin can read the clientId and clientSecret from the app-config.yaml
- (refactor) Cleans up the ExampleComponent.tsx
- (refactor) makes ssoBaseUrl config optional
- (refactor) cleans up ExampleComponent.tsx a bit more
- (refactor) add assertion to ensure config is defined
- (refactor) replaces json utils with jsr:@y0n1/json
- (fix) : fix missing query params after token expires
- (feat) RHINENG-10603 first page table functionality - Pagination + Sorting (#3)
- (feat) RHINENG-10603 first page table functionality
- (fix) minor fixes
- (refactor) code refactoring for landing page table
- (refactor) handling offset and sorting query params and code cleanup
- (refactor) disable third sort on table component
- (refactor) added unit tests and code cleanup
- (refactor) improved landing page layout
- (fix) fixes unit tests
- (feat) RHINENG-10603 landing page filters functionality (#4)
- (feat) RHINENG-10603 added search filter component and filters functionality
- (fix) fixes the issue with the query params in getRecommendationsList
- (feat) RHINENG-10787 detail page top section and recommendation section (#5)
- (feat) RHINENG-10787 detail page top section and UI
- (refactor) removed memoryUnit & cpuUnit from query
- (refactor) code cleanup
- (fix) fixes cluster filter and detail page values
- (refactor) added util method to handle YAML code generation from API response
- (refactor) ignores dynamic-plugins dist directory globally
- (refactor) adds janus-cli and export-dynamic scripts
- (refactor) removes ExampleFetchComponent
- (refactor) updates apis.ts
- (fix) do not convert the recommendations_id param to snake case
- (fix) fixes tsc, linting and formatting issues
- (fix) fixes some issues related to different types of dependencies
- (fix) pathes PlotDetails model
- (fix) stop depending on @mui/material and remove white bg from search filters
- (refactor) patches all the parameters of getRecommendationById
- (refactor) Applies required refactors for compatibility with dynamic plugins (#6)
- (refactor) adds @backstage/backend-dynamic-feature-service
- (refactor) adds rhdh theme
- (refactor) adds devcontainer config
- (refactor) removes leftovers froms the cost-management workspace
- (refactor) updates resource-optimization frontend
- (refactor) adds configuration files for rhdh
- (refactor) Update workspaces/resource-optimization/plugins/resource-optimization/src/plugin.ts
- (refactor) adds devcontainer config
- (refactor) adds deployment scripts
- (refactor) adds export-dynamic top-level script
- (fix) fixes issues related to dependencies
- (refactor) removes the dynamic-plugins integration from the backend package
- (fix) fixes linting and type-checking issues
- (refactor) exports the icon from the front-end plugin
- (refactor) Updates yarn.lock
- (fix) fixes some type-only import statements
- (chore) sync @backstage-community/plugin-resource-optimization-backend
- (fix) fixes style issues
- (fix) fixes an issue related to the api-report generation, see: backstage/backstage#25671
- (refactor) renames useRhdhTheme.ts to rhdh-theme.ts
- (chore) cleans up devcontainer settings and code-workspace file
- (fix) fixes style issues and generates api-report
- (fix) fixes code style and adds the api-report
- (fix) fixes code style and adds the api-report
- (refactor) Updates resource-optimization-common
- (chore) Patches the generated client code with ts-morph
- (style) The code now complies with the rules of the api-report (via `yarn build:api-reports`)
- (refactor) Adds the api-report
- (refactor) Updates the openapi.yaml
- (refactor) Renames OrchestratorClient to OrchestratorApiClientProxy
- (refactor) Updates resource-optimization
- (refactor) Aligns the code according to the refactor in resource-optimization-common
- (fix) detail page tab routing (#8)
- (fix) detail page tab routing
- (style) yarn fix resource-optimization-common
- (fix) prettier & add prettier format script
- (refactor) Update workspaces/resource-optimization/package.json
- (refactor) updated api-reports.md
- (refactor) updates api-reports
- (fix) fixes the presentation in the last_reported column
- (fix) fixes code style issues
- (fix) code-style
- (refactor) Renames serializer.mjs to yaml.mjs
- (chore) Bumps Backstage to 1.29.2, see https://backstage.io/docs/releases/v1.28.0
- (fix) fixes the "publish check" CI step failure
- (fix) bug fixes
- (fix) Solves an issue related to the recommendation plotData object where the object keys were transformed incorrectly
- (refactor) Bumps @y0n1/json to 2.0.0
- (refactor) Adds msw for writing tests for the client proxy module
- (refactor) RHINENG-10789 added compont for showing box plot charts (#12)
- (refactor) RHINENG-10789 added compont for showing box plot charts
- (refactor) added missing keys for messages
- (style) prettier format and fix
- (fix) fixes types errors
- (fix) minor fixes
- (fix) minor fixes for showing YAML code
- (refactor) added charts for limit and request data, performace section
- (fix) adds yarn.lock
- (fix) fixes types errors
- (fix) styles for chart y axis numbering
- (fix) minor fixes
- (refactor) Adds tests for OptimizationsApiClientProxy.ts
- (docs) Adds READMEs and legal stuff (#15)
- (fix) fixes a typo
- (refactor) updates the readme
- (refactor) adds missing info about the service account role
- (refactor) Updates useRhdhTheme.ts (#16)
- (refactor) Removes the logic involved in enabling the RHDH theme based on an environment variable
- (refactor) updates devcontainer settings
- (refactor) updates the workspace readme
- (refactor) adds the changeset
- (refactor) RHINENG-11783 removed example component and searchFilter component (#17)
- (refactor) renames the plugin to redhat-resource-optimization (#18)
- (refactor) Addresses overlooked code style issues
- (refactor) updates CODEOWNERS
- (refactor) update yarn install stat

Signed-off-by: Jonathan Kilzi <jkilzi@redhat.com>
Co-authored-by: Preeti Wadhwani <pwadhwan@redhat.com>
Signed-off-by: Jonathan Kilzi <jkilzi@redhat.com>
Signed-off-by: Jonathan Kilzi <jkilzi@redhat.com>
@jkilzi jkilzi force-pushed the resource-optimization/stable branch from 1dd46f4 to 9a519b0 Compare August 8, 2024 11:32
@jkilzi jkilzi changed the title Adds the resource-optimization community plugin feat: adds redhat-resource-optimization plugin Aug 8, 2024
@jkilzi jkilzi requested a review from BethGriggs August 8, 2024 11:33
Copy link
Collaborator

@BethGriggs BethGriggs left a comment

Choose a reason for hiding this comment

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

Not a full review of the implementation logic, but I've skimmed each file, CI now is passing, so think we should merge and iterate.

@BethGriggs BethGriggs merged commit 02dd072 into backstage:main Aug 8, 2024
12 checks passed
kurtaking pushed a commit to kurtaking/community-plugins that referenced this pull request Aug 19, 2024
* adds the resource-optimization plugin files

- (refactor) Adds the new workspace's lockfile
- (refactor) adds the cost-management FE plugin
- (refactor) removes react-dom and react-router-dom from the peerDeps
- (refactor) updates yarn.lock
- (refactor) adds a basic app-config.yaml with untested proxy settings
- (refactor) adds cost-management-client
- (refactor) adds CostManagementIcon.tsx
- (refactor) adds sample packages/app and packages/backend
- (refactor) converts the cost-management client into the recommendations client
- (refactor) Introduces the combined cost-management client
- (fix) fixes issues with overlapping symbols
- (refactor) Refactors the cost-management plugin
- (refactor) Renames the cost-management-client package to cost-management-common
- (refactor) Renames src/api/ApiRefs.ts to src/api/ref.ts
- (refactor) simplifies getting the proxy's baseUrl
- (fix) fixes the client generator script
- (refactor) Adds changeOrigin to the proxy settings
- (refactor) created first page using material UI components
- (refactor) updated config for FE
- (refactor) removed custom webpack config file
- consuming API response in the table
- (refactor) added util method to handle API JSON response
- (refactor) introduces JSONUtils.toCamelCaseObjectKeys
- (refactor) adds new workspace for resource-optimization
- (refactor) adds placeholder for the FE and Common plug-ins
- (refactor) adds app-config.yaml
- (refactor) adds react-related missing peer-deps
- (refactor) adds resource-optimization-common as a dependency to the FE plug-in
- (refactor) adds a sample app and backend for showcase purposes
- (refactor) Adds also a PoC for the plugin icon
- (refactor) migrates the old common package to resource-optimization
- (fix) fixes an eslint issue related to lodash
- (refactor) updates the icon snapshot
- (refactor) updates json.test.ts
- (refactor) adds initial code for the BE plugin
- (fix) fixes the plugin icon
- (refactor) changes the plugin name in the navbar
- (refactor) adds 2 variants for the plugin icon
- (refactor) added UI for the first page of resource optimization plugin & fixed endpoint in config (backstage#2)
- (fix) fixes an issue in toCamelCaseObjectKeys function
- (refactor) introduces the resource-optimization-backend
- (fix) fixes the token renewal mechanism
- (refactor) Improved the keys serialization/deserialization issue (use camelCase when receiving, but snake_case when sending data)
- (refactor) The plugin can read the clientId and clientSecret from the app-config.yaml
- (refactor) Cleans up the ExampleComponent.tsx
- (refactor) makes ssoBaseUrl config optional
- (refactor) cleans up ExampleComponent.tsx a bit more
- (refactor) add assertion to ensure config is defined
- (refactor) replaces json utils with jsr:@y0n1/json
- (fix) : fix missing query params after token expires
- (feat) RHINENG-10603 first page table functionality - Pagination + Sorting (backstage#3)
- (feat) RHINENG-10603 first page table functionality
- (fix) minor fixes
- (refactor) code refactoring for landing page table
- (refactor) handling offset and sorting query params and code cleanup
- (refactor) disable third sort on table component
- (refactor) added unit tests and code cleanup
- (refactor) improved landing page layout
- (fix) fixes unit tests
- (feat) RHINENG-10603 landing page filters functionality (backstage#4)
- (feat) RHINENG-10603 added search filter component and filters functionality
- (fix) fixes the issue with the query params in getRecommendationsList
- (feat) RHINENG-10787 detail page top section and recommendation section (backstage#5)
- (feat) RHINENG-10787 detail page top section and UI
- (refactor) removed memoryUnit & cpuUnit from query
- (refactor) code cleanup
- (fix) fixes cluster filter and detail page values
- (refactor) added util method to handle YAML code generation from API response
- (refactor) ignores dynamic-plugins dist directory globally
- (refactor) adds janus-cli and export-dynamic scripts
- (refactor) removes ExampleFetchComponent
- (refactor) updates apis.ts
- (fix) do not convert the recommendations_id param to snake case
- (fix) fixes tsc, linting and formatting issues
- (fix) fixes some issues related to different types of dependencies
- (fix) pathes PlotDetails model
- (fix) stop depending on @mui/material and remove white bg from search filters
- (refactor) patches all the parameters of getRecommendationById
- (refactor) Applies required refactors for compatibility with dynamic plugins (backstage#6)
- (refactor) adds @backstage/backend-dynamic-feature-service
- (refactor) adds rhdh theme
- (refactor) adds devcontainer config
- (refactor) removes leftovers froms the cost-management workspace
- (refactor) updates resource-optimization frontend
- (refactor) adds configuration files for rhdh
- (refactor) Update workspaces/resource-optimization/plugins/resource-optimization/src/plugin.ts
- (refactor) adds devcontainer config
- (refactor) adds deployment scripts
- (refactor) adds export-dynamic top-level script
- (fix) fixes issues related to dependencies
- (refactor) removes the dynamic-plugins integration from the backend package
- (fix) fixes linting and type-checking issues
- (refactor) exports the icon from the front-end plugin
- (refactor) Updates yarn.lock
- (fix) fixes some type-only import statements
- (chore) sync @backstage-community/plugin-resource-optimization-backend
- (fix) fixes style issues
- (fix) fixes an issue related to the api-report generation, see: backstage/backstage#25671
- (refactor) renames useRhdhTheme.ts to rhdh-theme.ts
- (chore) cleans up devcontainer settings and code-workspace file
- (fix) fixes style issues and generates api-report
- (fix) fixes code style and adds the api-report
- (fix) fixes code style and adds the api-report
- (refactor) Updates resource-optimization-common
- (chore) Patches the generated client code with ts-morph
- (style) The code now complies with the rules of the api-report (via `yarn build:api-reports`)
- (refactor) Adds the api-report
- (refactor) Updates the openapi.yaml
- (refactor) Renames OrchestratorClient to OrchestratorApiClientProxy
- (refactor) Updates resource-optimization
- (refactor) Aligns the code according to the refactor in resource-optimization-common
- (fix) detail page tab routing (backstage#8)
- (fix) detail page tab routing
- (style) yarn fix resource-optimization-common
- (fix) prettier & add prettier format script
- (refactor) Update workspaces/resource-optimization/package.json
- (refactor) updated api-reports.md
- (refactor) updates api-reports
- (fix) fixes the presentation in the last_reported column
- (fix) fixes code style issues
- (fix) code-style
- (refactor) Renames serializer.mjs to yaml.mjs
- (chore) Bumps Backstage to 1.29.2, see https://backstage.io/docs/releases/v1.28.0
- (fix) fixes the "publish check" CI step failure
- (fix) bug fixes
- (fix) Solves an issue related to the recommendation plotData object where the object keys were transformed incorrectly
- (refactor) Bumps @y0n1/json to 2.0.0
- (refactor) Adds msw for writing tests for the client proxy module
- (refactor) RHINENG-10789 added compont for showing box plot charts (backstage#12)
- (refactor) RHINENG-10789 added compont for showing box plot charts
- (refactor) added missing keys for messages
- (style) prettier format and fix
- (fix) fixes types errors
- (fix) minor fixes
- (fix) minor fixes for showing YAML code
- (refactor) added charts for limit and request data, performace section
- (fix) adds yarn.lock
- (fix) fixes types errors
- (fix) styles for chart y axis numbering
- (fix) minor fixes
- (refactor) Adds tests for OptimizationsApiClientProxy.ts
- (docs) Adds READMEs and legal stuff (backstage#15)
- (fix) fixes a typo
- (refactor) updates the readme
- (refactor) adds missing info about the service account role
- (refactor) Updates useRhdhTheme.ts (backstage#16)
- (refactor) Removes the logic involved in enabling the RHDH theme based on an environment variable
- (refactor) updates devcontainer settings
- (refactor) updates the workspace readme
- (refactor) adds the changeset
- (refactor) RHINENG-11783 removed example component and searchFilter component (backstage#17)
- (refactor) renames the plugin to redhat-resource-optimization (backstage#18)
- (refactor) Addresses overlooked code style issues
- (refactor) updates CODEOWNERS
- (refactor) update yarn install stat

---------

Signed-off-by: Jonathan Kilzi <jkilzi@redhat.com>
Co-authored-by: Preeti Wadhwani <pwadhwan@redhat.com>
Signed-off-by: Kurt King <kurtaking@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants