Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Feat/cluster online offline#339

Merged
nxtcoder17 merged 3 commits into
mainfrom
feat/cluster-online-offline
Jun 17, 2024
Merged

Feat/cluster online offline#339
nxtcoder17 merged 3 commits into
mainfrom
feat/cluster-online-offline

Conversation

@nxtcoder17
Copy link
Copy Markdown
Member

@nxtcoder17 nxtcoder17 commented Jun 17, 2024

Resolves kloudlite/kloudlite#235

Summary by Sourcery

This pull request introduces new gRPC methods and message types for marking clusters as online, adds a LastOnlineAt field to track the last online timestamp for clusters, and implements corresponding GraphQL resolvers. It also includes various enhancements such as updating the protoc version, improving connection handling in tenant-agent, and refactoring server initialization in message-office.

  • New Features:
    • Introduced new gRPC methods and message types for marking clusters as online, including MarkClusterOnlineAtIn and MarkClusterOnlineAtOut.
    • Added LastOnlineAt field to Cluster and BYOKCluster entities to track the last online timestamp.
    • Implemented new GraphQL resolvers for LastOnlineAt field in Cluster and BYOKCluster.
  • Enhancements:
    • Updated grpc-interfaces to use protoc version v4.24.4.
    • Enhanced grpcServer in message-office to include infraClient for marking clusters as online.
    • Refactored NewMessageOfficeServer to accept infraConn for initializing infraClient.
    • Improved grpcHandler in tenant-agent to handle connection timeouts and retries more gracefully.
    • Removed redundant cache logic in envTargetNamespace method of console domain.
  • Build:
    • Updated Taskfile.yml to include grpc-interfaces taskfile.

Office

- whenever `kloudlite-agent` from a tenant-cluster, connects to Message
  Office, the cluster is marked as online, and current timestamp is
  stored as `LastOnlineTime`
- auto disconnection after `MaxConnectionDuration` (default: 45
  seconds), helps with message office load-balancing, and frequent
  checks for cluster online/offline status
@nxtcoder17 nxtcoder17 requested a review from karthik1729 as a code owner June 17, 2024 11:38
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jun 17, 2024

Reviewer's Guide by Sourcery

This pull request implements the feature to mark clusters as online or offline. It introduces new gRPC message types and methods for marking clusters online, updates the domain logic to handle the new functionality, and integrates the changes into the message-office service. Additionally, it updates the protoc version across multiple gRPC interface files.

File-Level Changes

Files Changes
grpc-interfaces/infra/infra.pb.go
grpc-interfaces/infra/infra_grpc.pb.go
Updated protoc version and added new message types and methods for MarkClusterOnlineAt.
apps/infra/internal/app/graph/generated/generated.go
apps/infra/internal/app/graph/byokcluster.resolvers.go
apps/infra/internal/app/graph/cluster.resolvers.go
Added LastOnlineAt field and resolvers for BYOKCluster and Cluster.
apps/message-office/internal/app/grpc-server.go
apps/message-office/internal/app/app.go
apps/message-office/internal/framework/framework.go
apps/message-office/internal/env/env.go
apps/message-office/main.go
Integrated infraClient into message-office service and implemented MarkClusterOnlineAt call.
apps/infra/internal/domain/clusters.go
apps/infra/internal/domain/api.go
apps/infra/internal/entities/byok-cluster.go
apps/infra/internal/entities/cluster.go
apps/infra/internal/entities/field-constants/generated_constants.go
Added LastOnlineAt field to BYOKCluster and Cluster entities and implemented MarkClusterOnlineAt method in domain.
grpc-interfaces/container_registry/container-registry.pb.go
grpc-interfaces/container_registry/container-registry_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/accounts/accounts.pb.go
grpc-interfaces/kloudlite.io/rpc/accounts/accounts_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/agent/kubeagent.pb.go
grpc-interfaces/kloudlite.io/rpc/agent/kubeagent_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/auth/auth.pb.go
grpc-interfaces/kloudlite.io/rpc/auth/auth_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/ci/ci.pb.go
grpc-interfaces/kloudlite.io/rpc/ci/ci_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/comms/comms.pb.go
grpc-interfaces/kloudlite.io/rpc/comms/comms_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/console/console.pb.go
grpc-interfaces/kloudlite.io/rpc/console/console_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/dns/dns.pb.go
grpc-interfaces/kloudlite.io/rpc/dns/dns_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/finance/finance-infra.pb.go
grpc-interfaces/kloudlite.io/rpc/finance/finance-infra_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/finance/finance.pb.go
grpc-interfaces/kloudlite.io/rpc/finance/finance_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/iam/iam.pb.go
grpc-interfaces/kloudlite.io/rpc/iam/iam_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/jseval/jseval.pb.go
grpc-interfaces/kloudlite.io/rpc/jseval/jseval_grpc.pb.go
grpc-interfaces/kloudlite.io/rpc/message-office-internal/message-office-internal.pb.go
grpc-interfaces/kloudlite.io/rpc/message-office-internal/message-office-internal_grpc.pb.go
Updated protoc version from v5.26.1 to v4.24.4.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

@nxtcoder17 nxtcoder17 self-assigned this Jun 17, 2024
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @nxtcoder17 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@nxtcoder17 nxtcoder17 merged commit 7a474fa into main Jun 17, 2024
@nxtcoder17 nxtcoder17 deleted the feat/cluster-online-offline branch June 17, 2024 11:40
abdheshnayak pushed a commit that referenced this pull request Nov 5, 2024
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.

cluster online/offline status

1 participant