feat(job): add job inspect command for easy diagnostics#5925
feat(job): add job inspect command for easy diagnostics#5925Neelabh94 wants to merge 10 commits into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a diagnostic tool for GKE clusters, allowing users to quickly capture cluster state, node health, and workload configurations. The new command, Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new inspect command to the gcluster job CLI, enabling comprehensive diagnostic sweeps of GKE clusters and active workloads, with output saved to a timestamped log file. The reviewer's feedback focuses on improving robustness: first, by explicitly specifying the -c manager container when retrieving Kueue and JobSet controller manager logs to prevent potential BadRequest errors; and second, by utilizing t.Cleanup in unit tests to ensure reliable cleanup of generated log files and avoid test flakiness.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new inspect command to the gcluster job CLI, allowing users to perform diagnostic sweeps of GKE cluster health and workload status. It implements the backend logic in the GKE orchestrator to run various gcloud and kubectl commands, saving the results to a timestamped log file, and adds corresponding unit tests and documentation. The reviewer suggested explicitly specifying the default namespace when retrieving cluster metadata and resource ConfigMaps to prevent failures if the active kubeconfig context is set to a different namespace.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new inspect command (gcluster job inspect) to perform diagnostic sweeps of GKE clusters and active workloads, generating a comprehensive log file. It includes the command implementation, documentation, orchestrator logic, and unit tests. The review feedback highlights an issue where the dynamically resolved workload namespace is not passed to the console link generator, resulting in broken links for workloads deployed in non-default namespaces.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'inspect' command to the 'gcluster job' CLI, allowing users to perform diagnostic sweeps of GKE clusters and workload health. It adds the 'InspectCluster' method to the GKE orchestrator, which runs various 'gcloud' and 'kubectl' commands, logs the results to a file, analyzes node health, and provides links to the Google Cloud Console. The review feedback highlights an issue with the generated workload console link, which incorrectly uses the '/kubernetes/service/' path instead of '/kubernetes/workload/details/', potentially leading to a 404 error.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new inspect subcommand to gcluster job for performing diagnostic sweeps of GKE clusters and active workloads, writing the output to a timestamped log file. The changes include the CLI command implementation, orchestrator integration, comprehensive unit tests, and updated documentation. Feedback on the implementation highlights a bug where g.kubeClient is not initialized during cluster inspection, which causes namespace auto-discovery to always fail and default to 'default'; utilizing the existing g.getJobNamespace helper is recommended to resolve this.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new inspect command to the gcluster job CLI, enabling diagnostic sweeps of GKE clusters and workloads. The changes include the CLI command registration, documentation in gcluster_job_guide.md, the core inspection logic in pkg/orchestrator/gke/inspector.go (which collects gcloud/kubectl outputs, analyzes node counts, and generates console links), and corresponding unit tests. As there are no review comments provided, I have no feedback to address.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new gcluster job inspect command to perform diagnostic sweeps of GKE clusters and workloads, saving the results to a timestamped log file. The feedback points out that Kueue workload names generated by the JobSet controller include a random suffix, meaning a direct query for jobset-%s will fail with a NotFound error. It is recommended to use the existing findTargetWorkload helper to resolve the correct workload name.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new inspect command to the gcluster job CLI, allowing users to perform diagnostic sweeps of GKE clusters and workloads. It includes the CLI command definition, documentation, unit tests, and the core implementation that runs various gcloud and kubectl commands to output cluster state to a timestamped log file. The reviewer's feedback recommends using UTC instead of local time for the diagnostic log filename to ensure consistency with standard cloud logs.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'inspect' command to the 'gcluster job' CLI tool, allowing users to perform diagnostic sweeps of GKE clusters and active workloads. The changes include the implementation of the command-line interface, core diagnostic logic in the GKE orchestrator (such as collecting cluster details, node status, Kueue/JobSet configurations, and console links), comprehensive unit tests, and updated documentation in the job guide. There are no review comments, and I have no feedback to provide.
|
/gemini review |
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
| ``` | ||
|
|
||
| The tool will create a timestamped log file `gcluster-inspect-<cluster>-<timestamp>.log` in your current working directory containing: | ||
|
|
There was a problem hiding this comment.
Shall we include a sample screenshot of the log?
This pull request introduces a diagnostic tool for GKE clusters, allowing users to quickly capture cluster state, node health, and workload configurations. The new command, gcluster job inspect, generates a timestamped log file and provides optional console output, significantly simplifying the troubleshooting process for scheduling delays or resource exhaustion issues.
Changes