BIDS-collaborative / brainspell

brainspell is a web platform to facilitate the creation of an open, human-curated, classification of the neuroimaging literature
https://gitter.im/BIDS-collaborative/brainspell
2 stars 6 forks source link

Working docker-compose system #24

Closed davclark closed 8 years ago

davclark commented 8 years ago

This should work for most folks assuming they have properly configured Docker and Docker Compose (including possibly also Docker Machine). It's a lot simpler than what we were doing, but Docker is still a bit rough-edged.

In particular, there is a small problem now in that base.php specifies db as the database server (this is defined in docker-compose.yml and will be configured in /etc/hosts on the web container). So, it will break if MySQL is on the same host (i.e., localhost). I don't know what to do about this.

davclark commented 8 years ago

@stefanv hope it makes sense that I've assigned this to you. If not, feel free to reassign. I just hope you can also try with my branch and if it works, go ahead and merge.

jbpoline commented 8 years ago

@davclark: Hey Dav,

I fetched your branch and tried but got this error - any idea what is the potential issue ?

$ pwd /home/jb/code/brainspell/brainspell/docker $ sudo docker-compose up

ERROR: client and server don't have same version (client : 1.21, server: 1.18)

(This doesn't seem to be docker related versions: Docker version 1.6.2, build 7c8fca2 docker-compose version 1.6.0, build d99cad6)

will continue to invesigate - let me know if you have an idea !

davclark commented 8 years ago

I don't know off the top of my head. Does docker-compose build work?

jbpoline commented 8 years ago

The build gives this error :

git[dav] $ sudo docker-compose build Building db ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Investigating .... :)

jbpoline commented 8 years ago

Just in case that helps:

git[dav] $ sudo docker-compose --verbose build compose.config.config.find: Using configuration files: ./docker-compose.yml docker.auth.auth.load_config: File doesn't exist ERROR: compose.cli.main.main: client and server don't have same version (client : 1.21, server: 1.18)

davclark commented 8 years ago

And I guess plain docker is working?

jbpoline commented 8 years ago

yes, both docker images apache and mysql build : both return "successfully build" but :

git[dav] $ sudo docker-compose up

gives:

ERROR: client and server don't have same version (client : 1.21, server: 1.18)

davclark commented 8 years ago

Well - there seems to be some issue for this: https://github.com/docker/compose/issues/323

Are you running Docker >= 1.3? And if you're using Docker Machine, you may need to update the virtualbox VM also.

jbpoline commented 8 years ago

So, just for reference, the issue I had was the wrong version of docker-compose. I installed docker-compose with sudo pip install docker-compose as suggested here but got the wrong version of docker-compose, I should have been using this instead.

jbpoline commented 8 years ago

Merged - I must say I am lacking some competence to review it properly, but at least it was tested on Linux, OSX and Windows. Thanks a bunch !

stefanv commented 8 years ago

@jbpoline This PR also contained a bunch of cruft that you may want to remove (files committed by accident).

davclark commented 8 years ago

@stefanv the BIDS-collaborative branch seems pretty clean. What are you referring to that was extra?

stefanv commented 8 years ago

@davclark I could have misinterpreted. I thought the site/php/LuceneIndex/ directory should probably be clean. But maybe not!

davclark commented 8 years ago

At least some of those files need to be there, as I understand. But perhaps we just need an empty world-writeable directory? Have you deleted those files and verified that the app still works?

I'm pretty sure I just changed permissions. on those files, and maybe even removed some of them from git.

stefanv commented 8 years ago

My mistake, carry on! On Feb 25, 2016 16:07, "Dav Clark" notifications@github.com wrote:

At least some of those files need to be there, as I understand. But perhaps we just need an empty world-writeable directory? Have you deleted those files and verified that the app still works?

I'm pretty sure I just changed permissions. on those files, and maybe even removed some of them from git.

— Reply to this email directly or view it on GitHub https://github.com/BIDS-collaborative/brainspell/pull/24#issuecomment-189045989 .