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.

20 comments:

  1. This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.
    Android Training in Chennai

    ReplyDelete
  2. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.

    digital marketing course in chennai

    ReplyDelete
  3. 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
  4. Great post, I was looking for something like this one.

    ReplyDelete

  5. Wonderful blog.. Thanks for sharing informative Post. Its very useful to me.

    Installment loans
    Payday loans
    Title loans

    ReplyDelete
  6. Nice it seems to be good post... It will get readers engagement on the article since readers engagement plays an vital role in every

    blog.. i am expecting more updated posts from your hands.
    Android App Development Company

    ReplyDelete

  7. Hats off to your presence of mind..I really enjoyed reading your blog. I really appreciate your information which you shared with us.
    Devops Online Training

    ReplyDelete
  8. This article is very much helpful and i hope this will be an useful information for the needed one.Keep on updating these kinds of informative things...
    iOS App Development Company
    iOS App Development Company

    ReplyDelete
  9. I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.

    Fitness SMS
    Fitness Text
    Salon SMS
    Salon Text
    Investor Relation SMS
    Investor Relation Text

    ReplyDelete


  10. Its a wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way.Thank you so much

    Personal Installment Loans
    Payday Cash Advance loan
    Title Car loan
    Cash Advance Loan

    ReplyDelete
  11. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Mobile Marketing Service
    Mobile Marketing Companies
    Sms API
    Texting API

    ReplyDelete
  12. 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
  13. Nice information, it is very useful to me, thanks for sharing. More on Devops Online Training

    ReplyDelete
  14. great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
    web design Company
    web development Company
    web design Company in chennai
    web development Company in chennai
    web design Company in India
    web development Company in India

    ReplyDelete
  15. You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...
    Texting API
    Text message marketing
    Digital Mobile Marketing
    Mobile Marketing Services
    Mobile marketing companies
    Fitness SMS

    ReplyDelete
  16. Check it once through Devops Online Training Bangalore for more information on devops.

    ReplyDelete