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
Docker compose setup for dev and integration tests #1015
Conversation
@inspirehep/inspire-dev Feel free to comment on how these commands can be further simplified. e.g. I'm not sure how to drop the lengthy |
image: inspirehep/inspire-next | ||
indexer: | ||
image: elasticsearch | ||
command: elasticsearch -Dcluster.name="inspire" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some preparatory steps where one can install icu and reindexing plugin?
I almost got this working. One problem under Mac OS is that ports aren't forwarded, so one has to type |
Actually, one has to enable one of these solutions, otherwise the application will return a 404 (I have no idea why...). Other than that, I measured that this solution runs tests 5X slower than before, but achieves better isolation and reproducibility, a tradeoff which I think we can afford (it's 12 seconds vs 1 minute on my machine). Moreover, disk usage is just 300MB, probably thanks to the So it's a 👍 for me. @kaplun, if we decide to go forward on this (it's your call anyway!) I think we should have a Monday meeting to explain the new developer workflow that @mihaibivol is building. |
Eheh, Indeed I'd like to understand it as well... What do you think to do when we introduce beard and the thousands of compiled dependencies? |
Currently everything that we "build" is cached in /virtualenv in the |
975bae1
to
59f5552
Compare
288b637
to
f07c8e1
Compare
- "travis_retry pip install --upgrade pip setuptools py mock pytest" | ||
- "travis_retry pip install twine wheel coveralls" | ||
- "npm update && npm install --silent -g node-sass clean-css uglify-js requirejs" | ||
- pip install docker-compose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason we don't use the linked post's solution for fixing docker-compose
version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has the same version and makes .travis.yml less verbose. Also it's the same as I did locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but isn't his approach more robust? For example, let's say that the version on pip updates to 2.0.0, which is incompatible with the Docker version we require.
Awesome stuff @mihaibivol. I will give this a closer look and test. |
If Mac OS X developers want to test the Docker way here's a Vagrantfile to help them do so: jacquerie@7ddb99c. Unfortunately I wasn't able to have docker-machine running + ES (known issue of mismatched UIDs), so for now Vagrant is the way. |
...you're going to hate me a bit, but here's another commit you should cherry-pick and squash: jacquerie@071ce85 This one adds the license headers to the files you introduced. |
- chmod +x docker-compose | ||
- sudo mv docker-compose /usr/local/bin | ||
# Put coveralls | ||
- pip install coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
travis_retry
to avoid trivial build errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe remove the comment and put it before everything, where it was. Or does that break stuff?
LGTM. Cherry-pick those two commits, squash, incorporate those nits and |
* Adds docker-compose scaffold for running inspirehep. * Adds Travis test routine for running over the same scaffold. Signed-off-by: Mihai Bivol <mihai.bivol@cern.ch>
Signed-off-by: Jacopo Notarstefano <jacopo.notarstefano@gmail.com>
Signed-off-by: Jacopo Notarstefano <jacopo.notarstefano@gmail.com>
Guys you have my full trust on this branch :-) Don't know if @jalavik wanted to further comment... |
🚢 🚢 🚢 |
Great stuff guys. Note that it is still optional if one wants to develop using docker. This branch does not enforce it. |
BTW we kept the Vagrantfile out of this PR because we are waiting to see if Docker for Mac could be an alternative: https://blog.docker.com/2016/03/docker-for-mac-windows-beta/. |
* Added docker documentation (credit to @mihaibivol inspirehep#1015) Co-Author: Antonio Cesarano <cesarano2607@gmail.com> Signed-off-by: Spiros Delviniotis <spyridon.delviniotis@cern.ch> Signed-off-by: David Caro <david@dcaro.es>
Howto:
Get the latest Docker setup.
docker-engine
above1.10
anddocker-compose
above1.6.0
.Make sure you can run docker without sudo.
id $USER
If you are not in the
docker
group, run the following command and then restartdocker
. If this doesn't work, just restart your machine :)sudo usermod -a -G docker $USER
Get docker-compose:
DOCKER_DATA
env variable in your.bashrc
or.zshrc
. In this directory you will have all the persistent data between Docker runs.By default the virtualenv and everything else will be kept on
/tmp
and they will be available only until the next reboot.Go to
localhost:5000
The kill command is mandatory, otherwise you will use the test DB instead of the correct one in dev.
I don't know how to kill all the other services just after the run command exited.
Extra useful tips
After
docker-compose up
just runWith
docker-compose up
just run:With
docker-compose up
just run:TODOs:
Future Stuff:
staging
orprod
image.