Running htmengine-traffic-tutorial on a dockerized environment
Hi, I'm trying to run htmengine-traffic-tutorial using a dockerized environment, I'm using docker-compose to fire up 3 containers:
- mysql-server
- rabbitmq
- htmengine-traffic-tutorial based on dockerhub numenta/nupic image
I'm linking both mysql-server and rabbitmq to htmengine-traffic-tutorial, such that in order for htmengine-traffic-tutorial to connect to mysql I need to specify the host as follows: mysql -h mysql -u root
I know htmengine-traffic-tutorial is expecting a local mysql server, when running python python-engine/repository/migrate.py as part of the setup I get the following error: sqlalchemy.exc.OperationalError: (OperationalError) (2003, "Can't connect to MySQL server on '127.0.0.1' (111)") None None
My question is how do I specify mysql server hostname for alembic?
From https://github.com/nupic-community/skeleton-htmengine-app/blob/master/repository/migrations/alembic.ini
# sqlalchemy.url = driver://user:pass@localhost/dbname```
I'll probably have to do the same for tabbitmq.
Thanks
@swilly22 Thanks! Once you get this figured out, I hope you'll contribute back the Dockerfile you end up using.
@oxtopus ?
We're running HTM for Stocks, which is also built atop htmengine, in a docker environment, including separate mysql and rabbitmq containers as you describe, so I can give you some tips related to our usage, but your results may vary.
The Dockerfile is at https://github.com/numenta/numenta-apps/blob/master/taurus/Dockerfile, but build from numenta-apps root so we can include htmengine and nta.utils. For example:
docker build -t taurus:latest -f taurus/Dockerfile .
The entrypoint calls a configure script which, among other things, configures the database using a convenience utility at start of the container.
Unfortunately, there's no such utility in skeleton-htmengine-app, but you'll need to fixup the configuration somehow. The README.md suggests that you modify the application.conf file directly, but you can also add the relevant parts to conf/overrides/application.conf. i.e. build the docker image with a pristine configuration, and when you start the container, map a volume to the overrides directory with your specific configuration details.