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

Use verbose gather log #1745

Closed
wants to merge 2 commits into from
Closed

Use verbose gather log #1745

wants to merge 2 commits into from

Conversation

nirs
Copy link
Member

@nirs nirs commented Jan 13, 2025

Pass drenv --verbose flag to kubectl gather command to allow verbose gather logs, and add --verbose flag to the drenv gather job.

The second change is only for debugging and we probably want to revert it after we debug the issue of stuck gather job:
https://github.com/RamenDR/ramen/actions/runs/12712182155/job/35437188040

@nirs nirs marked this pull request as draft January 13, 2025 22:48
test/drenv/kubectl.py Outdated Show resolved Hide resolved
nirs added 2 commits January 14, 2025 01:30
This logs very verbose gather logs in the console, to help debugging
issues in kubectl gather when running in the CI.

Example run with minimal minimal environment:

    % drenv gather envs/vm.yaml -v
    2025-01-14 01:14:41,352 DEBUG   [envfile] Detected os: 'darwin'
    2025-01-14 01:14:41,352 DEBUG   [envfile] Detected machine: 'arm64'
    2025-01-14 01:14:41,352 DEBUG   [envfile] Using provider: 'lima'
    2025-01-14 01:14:41,353 DEBUG   [envfile] Using driver: ''
    2025-01-14 01:14:41,353 DEBUG   [envfile] Using network: ''
    2025-01-14 01:14:41,353 INFO    [vm] Gathering environment
    2025-01-14 01:14:41,390 DEBUG   [vm] 2025-01-14T01:14:41.389+0200	INFO	gather	Using kubeconfig "/Users/nir/.kube/config"
    2025-01-14 01:14:41,390 DEBUG   [vm] 2025-01-14T01:14:41.390+0200	INFO	gather	Gathering from all namespaces
    2025-01-14 01:14:41,390 DEBUG   [vm] 2025-01-14T01:14:41.390+0200	INFO	gather	Using all addons
    2025-01-14 01:14:41,390 DEBUG   [vm] 2025-01-14T01:14:41.390+0200	INFO	gather	Storing data in "gather.20250114011441"
    2025-01-14 01:14:41,390 DEBUG   [vm] 2025-01-14T01:14:41.390+0200	INFO	gather	Gathering from cluster "cluster"
    2025-01-14 01:14:41,398 DEBUG   [vm] 2025-01-14T01:14:41.398+0200	DEBUG	gather.cluster	Listed 49 api resources in 0.007 seconds
    2025-01-14 01:14:41,400 DEBUG   [vm] 2025-01-14T01:14:41.400+0200	DEBUG	gather.cluster	Listed 2 "endpoints" in 0.002 seconds
    2025-01-14 01:14:41,401 DEBUG   [vm] 2025-01-14T01:14:41.401+0200	DEBUG	gather.cluster	Listed 0 "persistentvolumeclaims" in 0.003 seconds
    ...
    2025-01-14 01:14:41,453 DEBUG   [vm] 2025-01-14T01:14:41.453+0200	INFO	gather	Gathered 321 resources from cluster "cluster" in 0.063 seconds
    2025-01-14 01:14:41,453 DEBUG   [vm] 2025-01-14T01:14:41.453+0200	INFO	gather	Gathered 321 resources from 1 clusters in 0.063 seconds
    2025-01-14 01:14:41,460 INFO    [vm] Environment gathered in 0.11 seconds
    2025-01-14 01:14:41,460 DEBUG   [main] Starting shutdown
    2025-01-14 01:14:41,460 DEBUG   [main] Terminating process group 47188

Issues:

- The logs include timestamps and log level from kubectl gather. We
  really want to log only the message. We will improve it later by
  adding --log-format=json option to kubectl gather like lima.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
This may help to diagnose cases when kubectl gather get stuck:
https://github.com/RamenDR/ramen/actions/runs/12712182155/job/35437188040

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
@nirs nirs marked this pull request as ready for review January 14, 2025 09:27
@nirs nirs marked this pull request as draft January 14, 2025 11:24
@nirs
Copy link
Member Author

nirs commented Jan 14, 2025

Replaced by #1748. I don't think that verbose logs in the console is the right way, and with the current timeout we should always get the gather logs.

@nirs nirs closed this Jan 14, 2025
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.

1 participant