This repository has been archived by the owner on Dec 14, 2021. It is now read-only.
forked from bigbluebutton/docker
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
recording: separate container for processing
- Loading branch information
1 parent
311e0fb
commit 76faab0
Showing
10 changed files
with
207 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '3.6' | ||
services: | ||
recordings-process: | ||
build: mod/recordings-process | ||
environment: | ||
DOMAIN: ${DOMAIN} | ||
volumes: | ||
- bigbluebutton:/var/bigbluebutton | ||
- vol-freeswitch:/var/freeswitch/meetings | ||
- vol-kurento:/var/kurento | ||
networks: | ||
bbb-net: | ||
ipv4_address: 10.7.7.16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
FROM ruby:2.4-slim-buster | ||
|
||
# install apt dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
wget \ | ||
subversion \ | ||
rsync \ | ||
build-essential \ | ||
libsystemd-dev \ | ||
python3 \ | ||
python3-pyinotify \ | ||
python3-lxml \ | ||
python3-icu \ | ||
ffmpeg \ | ||
poppler-utils \ | ||
imagemagick | ||
|
||
# compile and install mkclean | ||
RUN cd /tmp \ | ||
&& wget https://netcologne.dl.sourceforge.net/project/matroska/mkclean/mkclean-0.8.10.tar.bz2 \ | ||
&& tar -xf /tmp/mkclean-0.8.10.tar.bz2 \ | ||
&& cd /tmp/mkclean-0.8.10 \ | ||
&& sed -i 's/\r//g' ./mkclean/configure.compiled \ | ||
&& ./mkclean/configure.compiled \ | ||
&& make -C mkclean \ | ||
&& cp ./release/gcc_linux_x64/mkclean /usr/bin/mkclean \ | ||
&& rm -r /tmp/mkclean-0.8.10 | ||
|
||
# add dockerize | ||
ENV DOCKERIZE_VERSION v0.6.1 | ||
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | ||
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | ||
|
||
RUN mkdir -p \ | ||
/usr/local/bigbluebutton \ | ||
/usr/local/bigbluebutton/core \ | ||
/etc/bigbluebutton \ | ||
/var/log/bigbluebutton \ | ||
/var/log/bigbluebutton/presentation | ||
|
||
ENV TAG v2.2.20 | ||
|
||
# add bbb-record-core (lib, scripts and Gemfile) | ||
RUN cd /usr/local/bigbluebutton/core \ | ||
&& svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/record-and-playback/core/lib \ | ||
&& svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/record-and-playback/core/scripts \ | ||
&& rm -rf /usr/local/bigbluebutton/core/*/.svn \ | ||
&& wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG/record-and-playback/core/Gemfile.lock \ | ||
&& wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG/record-and-playback/core/Gemfile | ||
|
||
|
||
# add bbb-playback-presentation scripts | ||
RUN cd /tmp \ | ||
&& svn checkout https://github.com/bigbluebutton/bigbluebutton/tags/$TAG/record-and-playback/presentation/scripts \ | ||
&& rsync -av /tmp/scripts/ /usr/local/bigbluebutton/core/scripts/ \ | ||
&& rm -rf /tmp/scripts | ||
|
||
# install ruby dependencies | ||
RUN cd /usr/local/bigbluebutton/core \ | ||
&& gem install builder \ | ||
&& gem install bundler \ | ||
&& /usr/local/bin/bundle | ||
|
||
# add bbb-record with some adjustments so bbb-record works in this environment | ||
RUN cd /usr/bin \ | ||
&& wget https://raw.githubusercontent.com/bigbluebutton/bigbluebutton/$TAG/bigbluebutton-config/bin/bbb-record \ | ||
&& chmod +x /usr/bin/bbb-record \ | ||
&& sed -i 's/^BBB_WEB.*/BBB_WEB=""/' /usr/bin/bbb-record \ | ||
&& sed -i 's/systemctl.*//' /usr/bin/bbb-record \ | ||
&& echo "BIGBLUEBUTTON_RELEASE=$TAG" > /etc/bigbluebutton/bigbluebutton-release \ | ||
&& touch /var/log/bigbluebutton/bbb-web.log | ||
|
||
# create user | ||
# the ID should matcht the one creating the files in `core` | ||
RUN groupadd -g 998 bigbluebutton && useradd -m -u 998 -g bigbluebutton bigbluebutton | ||
|
||
COPY bigbluebutton.yml /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl | ||
COPY log-collector.py /log-collector.py | ||
COPY entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT dockerize \ | ||
-template /usr/local/bigbluebutton/core/scripts/bigbluebutton.yml.tmpl:/usr/local/bigbluebutton/core/scripts/bigbluebutton.yml \ | ||
/entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
bbb_version: '2.1.0' | ||
raw_audio_src: /var/freeswitch/meetings | ||
raw_video_src: /usr/share/red5/webapps/video/streams | ||
kurento_video_src: /var/kurento/recordings | ||
kurento_screenshare_src: /var/kurento/screenshare | ||
raw_screenshare_src: /usr/share/red5/webapps/screenshare/streams | ||
raw_webrtc_deskshare_src: /usr/share/red5/webapps/video-broadcast/streams | ||
raw_deskshare_src: /var/bigbluebutton/deskshare | ||
raw_presentation_src: /var/bigbluebutton | ||
notes_endpoint: http://etherpad:9001/p | ||
# Specify the notes formats we archive | ||
# txt, doc and odt are also supported | ||
notes_formats: | ||
- etherpad | ||
- html | ||
redis_host: redis | ||
redis_port: 6379 | ||
# Uncomment and set password if redis require it. | ||
# redis_password: changeme | ||
|
||
# For PRODUCTION | ||
log_dir: /var/log/bigbluebutton | ||
events_dir: /var/bigbluebutton/events | ||
recording_dir: /var/bigbluebutton/recording | ||
published_dir: /var/bigbluebutton/published | ||
captions_dir: /var/bigbluebutton/captions | ||
playback_host: {{ .Env.DOMAIN }} | ||
playback_protocol: https | ||
|
||
# For DEVELOPMENT | ||
# This allows us to run the scripts manually | ||
#scripts_dir: /home/ubuntu/dev/bigbluebutton/record-and-playback/core/scripts | ||
#log_dir: /home/ubuntu/temp/log | ||
#recording_dir: /home/ubuntu/temp/recording | ||
#published_dir: /home/ubuntu/temp/published | ||
#playback_host: meet.livingutopia.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# print all logs to stdout | ||
python3 -u /log-collector.py & | ||
|
||
cd /usr/local/bigbluebutton/core/scripts | ||
|
||
while true; do | ||
bundle exec ruby rap-archive-worker.rb | ||
bundle exec ruby rap-sanity-worker.rb | ||
bundle exec ruby rap-process-worker.rb | ||
bundle exec ruby rap-publish-worker.rb | ||
|
||
bundle exec ruby rap-caption-inbox.rb | ||
bundle exec ruby rap-events-worker.rb | ||
|
||
sleep 30s | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# this script sends all entries from different logfiles | ||
# to stdout, so that they appear in the docker logs | ||
|
||
import threading | ||
import subprocess | ||
import time | ||
import pyinotify | ||
import os | ||
import re | ||
import sys | ||
|
||
log_dir = '/var/log/bigbluebutton' | ||
|
||
def thread_function(name, filename): | ||
f = subprocess.Popen(['tail','-F', '-n', '0', filename],\ | ||
stdout=subprocess.PIPE,stderr=subprocess.PIPE) | ||
while True: | ||
line = f.stdout.readline().decode('utf-8').strip() | ||
if len(line): | ||
print(name.ljust(10)+' |', line) | ||
sys.stdout.flush() | ||
|
||
def tail_file(name, filename): | ||
x = threading.Thread(target=thread_function, args=(name, filename,)) | ||
x.start() | ||
|
||
|
||
tail_file('rap-worker', log_dir+'/bbb-rap-worker.log') | ||
tail_file('sanity', log_dir+'/sanity.log') | ||
tail_file('publish', log_dir+'/post_publish.log') | ||
|
||
class EventHandler(pyinotify.ProcessEvent): | ||
def process_IN_CREATE(self, event): | ||
filename = os.path.basename(event.pathname) | ||
if re.match('^archive-.*\.log$', filename): | ||
tail_file('archive', event.pathname) | ||
elif re.match('^process-.*\.log$', filename): | ||
tail_file('process', event.pathname) | ||
|
||
|
||
wm = pyinotify.WatchManager() | ||
handler = EventHandler() | ||
notifier = pyinotify.Notifier(wm, handler) | ||
wdd = wm.add_watch(log_dir, pyinotify.IN_CREATE, rec=True) | ||
notifier.loop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters