Skip to content

[CLI] Adding opportunity to see basic cluster logs #14334

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

Merged
merged 59 commits into from
Aug 23, 2022

Conversation

dmitsf
Copy link
Member

@dmitsf dmitsf commented Aug 21, 2022

What does this PR do?

The PR introduces an opportunity to see basic BYOC logs in CLI: creation/any reconciliation/deletion.
That's needed mainly for debug aims, sometimes we need to know what happens to BYOC cluster.

The PR adds a command to inspect the logs:

lightning show cluster logs [OPTIONS] CLUSTER_NAME

The list of the possible options:

Options:
  --from TEXT      The starting timestamp to query cluster logs from.
  --to TEXT        The end timestamp / relative time increment to query logs
                   for. This is ignored when following logs (with
                   -f/--follow).
  --limit INTEGER  The max number of log lines returned.
  -f, --follow     Wait for new logs, to exit use CTRL+C.
  --help           Show help message and exit.

Some examples:

      Print cluster logs:

          $ lightning show cluster logs my-cluster

      Print cluster logs and wait for new logs:

          $ lightning show cluster logs my-cluster --follow

      Print cluster logs, from 48 hours ago to now:

          $ lightning show cluster logs my-cluster --from "48 hours ago"

      Print cluster logs, 10 most recent lines:

          $ lightning show cluster logs my-cluster --limit 10

Live example 1:

image

Live example 2:

Screen Shot 2022-08-21 at 6 44 53 PM

Does your PR introduce any breaking changes? If yes, please list them.

No, it doesn't.

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

cc @Borda @tchaton @rohitgr7

@github-actions github-actions bot added the app (removed) Generic label for Lightning App package label Aug 21, 2022
@dmitsf dmitsf self-assigned this Aug 21, 2022
@dmitsf dmitsf added priority: 0 High priority task app:cli feature Is an improvement or enhancement labels Aug 21, 2022
@dmitsf dmitsf changed the title Exposing basic cluster logs [CLI] Exposing basic cluster logs Aug 21, 2022
@dmitsf dmitsf requested review from manskx and hhsecond August 23, 2022 14:14
Copy link
Contributor

@manskx manskx left a comment

Choose a reason for hiding this comment

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

Looks good

@mergify mergify bot added the ready PRs ready to be merged label Aug 23, 2022
@Borda Borda added this to the app:0.6 milestone Aug 23, 2022
Copy link
Contributor

@awaelchli awaelchli left a comment

Choose a reason for hiding this comment

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

unblock, did not review

@Borda
Copy link
Member

Borda commented Aug 23, 2022

unblock, did not review

hi, pls have look, if you have some time... 🙏

@lexierule lexierule merged commit 2182d75 into master Aug 23, 2022
@lexierule lexierule deleted the grid-9959-expose-basic-cluster-logs branch August 23, 2022 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app (removed) Generic label for Lightning App package feature Is an improvement or enhancement priority: 0 High priority task ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants