Saturday, July 16, 2016

Docker DevOps Around the Globe

When I completed the Docker Birthday #3 App Challenge I was presented with the following telling globe image that shows where other lab completions were occurring around the Globe:

Successful Lab Completions Per Country

Analysis

The biggest surprise, for me, were the number of successful lab completions from the Nordic countries (Norway, Sweden, Finland).

Way to go up (and over) there!

Also of note:
  • More Mid East completions than India
  • Spain includes North Africa and that count was higher that I expected
  • The Kazakhstan count also includes Turkey
  • Participation from Africa
  • No participation from Australia or Far East


Please let me know if I interpreted these numbers properly. Perhaps, part of the map was missing from my view.

My Completion Certificate

That bumped the total count for the US East up to 214.

The Voting App

This is what the running app looked like:

Components

We developed an app using Docker Toolbox that included:

Front End

  • Python webapp which lets you vote between several options
  • Node.js webapp showing the results of the voting in real time

Back End

  • Redis Queue to collect new votes
  • Java Worker which consumes votes and stores them in the database
  • Postgres database backed by a Docker Volume

Architecture Diagram

Project Details

Docker-Compose YAML File


version: "2"

services:
  voting-app:
    build: ./voting-app/.
    volumes:
     - ./voting-app:/app
    ports:
      - "5000:80"
    networks:
      - front-tier
      - back-tier

  result-app:
    build: ./result-app/.
    volumes:
      - ./result-app:/app
    ports:
      - "5001:80"
    networks:
      - front-tier
      - back-tier

  worker:
    image: manomarks/worker
    networks:
      - back-tier

  redis:
    image: redis:alpine
    container_name: redis
    ports: ["6379"]
    networks:
      - back-tier

  db:
    image: postgres:9.4
    container_name: db
    volumes:
      - "db-data:/var/lib/postgresql/data"
    networks:
      - back-tier

volumes:
  db-data:

networks:
  front-tier:
  back-tier:


This Compose file defines

  • A voting-app container based on a Python image
  • A reslit-app container based on a Node.js image
  • A redis container based on a redis image, to temporarily store the data.
  • A Java based worker app based on a Java image
  • A Postgres container based on a postgres image
Note that three of the containers are built from Dockerfiles, while the other two are images on Docker Hub. To learn more about how they're built, you can examine each of the Dockerfiles in the two directories: voting-app, result-app. We included the code for the Java worker in worker but pre-built the image to save on downloads.

The Compose file also defines two networks, front-tier and back-tier. Each container is placed on one or two networks. Once on those networks, they can access other services on that network in code just by using the name of the service. To learn more about networking check out the Networking with Compose documentation.

To launch your app navigate to the example-voting-app directory and run the following command:


$ docker-compose up -d


This tells Compose to start all the containers specified in the docker-compose.yml file. The -d tells it to run them in daemon mode, in the background.

Last you'll need to figure out the ip address of your Docker host. If you're running Linux, it's just localhost, or 127.0.0.1. If you're using Docker Machine on Mac or Windows, you'll need to run:

$ docker-machine ip default It'll return an IP address. If you only have one Docker Machine running, most likely, that's 192.168.99.100. We'll call that . Navigate to http://:5000 in your browser, and you'll see the voting app, something like this:

References



This work is licensed under the Creative Commons Attribution 3.0 Unported License.

26 comments:

  1. Thank you for sharing your info. I really appreciate your efforts and I am waiting for your further post thanks once again.
    Regards,
    DevOps Consult

    ReplyDelete
  2. Very useful post and thanks for sharing.
    mobile app development company

    ReplyDelete
  3. Really cool post, highly informative and professionally written and I am glad to be a visitor of this perfect blog, thank you for this rare info!


    Devops Training in Marathahalli|

    Devops Training in Bangalore|

    ReplyDelete
  4. Nice information, it is very useful to me, thanks for sharing. More on Devops Online Training

    ReplyDelete
  5. I have read your blog and i got a very useful and knowledgeable information from your blog.You have done a great job .Please visit our page Devops Training in Chennai
    Devops Training Institute in Chennai

    ReplyDelete
  6. Nice Post i learned a lot From the Post Thanks for sharing,learn the most ON-DEMAND software Traininig in Best Training Institutions
    Instructor-LED Salesforce Online Training
    Professional Salesforce CRM Training
    Salesforce Online Training

    ReplyDelete
  7. Great informative bog. Thanks for sharing such a valuable information with us.

    Guest posting sites
    Technology

    ReplyDelete
  8. Thanks for the great post on your blog, it really gives me an insight on this topic.I must thank you for this informative ideas.I hope you will post again soon.
    best vmware training institute in bangalore
    vmware institutes in bangalore
    vmware Training in Nungambakkam
    vmware Training in Vadapalani

    ReplyDelete
  9. Thanks for your post which gather more knowledge about SEO. I read your blog everything is helpful and effective.
    SEO Training in chennai
    SEO Course in chennai
    Digital marketing course in chennai

    ReplyDelete
  10. Hey Nice Blog!! Thanks For Sharing!!!Wonderful blog & good post.Its really helpful for me, waiting for a more new post. Keep Blogging!
    SEO company in coimbatore
    SEO Service in Coimbatore
    web design company in coimbatore

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. While there are many other options when it comes to best baby monitors, these two are some of the most popular. They are both very reasonably priced, and they are both incredibly safe to use and very easy to set up. They are a great choice for new parents, and a lot of people use them.

    ReplyDelete
  14. Well Described. Thank you for sharing valuable information. Things are very clear and have good explanations. I really appreciate your technique of writing a blog. Please keep sharing more such blog

    Fantasy Football App Development

    ReplyDelete
  15. Read here how much does it cost to create a sports betting app, And the features of the app? And Build A Sports Betting App From Scratch.

    ReplyDelete
  16. Infycle Technologies, the top software training institute and placement center in Chennai offers the No.1 Digital Marketing course in Chennai for freshers, students, and tech professionals at the best offers. In addition to Digital Marketing, other in-demand courses such as DevOps, Data Science, Python, Selenium, Big Data, Java, Power BI, Oracle will also be trained with 200% practical classes. After the completion of training, the trainees will be sent for placement interviews in the top MNC's. Call 7504633633 to get more info and a free demo.

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete