Skip to content

Implement HLS manager#117

Merged
Karolk99 merged 7 commits intomainfrom
hls-postprocessing
Nov 14, 2023
Merged

Implement HLS manager#117
Karolk99 merged 7 commits intomainfrom
hls-postprocessing

Conversation

@Karolk99
Copy link
Copy Markdown
Contributor

@Karolk99 Karolk99 commented Nov 8, 2023

Acknowledging the stipulations set forth:

  • I hereby confirm that a Pull Request involving updates to the Software Development Kit (SDK) has been smoothly merged, currently awaits processing, or is otherwise deemed unnecessary in this context.
  • I also affirm that another Pull Request, specifically addressing updates to the documentation body (commonly referred to as 'docs'), has either been successfully incorporated, is in the process of review, or is considered superfluous under the prevailing circumstances.

@Karolk99 Karolk99 requested review from Rados13 and mickel8 November 8, 2023 14:42
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 8, 2023

Codecov Report

Merging #117 (5286b8c) into main (aed751e) will decrease coverage by 0.01%.
The diff coverage is 88.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #117      +/-   ##
==========================================
- Coverage   86.24%   86.23%   -0.01%     
==========================================
  Files          50       52       +2     
  Lines         923      966      +43     
==========================================
+ Hits          796      833      +37     
- Misses        127      133       +6     
Files Coverage Δ
lib/jellyfish/application.ex 50.00% <ø> (ø)
lib/jellyfish/room.ex 85.51% <100.00%> (+0.30%) ⬆️
lib/jellyfish_web/api_spec/component/hls.ex 100.00% <100.00%> (ø)
lib/jellyfish/component/hls.ex 90.90% <85.71%> (-3.21%) ⬇️
lib/jellyfish/component/hls/manager.ex 96.66% <96.66%> (ø)
lib/jellyfish/component/hls/httpoison.ex 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aed751e...5286b8c. Read the comment docs.

Comment thread lib/jellyfish/room.ex Outdated
Comment thread lib/jellyfish_web/api_spec/component/hls.ex Outdated
Comment thread lib/jellyfish/room.ex Outdated
Comment thread lib/jellyfish/component/hls/manager.ex
Comment thread lib/jellyfish/component/hls/manager.ex Outdated
Comment thread lib/jellyfish/component/hls/manager.ex
Comment thread mix.exs Outdated
Comment thread lib/jellyfish/component/hls/manager.ex Outdated
Comment thread lib/jellyfish/component/hls/manager.ex
Comment thread lib/jellyfish/component/hls/manager.ex Outdated
@Karolk99 Karolk99 requested review from Rados13 and mickel8 November 9, 2023 13:52
Comment thread lib/jellyfish/component/hls/manager.ex Outdated
Comment thread lib/jellyfish/component/hls/manager.ex Outdated
Comment thread lib/jellyfish/component/hls/manager.ex
Comment thread lib/jellyfish/component/hls/manager.ex Outdated
Comment thread lib/jellyfish/component/hls/manager.ex Outdated
end

maybe_remove_hls(state.hls_options, state.hls_dir)
unless is_nil(hls_options.s3), do: upload_to_s3(hls_dir, room_id, hls_options.s3)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't that work?

Suggested change
unless is_nil(hls_options.s3), do: upload_to_s3(hls_dir, room_id, hls_options.s3)
if hls_options.s3, do: upload_to_s3(hls_dir, room_id, hls_options.s3)

Comment thread lib/jellyfish/component/hls/manager.ex
@Karolk99 Karolk99 marked this pull request as ready for review November 10, 2023 12:40
@Karolk99 Karolk99 requested a review from Rados13 November 10, 2023 12:40
Comment thread test/jellyfish/component/hls/manager_test.exs
Comment thread test/jellyfish/component/hls/manager_test.exs Outdated
Comment thread test/jellyfish_web/controllers/component_controller_test.exs Outdated
Comment on lines +383 to +390
defp wait_for_folder(hls_dir, milliseconds) do
if File.exists?(hls_dir) do
:ok
else
Process.sleep(100)
wait_for_folder(hls_dir, milliseconds - 100)
end
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we really need this? Couldn't we rely on some notifications etc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Element responsible for creating this folder is HLS endpoint so this is a tough one. I will look at it again.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's impossible right now because file creation has to happen before engine termination

@Karolk99 Karolk99 requested a review from mickel8 November 10, 2023 15:13
Comment thread lib/jellyfish/component/hls/manager.ex Outdated
defp remove_hls(hls_dir, room_id) do
File.rm_rf!(hls_dir)
Logger.info("Remove hls from local memory, room: #{inspect(room_id)}")
Logger.info("Remove hls from local memory, room: #{room_id}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please write from a disk as local memory sounds like RAM

options: options
} do
create_expect(0)
pid = start_process()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

start_process, kill_process and create_expect are a bit generic names

@Karolk99 Karolk99 requested a review from Rados13 November 14, 2023 12:58
Comment thread test/jellyfish/component/hls/manager_test.exs
@Karolk99 Karolk99 requested a review from Rados13 November 14, 2023 15:25
@Karolk99 Karolk99 merged commit cd5d59d into main Nov 14, 2023
@Karolk99 Karolk99 deleted the hls-postprocessing branch November 14, 2023 15:26
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.

3 participants