Skip to content

Support multiple deployments on the same host#360

Open
ezio-melotti wants to merge 8 commits intomasterfrom
multi-deployment
Open

Support multiple deployments on the same host#360
ezio-melotti wants to merge 8 commits intomasterfrom
multi-deployment

Conversation

@ezio-melotti
Copy link
Collaborator

This PR attempts to update simoc.py and related files in order to add support for multiple deployments on the same host.

Docker already automatically prepends the name of the cwd to the containers/networks/etc names, so if e.g. the cwd is simoc and the network is called simoc-net, the actual name will be simoc_simoc-net. Since several such names were hardcoded in a number of places, I now dynamically prepend the name of the cwd.

The PR also adds a new --env-file option to simoc.py that allows the user to specify a different env file. For testing purposes, I also included a simoc2_docker.env file (a copy of simoc_docker.env with different ports), that can be used by running:

python3 simoc.py --env-file simoc2_docker.env setup

Even though most containers seem to work, I'm still having some trouble with the mysql and redis containers. The former fails with:

sqlalchemy.exc.DatabaseError: (mysql.connector.errors.DatabaseError) 2005 (HY000): Unknown MySQL server host 'simoc-db' (-3)

The address it's trying to connect to is:

mysql+mysqlconnector://root:***@simoc-db:3307/simoc?charset=utf8

3307 is the port specified in simoc2_docker.env.

By running docker logs -f simoc2_celery-worker_1, I also noticed the following error:

[2023-05-18 00:49:04,442: ERROR/MainProcess] consumer: Cannot connect to redis://:**@redis:6380//: Error -3 connecting to redis:6380. Temporary failure in name resolution..

@ezio-melotti ezio-melotti added the feature A new feature label May 18, 2023
@ezio-melotti ezio-melotti self-assigned this May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant