Giter Club home page Giter Club logo

14feb2016's Introduction

Architecture

This project uses Vagrant, Docker and Chef together to achieve the goal defined in the specs.

Vagrant will launch a virtualbox VM, inside the VM through Vagrant shell provisioning docker-compose will launch 3 containers:

  • 1 web (nginx)
  • 2 apps (go)

then Chef will run inside each container.

This demo requires Vagrant installed on the local machine, in case Vagrant is not available, the demo may work if chef and docker are installed and available locally but I haven't tested this directly, I would recommend the Vagrant option.

The docker container images used are a bit old so the apt-gets are taking a little longer to update the packages in the containers.

I preferred this approach rather than using newly created images because using a third party docker image without my direct control is a better proof of genuine devops automation.

This, eventually, can be easily rectified tagging and pushing the containers on DockerHub or on a Docker private registry.

To install ChefDK inside the Vagrant box please uncomment it in the shell provisioning section at the end of the Vagrantfile.

Run the demo

To launch the demo please run:

~$ git clone https://github.com/fabiop/14feb2016.git && cd 14feb2016 && vagrant up

For the sake of this demo, docker-compose will run in foreground mode so all the logs will be visible in the main terminal without the need of logging in the Vagrant box.

When the docker-compose log stream will stop, after the 3rd chef run completes, the system will be up and ready to be tested.

Testing

Vagrant is configured with a bridged network , I preferred bridged over the port forwarding approach to avoid eventual port conflicts, so the Vagrant VM will get a dhcp entry from the local network.

To get the ip of the VM without the need to ssh into it please run this command:

vagrant ssh -c "ip a"|grep inet|grep eth

Then, once the VM IP has been determined, please test with the following command:

for i in `seq 1 10`; do curl http://<YOUR_VM_IP_HERE> ; echo ; done

Linting

The code has been linted and should pass foodcritic and rubocop tests

14feb2016's People

Contributors

fabiop avatar

Watchers

James Cloos avatar Niz avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.