Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple deployments on the same host #360

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

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