Skip to content
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

Dockerize Valkyrie's dependencies #422

Merged
merged 5 commits into from Apr 13, 2018
Merged

Dockerize Valkyrie's dependencies #422

merged 5 commits into from Apr 13, 2018

Conversation

mbklein
Copy link
Member

@mbklein mbklein commented Mar 27, 2018

This PR moves Valkyrie's external dependencies (Fedora, Solr, and PostgreSQL) into Docker containers.

Changes:

  • Adds docker-compose.yml files for development and test environments
  • Updates some config files for compatibility with new server locations
  • Removes fcrepo_wrapper and solr_wrapper and related rake tasks
  • Provides new rake tasks for spinning up/bringing down/cleaning the dependency stack
  • Update README with instructions for using the new stack
  • Update circle.yml to make CircleCI use the new dependencies

Update the README with documentation on using Docker for dependencies
@escowles
Copy link
Contributor

When I try to spin this up, I get:

$ rake docker:dev:up
Unsupported config option for services service: 'solr_index'
rake aborted!
Docker::Compose::Error: 'up' failed with status 'pid 14511 exit 1': Unsupported config option for services service: 'solr_index'
/Users/escowles/.rbenv/versions/2.3.1/bin/bundle:23:in `load'
/Users/escowles/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>'
Tasks: TOP => docker:dev:up
(See full trace by running task with --trace)

valkyrie.gemspec Outdated
@@ -47,6 +47,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "coveralls"
spec.add_development_dependency "bixby"
spec.add_development_dependency 'yard'
spec.add_development_dependency 'solr_wrapper'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should keep both versions. I know some people at least have trouble getting Docker to work.

README.md Outdated
* [Docker](https://store.docker.com/search?offering=community&type=edition) version >= 17.09.0

### Starting the development mode dependencies
1. Start Solr, Fedora, and PostgreSQL with `rake docker:dev:daemon` (or `rake docker:dev:up` in a separate shell to run them in the foreground)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run rake docker:dev:up, I get an error message:

Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.
rake aborted!
Docker::Compose::Error: 'up' failed with status 'pid 21346 exit 1': Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.
/Users/escowles/.rbenv/versions/2.3.1/bin/bundle:23:in `load'
/Users/escowles/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>'
Tasks: TOP => docker:dev:up
(See full trace by running task with --trace)

Is there something I need to start before running the rake task?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you installed the official Mac release, you might need to run the Docker app. Your menu bar should have this little guy in it:

item-0 2018-03-27 13-32-39

@escowles
Copy link
Contributor

escowles commented Mar 28, 2018

I installed docker using homebrew:

$ brew install docker
$ brew install docker-machine
$ brew install docker-compose

And then I had to start it with:

$ docker-machine create default
$ docker-machine start default
$ eval "$(docker-machine env)"

For people who aren't familiar with Docker, it would be good to include that in the README.

Edit by @revgum : Added docker-compose install and docker-machine creation

@tpendragon
Copy link
Collaborator

@mbklein Can you add some directions on installing docker on Mac OSX? Maybe the directions @escowles posted would work, but mine varied a bit (used Docker for Mac or whatever)

@tpendragon
Copy link
Collaborator

@mbklein Are you going to be able to get back to this, or would you like me to take over documentation?

@revgum
Copy link
Contributor

revgum commented Apr 5, 2018

Added two steps in @escowles comment and got it up and running on my box in a snap. Great work and addition IMO!

Edit Almost all came up.. Solr was misbehaving for me, and after a bit of digging I figured out what was happening. I have a code directory that is symlinked to a mounted virtual disk, so that I can move all of my code and important stuff from one machine to another (old habits of migrating from an old machine to a new one). This might be worthwhile adding to the documentation:

Solr wouldn't start, and complained that it could not find the solrconfig.xml even though the docker-compose has the volume mounted!
VirtualBox hosting docker will automatically share the /Users directory to the VM. Mounting Docker volumes will function properly as long as the path is somewhere within the /Users path, and/or so long as the path isn't symlinked outside of the /Users directory.

@tpendragon tpendragon merged commit c0d8456 into master Apr 13, 2018
@tpendragon tpendragon deleted the dockerize branch April 13, 2018 21:21
@tpendragon tpendragon removed the Review label Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants