francescou / docker-compose-ui

web interface for Docker Compose
http://francescou.github.io/docker-compose-ui
MIT License
1.54k stars 228 forks source link

Projects issue with Swarm cluster #25

Closed dalareo closed 8 years ago

dalareo commented 8 years ago

Hi, I have set an external Swarm cluster with docker-compose-ui. It's great as I can provide a simple UI to my users avoiding them to access my orchestrator UI (I am currently using Rancher to manage my infraestructure).

When I launch containers from docker-compose-ui I can manage them from Rancher without problem, but when I launch containers from Rancher docker-compose-ui does not recognize the new projects as it only searches for new projects at local endpoint. Could it be possible to include also external projects? I mean: could I manage from docker-compose-ui those containers launch in the same swarm cluster from other clients??

francescou commented 8 years ago

Hello David,

Docker-compose-UI at the moment is heavily dependent on a directory containing all of your docker-compose.yml files (i.e. /opt/docker-compose-projects/)...so I guess you should find a way to mount rancher's yml files directory as a volume (unfortunately I am not familiar with Rancher).

Can you find the directory where rancher store its docker compose yml files?

dalareo commented 8 years ago

Rancher manages docker-compose.yml files from the catalog, which can be added externally from a git repository, buy no idea how to mount rancher's yml folder as a volume... I will ask at Rancher's forum! Thanks Francesco!

dalareo commented 8 years ago

Hi @francescou I have created a project forking yours but adding auth and other features related with my "big project" right now, EduCaas. Take a look and feel free to comment/copy/hack/distribute, of course!! https://github.com/dalareo/educaas-ui

francescou commented 8 years ago

Hello David, I've cloned your repo and started the project with docker-compose up.

I have this error when I log in

educaas_ui_1  | Traceback (most recent call last):
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
educaas_ui_1  |     rv = self.dispatch_request()
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
educaas_ui_1  |     return self.view_functions[rule.endpoint](**req.view_args)
educaas_ui_1  |   File "/app/scripts/__init__.py", line 76, in login
educaas_ui_1  |     user = User.query.filter_by(email=json_data['email']).first()
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2634, in first
educaas_ui_1  |     ret = list(self[0:1])
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2457, in __getitem__
educaas_ui_1  |     return list(res)
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2736, in __iter__
educaas_ui_1  |     return self._execute_and_instances(context)
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2751, in _execute_and_instances
educaas_ui_1  |     result = conn.execute(querycontext.statement, self._params)
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
educaas_ui_1  |     return meth(self, multiparams, params)
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
educaas_ui_1  |     return connection._execute_clauseelement(self, multiparams, params)
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
educaas_ui_1  |     compiled_sql, distilled_params
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
educaas_ui_1  |     context)
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
educaas_ui_1  |     exc_info
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
educaas_ui_1  |     reraise(type(exception), exception, tb=exc_tb, cause=cause)
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
educaas_ui_1  |     context)
educaas_ui_1  |   File "/env/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
educaas_ui_1  |     cursor.execute(statement, parameters)
educaas_ui_1  | ProgrammingError: (psycopg2.ProgrammingError) relation "users" does not exist
educaas_ui_1  | LINE 2: FROM users 
educaas_ui_1  |              ^
educaas_ui_1  |  [SQL: 'SELECT users.id AS users_id, users.email AS users_email, users.password AS users_password, users.registered_on AS users_registered_on, users.admin AS users_admin \nFROM users \nWHERE users.email = %(email_1)s \n LIMIT %(param_1)s'] [parameters: {'email_1': u'ad@min.com', 'param_1': 1}]
educaas_ui_1  | INFO:werkzeug:172.17.0.1 - - [26/Apr/2016 09:40:35] "POST /api/v1/login HTTP/1.1" 500 -
dalareo commented 8 years ago

You will have to execute some commands first (still working on it). Check out docker-compose.yml file and you will find:

#following commands need to be run in a bash inside running container
#command: bash -c "/env/bin/python /app/manage.py create_db"
#command: bash -c "/env/bin/python /app/manage.py db init"
#command: bash -c "/env/bin/python /app/manage.py db migrate"

Execute the three ones inside your container before signing up or loggin in.

francescou commented 8 years ago

nice work!