Skip to content

Commit

Permalink
First draft of the challenge 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois LP committed Jul 28, 2022
1 parent f7d43f3 commit 2c2a96a
Show file tree
Hide file tree
Showing 11 changed files with 2,036 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
REDIS_HOST=
REDIS_PORT=
REDIS_PASSWORD=
SERVER_PORT=
NODE_ENV=
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ typings/
# TypeScript cache
*.tsbuildinfo

# No one will ever read this
.considerations.md

# Optional npm cache directory
.npm

Expand Down Expand Up @@ -102,3 +105,6 @@ dist

# TernJS port file
.tern-port

# Visual Studio Code
.vscode
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
# Remazing-Devops-Challenge
DevOps Challenge to evaluate basic Ops skills
# Remazing DevOps Challenge

DevOps Challenge to evaluate basic Ops skills - [Click here to go the challenge manifest](./docs/challenge.md)

## Getting started

1. Have a Redis instance in local
2. Create a `.env` file and set `SECRET_KEY=` to a value. This secret should not leak!
3. To run the code:

```sh
# Coded with node v16
npm install

# Push jobs to a queue
npm run schedule

# process jobs in a queue
npm run process
```

### Main packages

- [BullQ](https://github.com/OptimalBits/bull) for Redis Queue
- [Prom-client](https://github.com/siimon/prom-client) for metrics

13 changes: 13 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const config = {
env: process.env.NODE_ENV || 'local',
server: {
port: process.env.SERVER_PORT || 8080
},
redis: {
port: process.env.REDIS_PORT || 6379,
host: process.env.REDIS_HOST || '127.0.0.1',
password: process.env.REDIS_PASSWORD || ''
}
}

module.exports = { config }
3 changes: 3 additions & 0 deletions deploy/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

echo "I wonder how we can deploy this app... 🤔"
56 changes: 56 additions & 0 deletions docs/challenge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# DevOps Challenge

Use DevOps best practices to __deploy__ & __monitor__ work queues.

A developer just pushed a new repository and it needs to be deployed to production. 1 service is pushing images and videos to a queue, and another one needs to process them.

The service should be able to process 2000 items in under 5min and to scale.

Environment variables must be configurable per environment and secrets should not leak.

Please document how we can run it.

Please shortly document your justification of technology/mechanism choice.

## About the challenge

This project is a simplified version of NodeJS applications that are running at scale in Kubernetes with a production set-up.

We are looking at 3 technical points:
- basic Docker knowledge
- CI/CD
- Observability

A real production environment takes time and effort to build, this challenge does not aim to do our work or to achieve complete production grade but instead to highlight typical "DevOps"/"SRE" problems and workflows. Have fun ✌️

## Notes

- The challenge is more about the thinking process than tools. Not using the recommended tools is OK.
- The goal of this challenge is to check basic knowledge about CI/CD pipeline, and docker.
- At Remazing, we use Bitbucket pipelines. Using it is recommended but optional.
- Kubernetes is our _Go-to_ solution to manage workloads at scale. It is recommended but optional. If you do use it, use [Kind](https://kind.sigs.k8s.io/) or Minikube to simulate production.
- Grafana for monitoring is a simple & good solution but feel free to use any tool (The [free plan](https://grafana.com/products/cloud/) is quite extensive).
- A staging environment is optional, but the deployment should be configurable enough to support different environments.

## Steps expected

- [ ] The scripts can be run in docker
- [ ] CI/CD pipelines (build & deploy)
- [ ] Deployment to "production"-like environment
- [ ] Observability on the Apps & Redis
- [ ] Scaling to achieve high throughput

## Open questions

- Does your deployment scale well?
- Can you identify a single point of failure?
- Observability
- How do you monitor the app in production?
- What do you monitor and why?
- Any feedback for the developers? ;)

## Resources

- [Google - workbook](https://sre.google/workbook/table-of-contents/)
- [Google - SRE book](https://sre.google/sre-book/table-of-contents/)
- [Grafana - monitoring microservices methods](https://grafana.com/blog/2018/08/02/the-red-method-how-to-instrument-your-services/)
Loading

0 comments on commit 2c2a96a

Please sign in to comment.