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

Running htmengine-traffic-tutorial on a dockerized environment #10

Open
swilly22 opened this issue May 8, 2016 · 2 comments
Open

Running htmengine-traffic-tutorial on a dockerized environment #10

swilly22 opened this issue May 8, 2016 · 2 comments

Comments

@swilly22
Copy link

swilly22 commented May 8, 2016

Hi,
I'm trying to run htmengine-traffic-tutorial using a dockerized environment, I'm using docker-compose to fire up 3 containers:

  1. mysql-server
  2. rabbitmq
  3. 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
@rhyolight
Copy link
Collaborator

@swilly22 Thanks! Once you get this figured out, I hope you'll contribute back the Dockerfile you end up using.

@oxtopus ?

@oxtopus
Copy link
Contributor

oxtopus commented May 9, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants