0.0
No commit activity in last 3 years
No release in over 3 years
Plumbing for running mappers and reducers inside Docker containers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.6.1
>= 2.0.1
>= 5.8.3
>= 1.1.0
>= 11.1.2
>= 4.2.0
>= 0.10.0
>= 0.8.7.6

Runtime

>= 1.26.2
>= 1.1.7
 Project Readme

contained_mr

Yard Docs Build Status

Map-Reduce where both the mappers and the reducer run inside Docker containers.

Prerequisites

contained-mr requires docker version 1.9 or above. If used, docker-swarm must be at vesion 1.0 or above.

Development Environment

contained-mr requires access to a Docker Swarm daemon. The easiest way to bring up a development setup is to install Docker Machine, Docker Swarm and VirtualBox.

The commands below install the prerequisites on OSX using Homebrew.

brew install docker docker-machine docker-swarm
brew tap Caskroom/cask
brew cask install virtualbox

Create a Docker Swarm cluster. This is a one-time setup.

TOKEN=$(docker-swarm create)
docker-machine create --driver virtualbox --engine-storage-driver overlay \
    --swarm --swarm-master --swarm-discovery "token://$TOKEN" swarm-master
docker-machine create --driver virtualbox --engine-storage-driver overlay \
    --swarm --swarm-discovery "token://$TOKEN" swarm-agent-1
docker-machine create --driver virtualbox --engine-storage-driver overlay \
    --swarm --swarm-discovery "token://$TOKEN" swarm-agent-2

Set up the local environment to point to the Swarm master. This must be executed in every shell where contained-mr is used.

eval "$(docker-machine env --swarm swarm-master)"

Cleanup

When tests go wrong, they often leave dead containers and images behind. Removing all stopped containers and all unused images is a big stick that works quite well in development environments.

docker ps --all --quiet --no-trunc | xargs docker rm
docker images --quiet --no-trunc | xargs docker rmi

Testing Against Experimental Docker

This cluster setup will use the development version of Docker.

TOKEN=$(docker-swarm create)
ISO_URL=$(curl \
    https://api.github.com/repos/ahbeng/boot2docker-experimental/releases/latest \
    | grep -o https://.*/boot2docker.iso)
docker-machine create --driver virtualbox --engine-storage-driver overlay \
    --swarm --swarm-master --swarm-discovery "token://$TOKEN" \
    --swarm-image "dockerswarm/swarm:master" \
    --virtualbox-boot2docker-url $ISO_URL swarm-master
docker-machine create --driver virtualbox --engine-storage-driver overlay \
    --swarm --swarm-discovery "token://$TOKEN" \
    --swarm-image "dockerswarm/swarm:master" \
    --virtualbox-boot2docker-url $ISO_URL swarm-agent-1
docker-machine create --driver virtualbox --engine-storage-driver overlay \
    --swarm --swarm-discovery "token://$TOKEN" \
    --swarm-image "dockerswarm/swarm:master" \
    --virtualbox-boot2docker-url $ISO_URL swarm-agent-2

Contributing to contained_mr

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2015 Victor Costan. See LICENSE.txt for further details.