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/traffic proto #4095

Merged
merged 10 commits into from
Oct 16, 2023
Merged

Feat/traffic proto #4095

merged 10 commits into from
Oct 16, 2023

Conversation

bxy4543
Copy link
Member

@bxy4543 bxy4543 commented Oct 16, 2023

🤖 Generated by Copilot at 088b70c

Summary

🚀🌐🧹

This pull request improves the controllers package by adding support for kubeblocks backup jobs and network traffic queries, using gRPC to communicate with the sealos network manager service, and updating the comments, dependencies, and environment variables. It also cleans up some unused and outdated code and comments in the database and resources packages.

We're breaking the sealos, we're querying the traffic
We're refactoring the code, we're cleaning up the Kubefile
We're adding new dependencies, we're handling new price types
We're translating the comments, we're rocking the resources

Walkthrough

  • Add support for querying network traffic data from the sealos network manager service and using it for billing calculation (link,link,link,link,link,link,link,link,link,link,link,link)
  • Refactor the function podResourceUsage to separate the logic of getting the resource usage data from the logic of inserting them into the database, and rename it to getResourceUsage (link,link,link,link,link)
  • Rename the function podResourceUsage to podResourceUsageInsert to reflect its purpose of inserting the pod resource usage data into the database (link,link)
  • Modify the price type for the network bandwidth resource from AVG to DIF, which represents the difference between the maximum and minimum values of the resource usage metric (link,link,link)
  • Add a field labels to the type ResourceNamed to store the labels of the resource object, and use it for querying the network traffic data from the sealos network manager service (link,link)
  • Add a constant KubeBlocksBackUpName to represent the name of the backup job for kubeblocks data, and handle it in the NewResourceNamed function (link,link)
  • Translate comments from Chinese to English in various files and functions (link,link,link,link,link,link,link,link,link,link,link,link)
  • Remove comments that are written in Chinese and describe the logic of generating billing data based on type, name, and namespace (link)
  • Add comments with TODO tags to indicate that the logging statements below should be deleted later (link,link)
  • Add a dependency to the package github.com/dinoallo/sealos-networkmanager-protoapi in the go.mod file of the package controllers/pkg, which provides the protobuf definitions and generated code for the sealos network manager service (link,link)
  • Remove unused import statements from various files and packages (link,link)
  • Add, remove, or update checksums for various packages in the go.work.sum file, based on the changes in the dependencies (link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link)
  • Remove some constants from the package resources that are related to the database and collection names, as they are moved to the package database (link)
  • Remove some code from the package resources that is related to the infra resource usage, as it is not used in the current logic (link,link,link,link)
  • Remove the unused parameter ctx from the function getGPUResourceUsage (link)
  • Add a line to the function initResources to initialize the resources.ResourceNetwork key in the resource usage map with a zero quantity (link)

@bxy4543 bxy4543 added this to the v5.0 milestone Oct 16, 2023
@bxy4543 bxy4543 requested a review from lingdie October 16, 2023 02:03
@sealos-ci-robot
Copy link
Member

sealos-ci-robot commented Oct 16, 2023

🤖 Generated by lychee action

Summary

Status Count
🔍 Total 956
✅ Successful 375
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 580
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

@sweep-ai
Copy link

sweep-ai bot commented Oct 16, 2023

Apply Sweep Rules to your PR?

  • Apply: Leftover TODOs in the code should be handled.
  • Apply: All new business logic should have corresponding unit tests in the tests/ directory.
  • Apply: Any clearly inefficient or repeated code should be optimized or refactored.

@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

All modified lines are covered by tests ✅

📢 Thoughts on this report? Let us know!.

@bxy4543 bxy4543 force-pushed the feat/traffic_proto branch from 586d999 to 66eaac4 Compare October 16, 2023 06:44
@lingdie lingdie merged commit a3728ec into labring:main Oct 16, 2023
32 checks passed
@bxy4543 bxy4543 deleted the feat/traffic_proto branch October 16, 2023 08:54
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