DEVOPS test task
We have CI process in place. Our CI tool is handling build and deploy of our applications. We also have tools
monitoring performance of our platform.
It would be useful for the monitoring tools to know about any release so we can draw connection between performance
and code changes. Communication with monitoring tools is possible through API.
There is possibility that the API of monitoring tools won't be accessible and also the requests to the API are
sometime taking longer to run which might slow down the deployment process or even cause it to fail.
The solution of this problem has 3 parts. If you can think of different/better solution, you can design your one,
considering the problematic areas.
The environment for the solution
To finish the task ahead of you, you should have server capable of running the parts of your solution. Working with
virtualized environment is preferable. If you will run the machines (and how many machines you will use) using your
computer or you will use some external cloud provider is up to you.
1. The Script
You should create simple script which will be run by the CI tool and which will send information about the
deployment. As we don't want to have many different technologies installed on the CI Linux server, this script
should be as simple as possible, preferable in some scripting language (e.g. bash). If you would like to use some
higher language, please explain why.
Information which is send by script is now just number of release and date time of the deployment. For example:
$ producer.extension 2016.20 2012-07-08 11:14:15
These will be given to script by CI tool and in future we might want to add more attributes so it should be easy to
To run the script you should prepare your own environment. For the purpose of this test the script can be run
manually from command line, in production flow it would be started by our CI tool Bamboo.
2. The Queue
Because of possible problems with the monitoring tools API we want to have some message queue system which will be
highly accessible but occasional lost of messages in queue is not a huge problem. Select some of the current
messaging systems and write down reasons for your choice. Open source tools are welcomed. If you are able to,
install the messaging system and use it for the application. Otherwise, mock the messaging system in some way.
3. The Consumer
On the other side of message queue system should be application which will be waiting for new messages and sending
them to the APIs. If the message won't be accepted by the API, the message should be re-queued and tried again
As this interface between the API and queue system will be developed and maintained by multiple developers in future
it should be in versioning system (GIT is preferable). Our company is mostly working with PHP code, so this
application should be therefore also written in PHP, but if you are more comfortable with other object oriented
language you can use that one.
Currently we have 2 systems which the consumer will be sending information into. These have different URL addresses
and different data format. The system APIs look like this:
- Log system:
- URL: PUT /api/log
- Data format:
"datetime": "2016-07-08 10:08:15"
- Events system:
- URL: POST /api/events/create
- Data format:
It is possible there will be more APIs with different formats in the future, this should be considered in the
application design. For designing this application use Object Oriented Paradigm.
Even small application like this can always use testing on any level (unit, integration,...). All of this could be
probably done in couple of PHP files, but think of benefits of using some micro framework.
The actual API can be mocked in any way (simple address which will deny/accept any request, mocking of request
sending in application,...) as it is not part of this task.
If you don't know what to do with any part of this task, don't panic! Write down or draw how you think the solution
should look like and we can talk about the actual implementation.
Good luck, looking forward to see your solution!