Abstract-Tech / derex.runner

Manage Open edX projects
https://derex.page
GNU Affero General Public License v3.0
17 stars 7 forks source link

Allow for multiple projects to be run on the same host #182

Open chiruzzimarco opened 3 years ago

chiruzzimarco commented 3 years ago

Currently derex have serious issues in running multiple projects (or multiple environments of the same project) on the same host since services are on a per-host basis. The whole reasoning behind the ddc-services command was about having per-host services (a single mysql, rabbitmq, mongodb, elasticsearch serving any project) in order to speed up development time and do not clobber a developer machine working on a lot of different projects. This multitenant behaviour was implemented gradually by:

This is all nice, except that some issues still persists and others may be unsolvable:

For those reasons i suggest removing ddc-services altogether and include all services on a per-project basis. The only case where i see it fit is about host monitoring (still to be implemented).

chiruzzimarco commented 2 years ago

Elasticsearch indexes names are hardcoded in the edx-platform code here:

https://github.com/openedx/edx-platform/blob/master/cms/djangoapps/contentstore/courseware_index.py#L343 https://github.com/openedx/edx-platform/blob/master/cms/djangoapps/contentstore/courseware_index.py#L449 https://github.com/openedx/edx-platform/blob/master/cms/djangoapps/contentstore/courseware_index.py#L554

If there are other locations, i was not able to find them. I suggest we replace the courseware_index.py module with a version which tries to take the elasticsearch index name from Django settings and defaults to the original name if the setting cannot be found.

Each supported openedx release needs to have it's own module version customized here.

This will allow us to namespace the index name like we are already doing for the mysql database name for example.

This should be handled in a separate PR so to restrict the scope of this PR. It will be useful regardless of the choices we will take on derex future developments about handling different project environments.