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

🚀 feat: implement logs streaming for pods #559

Conversation

naineel1209
Copy link
Contributor

closes #555

📑 Description

[BE]

  • Implemented streaming logs of pod continuously to the client using SSE.
  • Utilized previously coded SSE implementation and made channels to stream the logs to the FE.

[FE]

  • Changed logs state to store array of strings to easily manage logs by using logs.join("\n").
  • Implemented logStream function which streams the logs and sets it in the state.
  • Handled scenario when no logs are available, container tabs are changed and when the log modal is cancelled or OKed.
  • Introduced a new logsSignalController state to be passed to the logStream function to handle the SSE connection scenarios i.e. close the connection via signal when modal is closed, close the current connection via signal and make a new signal for the new connection when the container tab is changed.

Streamed Logs Demo + No more events fired after the modal is closed:
https://github.com/user-attachments/assets/1f3f5fdf-102d-4697-9188-002092279098

✅ Checks

  • [✅] I have tested my code (provide screenshots or screen recordings of a working solution)
  • [✅] I have performed a self-review of my code

ℹ Additional context

@naineel1209 naineel1209 requested a review from a team as a code owner September 8, 2024 14:51
@naineel1209 naineel1209 changed the title Feat/log streaming for pods 🚀 feat: implement logs streaming for pods Sep 8, 2024
@petar-cvit petar-cvit deleted the branch cyclops-ui:stream-deployment-updates September 11, 2024 15:10
@petar-cvit petar-cvit closed this Sep 11, 2024
@petar-cvit
Copy link
Collaborator

@naineel1209 could you reopen the PR on the main branch?

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.

2 participants