Skip to content

Dockerize components (continuation of #8458) - #8858

Closed
dkrenn wants to merge 14 commits into
bigbluebutton:developfrom
dkrenn:dockerize-components
Closed

dkrenn wants to merge 14 commits into
bigbluebutton:developfrom
dkrenn:dockerize-components

Conversation

@dkrenn

@dkrenn dkrenn commented Mar 24, 2020

Copy link
Copy Markdown

No description provided.

@dkrenn

dkrenn commented Mar 24, 2020

Copy link
Copy Markdown
Author

#8458 does not build a docker image anymore. I've updated the files, so that it builds at least.

@dkrenn

dkrenn commented Mar 24, 2020

Copy link
Copy Markdown
Author

When running freeswitch the following pops up:

bbb-freeswitch_1  | ERROR: Failed to set SCHED_FIFO scheduler (Operation not permitted)
bbb-freeswitch_1  | ERROR: Could not set nice level

not sure if this is a problem or not, but it says "ERROR"

@dkrenn

dkrenn commented Mar 24, 2020

Copy link
Copy Markdown
Author

When running freeswitch the following pops up:

bbb-freeswitch_1  | ERROR: Failed to set SCHED_FIFO scheduler (Operation not permitted)
bbb-freeswitch_1  | ERROR: Could not set nice level

not sure if this is a problem or not, but it says "ERROR"

Appearently also

bbb-freeswitch_1  | 2020-03-24 18:52:34.429806 [CRIT] switch_loadable_module.c:1786 Error Loading module /opt/freeswitch/lib/freeswitch/mod/mod_spandsp.so

@dkrenn

dkrenn commented Mar 24, 2020

Copy link
Copy Markdown
Author

The main issue at the moment, however, seems to be with webrtc-sfu:

bbb-webrtc-sfu_1  | 2020-03-24T18:55:10.064Z - info: [sfu-mcs-api] Connecting to MCS at ws://localhost:3010/mcs
bbb-webrtc-sfu_1  | 2020-03-24T18:55:10.081Z - error: [sfu-mcs-api] SFU socket connection to mcs-core failed due to connect ECONNREFUSED 127.0.0.1:3010 message=connect ECONNREFUSED 127.0.0.1:3010, code=undefined
bbb-webrtc-sfu_1  | 2020-03-24T18:55:10.082Z - error: [sfu-mcs-api] SFU socket connection to mcs-core closed unexpectedly

@dkrenn

dkrenn commented Mar 24, 2020

Copy link
Copy Markdown
Author

It would be really great having the docker images running. So any ideas? Please help.

@prlanzarin

Copy link
Copy Markdown
Member

@dkrenn about bbb-webrtc-sfu: set the MCS_HOST environment variable to Docker's interface (generally you'd set MCS_HOST=172.17.0.1)

about freeswitch: the logs indicate a user issue. Is freeswitch running as user freeswitch or root inside the container?

@dkrenn

dkrenn commented Mar 24, 2020

Copy link
Copy Markdown
Author

The main issue at the moment, however, seems to be with webrtc-sfu:

bbb-webrtc-sfu_1  | 2020-03-24T18:55:10.064Z - info: [sfu-mcs-api] Connecting to MCS at ws://localhost:3010/mcs
bbb-webrtc-sfu_1  | 2020-03-24T18:55:10.081Z - error: [sfu-mcs-api] SFU socket connection to mcs-core failed due to connect ECONNREFUSED 127.0.0.1:3010 message=connect ECONNREFUSED 127.0.0.1:3010, code=undefined
bbb-webrtc-sfu_1  | 2020-03-24T18:55:10.082Z - error: [sfu-mcs-api] SFU socket connection to mcs-core closed unexpectedly

...continued by

bbb-webrtc-sfu_1  | 2020-03-24T18:57:10.193Z - error: [mcs-freeswitch-esl-wrapper] FreeSWITCH ESL connection received error ECONNREFUSED errno=ECONNREFUSED, code=ECONNREFUSED, syscall=connect, address=127.0.0.1, port=8021

@prlanzarin

Copy link
Copy Markdown
Member

@dkrenn webrtc-sfu ESL warning: same thing, env. var ESL_IP needs to be docker interface IP and not localhost.

@someone-somenet-org

someone-somenet-org commented Mar 24, 2020 •

Copy link
Copy Markdown

Make sure there is something listening on 3010.
ss -tulnp | grep 3010
in my container : tcp LISTEN 0 511 :::3010 :::* users:(("node",pid=380,fd=11))


I spent 80 hours and dockerized bbb by myself by now... Its definitely ugly, but it works:

  • I run the full unmodified installer inside a docker build, with the target-host 127.0.0.1.
  • Then override some/many configs.
  • Because my "one big container" approach runs systemd inside, it needs to be priviledged.
  • Because on the warning that docker fails to work with many post mappings I use host networking for now.

30 mins later the end result is a 4GB big container, but at least its not a full-blown ubuntu on hardware/vm level (-> muchmuchmuch reduced attack surface) and a docker-compose file consisting of 3 containers: bbbb (bbb-backend), greenlight, postgres.

The installer has a unhealthy habit of hard-coding IP addresses that dont need to be hard-coded and definitely dont need to be external IPs and uses diffrent methods to determine the external IP, with some of them cannot possibly work and put more constraints on your "box" than described anywhere in the docs.

But fortunately basically everywhere 127.0.0.1 and/or 0.0.0.0 can be used, except in freeswitch vars.xml and sip profiles/external.xml and sip.nginx which I left - for now - with a hard-coded external IP (you still need to change stuff there) - I think it is possible to replace that with stun:... and then get rid of all non 127.0.0.1 and 0.0.0.0 ip usages, but this will need more testing.

Unfortunately I came across some other serious issues so my bbb evaluation/dockerisation is on hold for now, but at least another 20 hours will be needed to transition from make it work to make it nice&secure

@antobinary

Copy link
Copy Markdown
Member

@MaxEmanuel

Copy link
Copy Markdown

Thanks @dkrenn for fixing the docker-file! I have an issue when calling docker-compose up, it claims that port 443 is already in use, it looks like nginx as well as traefik are listening to the same port. Is this possible? How can I fix this?

@dkrenn

dkrenn commented Apr 10, 2020

Copy link
Copy Markdown
Author

Thanks @dkrenn for fixing the docker-file! I have an issue when calling docker-compose up, it claims that port 443 is already in use, it looks like nginx as well as traefik are listening to the same port. Is this possible? How can I fix this?

Hm, not really an idea and it didn't come up at my test runs, but shound't traefik taking care of this? (After all traefik is for routing...)

@pihug12

pihug12 commented Apr 12, 2020

Copy link
Copy Markdown

I see openjdk:8-jre-slim-stretch is still used. Is openjdk:8-jre-slim-buster supported?

https://hub.docker.com/_/openjdk?tab=tags&page=1&name=8-jre-slim

@basisbit

basisbit commented Apr 14, 2020 •

Copy link
Copy Markdown
Contributor

What are the goals of dockerizing the components / of this pr? Maybe a discussion about advantages and disadvantages of these changes would be nice. (For example, dockerizing makes it much more difficult to install bbb in a linux container / lxc and the same is true regarding customization / modification / development.)

@dkrenn

dkrenn commented Apr 14, 2020

Copy link
Copy Markdown
Author

What are the goals of dockerizing the components / of this pr? Maybe a discussion about advantages and disadvantages of these changes would be nice. (For example, this change makes it much more difficult to install bbb in a linux container / lxc and the same is true regarding customization / modification / development.)

Before: Docker images do not build (which shouldn't be; i.e. bug). After: It (at least) builds the docker images. ("At least" because still not able to get it up running)

@MaxEmanuel

MaxEmanuel commented Apr 14, 2020 •

Copy link
Copy Markdown

What are the goals of dockerizing the components / of this pr? Maybe a discussion about advantages and disadvantages of these changes would be nice. (For example, dockerizing makes it much more difficult to install bbb in a linux container / lxc and the same is true regarding customization / modification / development.)

Advantages of this pr:

  • currently supported docker-compose is erroneous as it does not build, pr fixes this

Disadvantages of this pr: none

Advantages of dockerizing the components:

  • bbb install-script only supports ubuntu 16.04/18.04 natively: a lot of server a running a newer distribution
  • dockerization allows a better spread of bbb as people can install it easily on their servers

Disadvantages of dockerizing the components: sure, maintenance...

@nyok92

nyok92 commented Apr 21, 2020

Copy link
Copy Markdown

Hi i am interested to test bbb docker. Is your pr working now or is there still somes things to tweak ? Thanks for your work !

@varac

varac commented Apr 24, 2020

Copy link
Copy Markdown

Please merge soon, I'd like to install BBB with docker. And also, please publish up to date images on dockerhub. Thanks !

@dkrenn

dkrenn commented May 18, 2020

Copy link
Copy Markdown
Author

See bigbluebutton/docker#43 for a working dockerized BBB.

@antobinary antobinary added this to the Release 2.3 milestone May 28, 2020
fingerprint

# The long-term credential mechanism is required for WebRTC
lt-cred-mech

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

static-auth-secret implies use-auth-secret (and sets: ignore realms and credentials in the DB) which in turn implies lt-cred-mech (and enables time-limited credentials). So static-auth-secret is sufficient.

@tomaaron

Copy link
Copy Markdown

As @someone-somenet-org mentioned I also wonder why there are so many hard-coded IPs?

@github-actions

github-actions Bot commented Dec 4, 2020

Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@lonesomewalker

lonesomewalker commented Feb 13, 2021 •

Copy link
Copy Markdown
Contributor

Advantages of dockerizing the components:

  • bbb install-script only supports ubuntu 16.04/18.04 natively: a lot of server a running a newer distribution
  • dockerization allows a better spread of bbb as people can install it easily on their servers

And make not so well educated people start using BBB and spamming the issue tracker.
Also running BBB in a Docker container has some performance issues. Compare it yourself.

I know this looks good from your perspective, less effort.
But all the "hipsters" which just start docker containers are not able to maintain them nor helping themselves in fixing problems.

Example? From another repo? But also related to BBB?
chamilo/chamilo-lms#3776
This is NO ISSUE, it is lack of knowledge.

There is nothing wrong with running BBB only on Ubuntu, or can you give me one REAL neccessary example where this is not possible...?

So, if there are issues in BBB, yes they should be fixed.
But "dockerizing" BBB is not an issue if there are some smaller problems -> own repository.

Start using Ansible instead of trying to fix a non-existent issue.
We run ~1k users on a single server without virtualization. In good quality.
We have also seen so many non-userfriendly BBB installations done as virtual environment (like with nspawnd).

So, what is your benefit in using docker instead of bbb-install.sh or Ansible?

Only OS independence? Ha, this is the point where i am just laughing about.
You get in another complexity layer. The more the merrier?
Getting the CPU to almost 100% for efficient CPU usage? Expect to get some real nasty user reportings.

Don't get me wrong, i don't say that this pull request is useless or it should be ignored.
But i don't see the urge for:
Please merge soon, I'd like to install BBB with docker. And also, please publish up to date images on dockerhub. Thanks !

If you want to use docker, you should be able to build your own image ;-) You see the pull request, you see the files. Go for it.
But i would be not so happy see flowing more development power to this because there is ONE issue virtualization/containerisation is not capable of doing good:

performance of real time communication

Also, there are some "best practice" which i miss here a lot:
https://developers.redhat.com/blog/2016/02/24/10-things-to-avoid-in-docker-containers/

Greetings from one who was curious about dockerizing BBB, but just seen that the old mistakes are done again.

@basisbit

basisbit commented Feb 13, 2021 •

Copy link
Copy Markdown
Contributor

@lonesomewalker, BigBlueButton is a free libre open source software project which works kind of like a bazaar, not like a cathedral. If people want to spend time to add docker containerization support, then they can do so. Containers can help a lot to make it easier to deploy BBB to other environments like servers which do not run exactly the version of the linux distribution which the BBB core team supports.

People may feel free to add such stuff and then some users might use it or might decide to not use it. This causes some competition between different ways of running BBB, which usually end in both ways getting better.

However, just because people add docker support for a certain version, that does not mean that from then on the bbb core developers have to maintain this.

@varac

varac commented Feb 13, 2021

Copy link
Copy Markdown

This is sad. This PR sits hear for month. Then ppl engage in a general discussion why docker support is a good or bad thing, completely ignoring that there is already docker support, which is broken for a while while this PR doesn't add docker support, it tries to improve it. Then, after ~6 month github-action bot finds that there are merge conflicts - of course there are, when a PR is left stale for such a long time. I see a lot of effort put into this PR and think it should be appreciated and merged soon, otherwise it will get too much out of sync. @dkrenn what's your take on this, also regarding the merge conflicts ?

@pedrobmarin

Copy link
Copy Markdown
Collaborator

@varac you can check on https://github.com/bigbluebutton/docker for docker support

@varac

varac commented Feb 13, 2021

Copy link
Copy Markdown

Then I guess I'm a bit lost, what is this PR for excatly and why is there docker support in this repo and in https://github.com/bigbluebutton/docker ?

@prlanzarin

Copy link
Copy Markdown
Member

Then I guess I'm a bit lost, what is this PR for excatly and why is there docker support in this repo and in https://github.com/bigbluebutton/docker ?

There were two major Docker initiatives back in 2019 or something.
The one under /labs intended to do a multi-container Docker approach with docker-compose (which in my opinion was the ideal initiative back then).
The one under the dedicated repo was another concurrent initiative that opted initially to work over a monolithic container approach.

Both were WIP. This PR tried to improve/finish the multi-container approach (labs) back then.

Things have changed, though. The dedicated repo has now been recently updated with a new multi container/docker-compose approach by @alangecker. You should consider /bigbluebutton/docker BBB's mainline docker repo now. The stuff under /labs is stale at best, as is this PR.

@lonesomewalker

Copy link
Copy Markdown
Contributor

@lonesomewalker, BigBlueButton is a free libre open source software project which works kind of like a bazaar, not like a cathedral. If people want to spend time to add docker containerization support, then they can do so. Containers can help a lot to make it easier to deploy BBB to other environments like servers which do not run exactly the version of the linux distribution which the BBB core team supports.

Where did i discourage them in doing so?
It is not the point of NOT do it in a docker environment, but this is REALLY not the smoothest way to go.
We tried that, spent a lot of time for this. And you can be sure, we even had some external help because we were stuck at some points, just to find out: it is possible but you waste a lot of ressources.
Running several containers, like Jitsi does, is the only way which gives some structure and maintainability, but this gives another complexity layer.
And as @prlanzarin mentioned, somebody has already done some excellent work on this...

People may feel free to add such stuff and then some users might use it or might decide to not use it. This causes some competition between different ways of running BBB, which usually end in both ways getting better.

Well, no.
This is your opinion, but it has proven wrong.
If something has already low ressources, it doesn't get better if you split up.
But feel free to prove that i am wrong ;-)

However, just because people add docker support for a certain version, that does not mean that from then on the bbb core developers have to maintain this.

No, but it will generate some more overhead...
And more issues...
And more desired changes...

Just have a look at this pull request. :P

@pedrobmarin

Copy link
Copy Markdown
Collaborator

As mentioned, this work moved to https://github.com/bigbluebutton/docker. Thank you all for contributing.

@pedrobmarin pedrobmarin closed this Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.