opencast / opencast-docker

Dockerfiles for Opencast
https://quay.io/organization/opencast/
Educational Community License v2.0
41 stars 36 forks source link

Make ORG_OPENCASTPROJECT_SERVER_URL optional by using the hostname of the container #29

Closed mtneug closed 7 years ago

mtneug commented 7 years ago

These images enable Opencast to be run in a Docker orchestrator environment (e.g. Docker Swarm). Most of these environments have scaling functionality build in (useful e.g. for Opencast worker). Opencast requires that each instance has a unique server URL, which, at the moment, is set by the ORG_OPENCASTPROJECT_SERVER_URL environment variable. Orchestrator that cannot alter this value for each instance (e.g. Docker until version 1.12) cannot scale Opencast instances. To support these

Using "http://<ip address>:8080" would be an alternative, but within the container it is not clear what interface is the correct one to use (i.e. the overlay network). Simply using the hostname works with

Other orchestrator might need other values. Support should be added if needed.

JanKoppe commented 7 years ago

I'm partial to #30 - Although the implementation itself looks okay to me, this would use the hostname of the container itself which cannot be resolved outside of the container. Would this then be handled completely by the orchestrator? If so, everything is fine and you can ignore my comment. :)

mtneug commented 7 years ago

Yes it would use the container hostname which is resolvable by the build in Docker DNS server if you use a network other than the default one (backward compatibility reasons). This also works within a Docker Swarm mode cluster. I'm don't know if this is also the case for other orchestrators. I decided to focus on Swarm and test the others later.

Assuming you have set a resolvable download URL, the server URL, as far as I know, only needs to be resolvable/reachable from within the containers. Other than Opencast the CA might use it for ingesting (as is the case for pyCA), but it will use the services of the admin instance. The idea is that you set a fixed resolvable/reachable URL from outside of the container for admin and maybe presentation as you only run one instance of them, but leave the worker server URL blank so that it can be assigned dynamically. The worker only needs to be reachable by other Opencast instances. This way you can easily scale the worker service with you orchestrator.

mtneug commented 7 years ago

Closed with #30.