Skip to content

feat: video recording with pluggable upload container #1881

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 2 commits into from
Oct 25, 2023
Merged

feat: video recording with pluggable upload container #1881

merged 2 commits into from
Oct 25, 2023

Conversation

msvticket
Copy link
Contributor

@msvticket msvticket commented Jun 29, 2023

Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

This PR adds support for 2 sidecars to the browser nodes that

  1. Record video using the selenium video image
  2. Upload the recorded video

This PR is inspired by #1715, but having a separate container for upload makes it possible to support new upload mechanisms without having to change the video image.

Another difference from #1715 is that the sidecars exit when the browser node exists, making them suitable for jobs and not only deployments.

Motivation and Context

While an image for video recording is available no support is available for Kubernetes through in the helm chart.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

This looks good, and is very similar to the idea I had, to use sidecars. What I was not able to point out is how do we stop the video container before the upload? The process needs to be stopped gracefully to avoid corrupting the video.

@msvticket
Copy link
Contributor Author

This looks good, and is very similar to the idea I had, to use sidecars. What I was not able to point out is how do we stop the video container before the upload? The process needs to be stopped gracefully to avoid corrupting the video.

Here

elif [[ ( "$session_id" = "null" || "$session_id" = "" ) && "$recording_started" = "true" ]]
then
echo "Stopping to record video"
kill -INT %1
fg || echo ffmpeg exited with code $?

So when a recording is in progress, but the selenium node isn't reporting any session is in progress a signal is sent to ffmpeg to stop recording (kill) and then the script waits for ffmpeg to finish (fg).

@qalinn
Copy link

qalinn commented Sep 14, 2023

Hello Guys,
@diemol any news on this topic?
@msvticket do you need any help to develop, to test?
Thank you!

@msvticket msvticket requested a review from diemol September 14, 2023 13:11
@diemol
Copy link
Member

diemol commented Sep 14, 2023

I thought this was still on draft and you were working on it @msvticket. Can you please fix the conflicts and then I can review it.

@msvticket
Copy link
Contributor Author

msvticket commented Sep 14, 2023

I thought this was still on draft and you were working on it @msvticket. Can you please fix the conflicts and then I can review it.

And I were waiting for comments from you ;-)
How about I resolve the conflicts and then you take another look?

@msvticket msvticket marked this pull request as ready for review September 14, 2023 13:39
@subin-krishna-test
Copy link

@msvticket
Any configuration to upload only the videos required.
Thanks in advance.

Copy link
Member

@diemol diemol 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, @msvticket!

@diemol diemol merged commit 01648f3 into SeleniumHQ:trunk Oct 25, 2023
diemol pushed a commit that referenced this pull request Oct 27, 2023
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
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.

4 participants