Good morning, Mr. Panda. Your mission, should you choose to accept it, involves the development and deployment of two nanoservices. Please read the following instructions before starting to implament your mission, you don't want to miss any important instruction, especially those in General Guidelines
You'll need a linux machine with the ability to run vms.
- Install Ansible (Any version above 1.8 and below 2.0 should be fine).
- Install Vagrant.
- Install VirtualBox.
- Mirror this git repo using the instructions here. Then clone it locally. (Please DO NOT fork the repo)
- Run
vagrant up base
and make sure you can ssh into the machine usingvagrant ssh base
. - Inside the vm execute
nodejs /tmp/bamboo-app/bamboo.js
. - Open your browser, go to http://localhost:8080, you should get some information about how much we love bamboo.
Great.
Your project is simple, as a DevOps panda you need to have the ability to develop nanoservices and create a mechanism for deploying them.
Below, you can find the description of your tasks.
Create two basic NodeJs/Python services, the first is panda-service which should serve static files from a directory called resources
. The directory should contain two files, small.png and medium.png. You may use any image that you like, as long as there is a panda over there.
The second service shall be called big-service, and should just maintain a counter of the amount of GET requests it served, and return it on every GET request it gets.
A sample NodeJS service named bamboo-app already exists here
Create an ansible role for each of the services. The role should install the service and make sure it's ready to be used in production (see General Guidelines). A sample role for bamboo-app already exists for your convenience. (Please note: samples are not full, and do not contain all relevant the details, you're expected to improve them, and add missing tasks). We understand there might be a short service downtime when re-deploying a service, that’s fine.
This part is a BONUS part, if you find this exercise simple and short, feel free to do it.
Create a simple utility for deploying both services. Your utility should support deploying a single service, or all of them.
Please make sure you have a decent --help
in your script.
A GitHub Pull-Request to YOUR DUPLICATED REPO, containing:
- The code for both big-service and panda-service.
- Ansible roles which takes care of provisioning both services.
- Modified base.yml which install ONLY the newly written services on the base VM.
- BONUS A wrapper script on top of ansible-playbook which deploys the latest version of those services.
The Pull-Request should contain a short description of the roles you created, and any other comment you’d like us to know of.
Your code should be as simple as possible, yet well documented and robust.
Spend some time on designing your solution.
Think about operational use cases from the real world. Few examples:
- Can you run the playbook multiple times without any problem?
- What happens if a service crashes?
- How much effort will it take to create a new service?