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

Print K8s Resolver Event for Agent Grpc request debugging #6146

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Future-Outlier
Copy link
Member

@Future-Outlier Future-Outlier commented Jan 8, 2025

Tracking issue

#3936

Why are the changes needed?

k8s resolver might fail if we set the wrong deployment endpoint for agent service, print what error happened will be super helpful.

What changes were proposed in this pull request?

print service namespace, service name, and response event.

How was this patch tested?

build a propeller image and tested in private cluster.

Setup process

alias dbxt="docker buildx build --platform linux/amd64 -t ";  # --platform linux/amd64
alias dp="docker push"
dbxt futureoutlier/flytepropeller:k8s-resolver-2025-0108-1147 -f Dockerfile.flytepropeller .
dp futureoutlier/flytepropeller:k8s-resolver-2025-0108-1147

use kubectl to edit the image

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Summary by Bito

Enhanced Kubernetes resolver logging in Flyte standard library by implementing detailed error logging for watcher creation failures and adding comprehensive logging for Kubernetes watcher events. Added service namespace and service name details to log messages, fixed typos, and removed redundant log statements for more concise and accurate debug information. The changes improve debugging capabilities by providing visibility into event responses, object details, and object kinds.

Unit tests added: False

Estimated effort to review (1-5, lower is better): 1

Signed-off-by: Future-Outlier <eric901201@gmail.com>
@flyte-bot
Copy link
Collaborator

flyte-bot commented Jan 8, 2025

Code Review Agent Run #37ddb4

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 6a30bd6..6a30bd6
    • flytestdlib/resolver/k8s_resolver.go
  • Files skipped - 0
  • Tools
    • Golangci-lint (Linter) - ✖︎ Failed
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • OWASP (Security Vulnerability) - ✔︎ Successful
    • GOVULNCHECK (Security Vulnerability) - ✖︎ Failed
    • SNYK (Security Vulnerability) - ✔︎ Successful

AI Code Review powered by Bito Logo

@flyte-bot
Copy link
Collaborator

flyte-bot commented Jan 8, 2025

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Feature Improvement - Enhanced K8s Resolver Logging

k8s_resolver.go - Added detailed logging for K8s resolver events, errors, and service details

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 30.76923% with 9 lines in your changes missing coverage. Please review.

Project coverage is 37.02%. Comparing base (27c9edd) to head (4796e96).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
flytestdlib/resolver/k8s_resolver.go 30.76% 9 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6146   +/-   ##
=======================================
  Coverage   37.01%   37.02%           
=======================================
  Files        1317     1317           
  Lines      132523   132534   +11     
=======================================
+ Hits        49060    49066    +6     
- Misses      79217    79221    +4     
- Partials     4246     4247    +1     
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 54.25% <ø> (+0.02%) ⬆️
unittests-flytecopilot 30.99% <ø> (ø)
unittests-flytectl 62.29% <ø> (ø)
unittests-flyteidl 7.23% <ø> (ø)
unittests-flyteplugins 53.85% <ø> (ø)
unittests-flytepropeller 42.64% <ø> (ø)
unittests-flytestdlib 55.08% <30.76%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

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

thank you for adding this

@@ -166,6 +177,11 @@ func (k *kResolver) run() {
case <-k.ctx.Done():
return
case event, ok := <-watcher.ResultChan():
logger.Info(k.ctx, "k8s resolver watchet event response: [%v]", event)
Copy link
Member

Choose a reason for hiding this comment

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

Will it print the event.Object? If so, I think we can remove line 181 and 182

Signed-off-by: Future-Outlier <eric901201@gmail.com>
@flyte-bot
Copy link
Collaborator

flyte-bot commented Jan 10, 2025

Code Review Agent Run #6076da

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 6a30bd6..4796e96
    • flytestdlib/resolver/k8s_resolver.go
  • Files skipped - 0
  • Tools
    • Golangci-lint (Linter) - ✖︎ Failed
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

AI Code Review powered by Bito Logo

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.

3 participants