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
Migrate to Docker from Vagrant #125
Conversation
Neo4j and OrientDB are up and running. I ran into some problems adding the Gremlin container. Will try later this week. To get this running at this point: docker-compose up
docker run -it --link spider_orientdb:orientdb --link spider_neo4j:neo4j --net spider_default -e "SPIDER_DOCKER=true" -v /Mac/users/michael/code/spider/spider:/spider spider/php bash Replacing the volume path with your own. The next step is to get |
The only way I can see a I've been working with Docker now too the last couple of days and learning a lot. 😄 I've also gotten a PHP image created with Alpine Linux with PHP7 and it has composer + phpunit globally pre-installed. You can get the image with
I can easily create a php5.6 image too. Would we need any other PHP versions? Scott |
That's great! does that php container come with sockets enabled? The last time I tried an alpine container, I couldn't get sockets to work, which is ridiculous. I think 5.6 and 7.0 are all we are really supporting right now. It would be great to have them both installed on the same container, but two different boxes would be fine as well. And |
I have sockets enabled in the PHP compilation. Is that what you mean? Scott |
Yes, that is exactly what I mean. Thank you. |
And, I take it back. Two different tags ( |
Ok. I'll push them with those tags. It isn't as easy as I thought to make a 5.6 image. Working on it though. Scott |
Your container worked great. I have also simplified what is needed to run the containers:
The first time you run it, it will pull in and build everything. The "sleep 15" needs a better solution. The php container cannot start running its tests until the db services are up and ready. The best alternative (though more complex than I like) is to have the php bootstrap file check for connections, and hold up the tests until the connections are good. I'd love to find a better solution. To open a full terminal, you must still docker-compose up -d
docker run -it --link spider_orientdb:orientdb --link spider_neo4j:neo4j --net spider_default -e "SPIDER_DOCKER=true" -v /Mac/users/michael/code/spider/spider:/spider spider/php bash Also open to a better solution here. One last note: I have moved all the credentials to environment variables. This means you can use the docker's php container, or use php locally. Simply add a |
I have pushed a basic shell script to handle docker testing and management. I'm happy with it, though I'm sure it could use some refactoring and testing. See From spider directory Two important notes
@smolinari Have you gotten any luck with a php5.6 container? I also noticed that this one doesn't support bash or shell. At least not that I've found. We need a way to do something like
Next step is to finish versioning in the |
@chrismichaels84 - I haven't finished the 5.6 version yet. Working on it today. The php7 version is also finished and coincidentally, I also added bash, because of the timeout issue I'm having with ODB (which you also mentioned), I was trying to incorporate wait-for-it. So the new image should work for you now. It is also under I like the script you made. I guess I'll have to test it. 😄 Edit: I've also uploaded the files to a repo: https://github.com/skooppaos/docker-files Edit2: I actually won't be getting the 5.6 version done today. I had too much work on my house and now I have to go shopping for the weekend. So, I'll get to it tomorrow. Scott |
The container looks great. Good work. And wait-for-it could come in handy. I've run into a problem where I have to make containers sleep before running tests b/c we have to wait for the databases to be ready. Something like this could be super helpful. And have a good weekend. |
Just pushed update with full-ish versioning control. If you try to use an unsupported version, you will get an error, but it will let you try. If there is a docker image with that tag, it will load. Also added Does NOT include actual supported versions. That will have to be its own ticket to see what spider actually supports. This way, though, we get to keep each branch and its supported versions together, which is nice. Last cleanup items before this gets tested and merged (other than documentation)
Would be nice:
My last thought is along with #123, add a |
Just an FYI. Spider can't support ODB 2.2 yet, because the OrientPHP driver doesn't work properly with 2.2, unfortunately. Ostico/PhpOrient#71 Scott |
Yup, I can't get Docker to do as I want on my Win7 system and I've tried all sorts of things. I am giving up, which I hate to do. I guess I'll stick with Vagrant for now as you suggest. The only thing missing is PHP7 support in the spider-box. I'll see if I can add that in the near future. Scott |
Well, this is actually working -- and all finished with gremlin and all -- but there are two external problems:
|
So, I've run into a really weird problem. It seems that (only on travis) the neo4j tests can't connect to neo4j when the gremlin database is running. Works fine on my local machine. When the gremlin db is disabled, all works well. Even when the gremlin tests are skipped -- if the db is up, then neo4j isn't. But only on travis. @PommeVerte any idea what may be causing this? |
I have decided to revert to a point where everything is working except gremlin, merge this into develop and then into the other two PRs. This will allow me to use it in real situations for testing. We just have to be sure not to release develop until the gremlin container is working as expected. If I find myself with time and @PommeVerte isn't able to look at it, I may fork the gremlin container and see what I can do. I need to learn tinkerpop better anyway. |
Picking up on Issues #120 and #123 . This is not ready to merge yet
Alright, after a lot of learning, I managed to create a setup that works for orientdb for now. It should be easy enough to add neo and gremlin.
clone the
docker
branchdocker-compose up -d
docker run -it --link spider_orientdb:orientdb --net spider_default -v /Mac/users/michael/code/spider/spider:/spider spider/php bash
The second command is specific to my system. replace the
/mac/users...
path with the absolute path of spider. (for windows /c/path/to/spider).This will all be abstracted away beneath a
spider-dev.sh
bash file. After a long chat with a coworker who manages our docker system, I think it'll be best to skipdocker-compose
for now. If we do everything throughdocker build
anddocker run
abstracted behind aspider-dev
bash file, then we give the users the ability to cherry pick and mix-and-match the versions of php and database.Also, I had to use a php image from
ubuntu:15.10
which I hate. It's huge. I tried several others, but got frustrated b/c I either couldn't install xdebug or they weren't compiled with sockets enabled (I can't figure out why). I am sure there exists, or we can define a better one. For now, though, I just wanted to get it working.Still ToDo:
.env
file (that's why tests fail right now)docker-compose.yml
(https://docs.docker.com/compose/compose-file/#variable-substitution)spider-dev.sh
to abstract away docker commands (from [App] Introduce a (basic) spider-cli application #123)spider-dev
(spider-dev test -iau
)