usgo / online-ratings

AGA Online Ratings protocol and implementation
MIT License
23 stars 12 forks source link

Update the docker-compose to V2. #65

Closed artasparks closed 8 years ago

artasparks commented 8 years ago

After this change, if I remember to run the createdb script, I don't seem to have problems with the database.

If I register a new user, I get some server error when it redirects back. But, if I reload the page and login, it seems to work. It seems to me that redirects are just broken.However, it seems to me that the database is working correctly.

I'm still getting problems, in particular: host = smtplib.SMTP(self.mail.server, self.mail.port)

Not sure why this is failing but seems like there are two separate issues here MAIL_SERVER=smtp_server.usgo.org

I think this fixes linking issues in issue/48. Or perhaps it's because I have a newer version of Docker (I'm on 1.12.1-beta24)

https://github.com/usgo/online-ratings/issues/48

artasparks commented 8 years ago

In particular, the full smpt error:

web_1       | Traceback (most recent call last):
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask/app.py", line 1817, in wsgi_app
web_1       |     response = self.full_dispatch_request()
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask/app.py", line 1477, in full_dispatch_request
web_1       |     rv = self.handle_user_exception(e)
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask/app.py", line 1381, in handle_user_exception
web_1       |     reraise(exc_type, exc_value, tb)
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
web_1       |     raise value
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask/app.py", line 1475, in full_dispatch_request
web_1       |     rv = self.dispatch_request()
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask/app.py", line 1461, in dispatch_request
web_1       |     return self.view_functions[rule.endpoint](**req.view_args)
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask_security/decorators.py", line 205, in wrapper
web_1       |     return f(*args, **kwargs)
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask_security/views.py", line 117, in register
web_1       |     user = register_user(**form.to_dict())
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask_security/registerable.py", line 41, in register_user
web_1       |     user=user, confirmation_link=confirmation_link)
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask_security/utils.py", line 333, in send_mail
web_1       |     mail.send(msg)
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask_mail.py", line 491, in send
web_1       |     with self.connect() as connection:
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask_mail.py", line 144, in __enter__
web_1       |     self.host = self.configure_host()
web_1       |   File "/usr/local/lib/python3.4/site-packages/flask_mail.py", line 158, in configure_host
web_1       |     host = smtplib.SMTP(self.mail.server, self.mail.port)
web_1       |   File "/usr/local/lib/python3.4/smtplib.py", line 242, in __init__
web_1       |     (code, msg) = self.connect(host, port)
web_1       |   File "/usr/local/lib/python3.4/smtplib.py", line 321, in connect
web_1       |     self.sock = self._get_socket(host, port, self.timeout)
web_1       |   File "/usr/local/lib/python3.4/smtplib.py", line 292, in _get_socket
web_1       |     self.source_address)
web_1       |   File "/usr/local/lib/python3.4/socket.py", line 498, in create_connection
web_1       |     for res in getaddrinfo(host, port, 0, SOCK_STREAM):
web_1       |   File "/usr/local/lib/python3.4/socket.py", line 537, in getaddrinfo
web_1       |     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
web_1       | socket.gaierror: [Errno -2] Name or service not known
brilee commented 8 years ago

The SMTP stuff has to be connected to a working account. The app sends an email to confirm that you've registered - that's probably the part that was throwing an error for you during registration. I should have made the placeholder email address more clear; in production that env value is set to Amazon SES, and locally I test using a throwaway gmail account.

Let me see if the docker issues are resolved on my end with these changes.

brilee commented 8 years ago

Stuff is fixed on my end, it seems! There's nothing in the changes that looks remotely related to the issues I was seeing, so... bah. I guess it works!

Thanks for making the fixes. There's one small change - I believe that changing the name of the data container to pgdata will create a new container (instead of renaming), effectively resetting the state of the app.

We might have to do that anyway, to clear all the junk data created by the placeholder scripts. Let's discuss that on slack.

artasparks commented 8 years ago

There's one small change - I believe that changing the name of the data container to pgdata will create a new container (instead of renaming)

I don't think that's true -- it's just an alias. To test this, I renamed it to zgdata and did a docker-compose up and the data was still the same. I'd like to leave it as pgdata (PostGressDATA) since that's more descriptive. Imagine, for example, if we start using redis.

brilee commented 8 years ago

👍 If it's just an alias, I'm all for the change.

dev.usgo.org has Docker 1.10 and Docker-compose 1.6, so it should be fine with the new syntax. The docker on that machine should be updated too.

Do you know if your new dockerhub flow is working? You should feel free to merge this change in and try to deploy it.

artasparks commented 8 years ago

Do you know if your new dockerhub flow is working? You should feel free to merge this change in and try to deploy it.

No, that's not connected up yet, beyond building images off of the release branch. I wanted to get the existing docker issues resolved before I tried to finish the auto-update bits =).

brilee commented 8 years ago

Okay. I'll do the merge, deploy, and docker version updates myself, then, and assuming that all stabilizes, you'll be in the clear to play with automated deployment!

artasparks commented 8 years ago

Alright I've created a new issue for the smtp issue that I'm seeing locally: https://github.com/usgo/online-ratings/issues/66

brilee commented 8 years ago

@Kashomon I've merged, built, deployed, and also upgraded docker + docker-compose to their latest versions. Everything looks like it's still working, so you should be good to go!