-
Notifications
You must be signed in to change notification settings - Fork 71
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
Bug: Unable to generate service file from large (~900MB) video file. #1278
Comments
I'm working with @antbrown on this. We see no POST (via Apache) to Drupal when the video Service File is returned from Homarus. The messaging layer is falling over when handling the Homarus output. It would be good to understand more about the architecture around Karaf/Camel/ActiveMQ especially when it comes to handling larger binaries. Is the output of homarus being accumulated somewhere before being POSTed to Drupal API. What systems should we be looking at? Has anyone else tried this scale of conversion? |
@dannylamb Do we need to look at different handling in |
Sounds based on what you're describing it never gets here: https://github.com/Islandora-CLAW/Alpaca/blob/dev/islandora-connector-derivative/src/main/java/ca/islandora/alpaca/connector/derivative/DerivativeConnector.java#L69-L72 IN THEORY its all streamed around. The microservice will request the video, stream it to ffmpeg, and then stream the results back to camel, which then PUTs them into Drupal. I suspect that when it PUTs to Drupal, it's not getting streamed, gobbling up too much memory, and making the JVM tip over. I'll play with it more and report back. |
After reading the docs and getting some tentative confirmation from @birkland, I think the issue (or at least part of it is) we need to set We had to go through this a short while ago with |
Awesome! Thanks @dannylamb If you get a chance to post the pull request I am more than happy to test it out. I will try find my way through re-deploying Alpaca, any help you can provide here will be greatly appreciated. |
Just an update from me. I made the following changes... Islandora/Alpaca@dev...antbrown:antbrown/disable-stream-cache I thought it is only relevant to derivatives and not indexing, which is why I've only changed the DerivativeConnector and its test. Please correct me if I'm wrong! I also split the line because gradle didn't like lines longer than 120 chars, fair enough! Then I did this from the root of the git repository:
It gave me a new Now, I just need to figure out where to put it 😄 |
@antbrown Eventually we'll hit all the spots in Alpaca, but for now sticking to just the DerivativeConnector is totally fine. If you want to deploy it, it goes to First I logged in a uninstalled the original bundle using its ID, which I looked up. Karaf has a lot of bash-isms that may look familiar here (e.g.
Then I checked all the bundles again to make sure it was gone (it was).
Then I hit ctrl+c to get out of the karaf shell and copied the jar over to the
Then I hopped back in the shell and confirmed the new bundle was in the
Then, to really make sure, I made an object and got derivatives. It was pretty painless for me, but sometimes karaf can really throw you a curveball, so if you follow along and something unexpected happens, let me know. |
Hi @dannylamb thank you for the very thorough instructions :) Here's what I did:
Back on my host:
Back inside VM:
From the camel.log
Then I went back to http://localhost:8000/node/add/islandora_object to create a simple Video repository item, then added/uploaded a new media/video item (930MB), crossed my fingers and watched the logs. Oh, I also needed to make sure I was running the patched version of Crayfish/Homarus to include the Video conversion took around 20 minutes (which is fine, I've only given the VM 1x cpu). Homarus returned the file which was then PUT back to Drupal as a 'Service File' media item attached to the original islandora_object. Happy days 😄 I learned a lot following this process, thanks heaps. Not sure where to from here, do I figure out how to open pull requests against Alpaca and Crayfish and submit them for review, or is this something you want to look into further before committing to a solution? I'll attach some log entries too, in case it helps future peoples... Cheers! |
PRs against Alpaca and Crayfish would be much appreciated. Bonus points if you throw |
Hi @dannylamb sorry for the delay, I'm not sure what I'm doing differently, the first time when I got this working I just dropped the jar file into the karaf deploy directory, karaf slurped it up and was happy, but now doing the same with the 1.0.2 jars from the 1278 pull request (built with gradlew) doesn't seem to update the features/bundles within karaf (even after a tomcat restart). Karaf reports that the 1.0.1 version is still in use. I don't have a lot of experience in this area, I'm wondering if you could point me to any extra docs around how Alpaca is meant to be deployed? Or even more abstract docs on how to deploy things to karaf properly? Many thanks, Ant |
@dannylamb we’ve managed to push the 1.0.2 jars out to staging and UAT, and coupled with the Thanks very much for your work on this! |
@antbrown Thank you so much for testing. Sounds like Islandora/Crayfish#82 is good, then. Can you confirm that Islandora/Alpaca#66 is good as well? Or is it no longer neccessary? It's not part of Either way, these have sat for a bit and I'd like to get them taken care of. So let me know and I'll make a plea to get one or both of these merged. |
I'll preface this by saying sub-100MB videos work fine. Service file and thumbnail is generated correctly and added back as media to the original islandora_object.
Before we get to the big video I should note we were also having trouble with video files at around the 400MB size.
I managed to solve it by adding
-loglevel error
to the ffmpeg command in HomarusController::convert at line 199.ffmpeg writes out heaps of data to stdout and I don't think the CmdExecuteService was able to process all of it, so the 4Kb limit was reached and ffmpeg froze.
Running a stack trace on the ffmpeg process id showed it was stuck on a
write()
operation which is what I'm basing these guestimates on.Adding
-loglevel error
to the command keeps it nice and quiet (unless an error occurs) and so the 4Kb limit is never reached and ffmpeg conversion completes successfully.Now... we're trying to process a 930MB .mp4 video file.
The ffmpeg conversion completes successfully, we get a HTTP 200 response from Homarus and then about 50 seconds - 2 minutes later either JVM gets restarted or the request is retried and the whole ffmpeg process starts again.
I'll try to attach what I think are relevant log entries, but I'm still learning a lot of this stuff so feel free to ask for more info :)
Tokens and urls have been redacted to protect the innocent.
Unfortunately the karaf.log is super noisy and has been rotated out so I don't have access to the matching timestamps.
I've also run htop, kept an eye on memory/cpu/swap and nothing seems to be breaking any limits there.
Cheers!
Ant
The text was updated successfully, but these errors were encountered: