This devops challenge's goal is simple - build a full integration, deployment and monitoring pipeline for a service. It will allow you understand the challenges we face in Forage everyday, and to demonstrate your skills.
We look at the pipeline as consisting of three stages:
- Continuous Integration - Any change in the repository that is pushed is automatically built as a docker container and published to a docker registry.
- Continuous Deployment - Latest docker image deployed to a container platform and available to use.
- Continuous Monitoring - The service health status is always available, and alert is sent when the service is not functioning. Logs are delivered and available.
The exercise is focused on the CI
and CD
stages.
- Create a full Continuous Integration and Continuous Deployment processes as defined above.
- The outcome should include:
- Configuration / script files as part of the repository.
- Permissions to the repository, where we can commit changes, and see that the pipeline was triggered and new docker was uploaded to the registry.
- URL/IP of the deployed service - so we can check it over http.
- Access to CI tool that we can access and see the pipeline in (OPTIONAL).
- Access to the deployment environment where we can see the deployed artifact (OPTIONAL).
-
- Bonus: Continue to Continuous Monitoring process as defined above (Use the
/health
endpoint in addition to logs).
- Bonus: Continue to Continuous Monitoring process as defined above (Use the
This github repository is a NodeJS
demo app of a very small users service.
Below are the instructions of how to build, run and use this service.
npm install
npm run start
GET
- lists the list of existing users
- Response:
[
{
"_id": "5c20ca1d2cdc846b4de1f6ab",
"name": "u1",
"date": 1545652765281
},
{
"_id": "5c20ca81c23ea46b5089884b",
"name": "u2",
"date": 1545652865843
}
]
POST
- add a new user
- Body: new user name
{
"username":"<username>"
}
- Response: created user, including ID, and created date:
{
"name": "<name>",
"date": 1545657494671,
"_id": "5c20dc96e4f6066bc12ab11e"
}
GET
- report on health of the service
- Response:
- In case all OK: Status:200 Headers: System-Health:true
- If error occurs: Status:200 Headers: System-Health:false Body: Information about the error in json:
{ "status": "DB Down" }
The users service works with a MongoDB
to store its users.
Database name: devops-exercise
Collection name: users
MONGO_URI - uri of the mongo DB
-
Although this "users service" is very small and focused, we should be prepared for multi-environments (dev, staging, production, etc...) with full pipeline (including testing, linting, and more...) in the future. Make sure your solution is opened for such future changes.
-
Use whichever CI/CD tool you want.
-
Use
ECR
(AWS Elastic Container Registry) as the docker registry andECS
(AWS Elastic Container Service) as the docker platform. -
Work on local github repository.
-
Make sure the solution is private, not public. Only available for you and us.
-
Consider using managed services. For mongo you may use
Atlas
- https://www.mongodb.com/cloud/atlas. -
For the sake of the exercise,
/health
endpoint randomly returns that the health is false. -
For simplicity, the service logs all the requests to the console.
Don't hesitate to contact us with any question.
Good Luck!
Team Forage