The Idea
Our problem is that our product has many different platforms and we don't have all the different platforms in each of the teams so we often have to share our hardware. The problem with this is that in juggling the hardware between teams some hardware can often get lost along the way.
The major problems we have are:
- Finding the a specific platform that you need to test.
- Finding hardware on a specific code level.
- Finding hardware that is in a good state for you to borrow.
- Figuring out which hardware isn't being utilised.
- Finding out who you should talk to about borrowing a piece of hardware.
Finished Product
Tech
This project is split into two smaller pieces:
- A Python REST API which performs the same ssh command to multiple machines at once and combines the result into a single response.
- A React Web Frontend which displays a table of information for multiple machines.
Python Flask REST API
Multithreading
I tend to avoid using multi-threading whenever I can because it massively increases complexity but in this situation it seemed like the correct thing to do.
Stateless-ish
I decided that we should try and keep this fairly stateless and so the only real state that the API has is a simple in memory cache which wouldn't even be necessary if it wasn't for the sheer number of machines that we are trying to perform the commands on.
The caching itself is only held for 15 minutes for each machine to ensure the data isn't too stale.
React Frontend
Search and Filter
Infrastructure
Docker
Both projects were there own separate containers and the frontend simply needed an argument on run which passed in the address for the API.
Lessons Learned
Architecture
Containerisation
I will definitely be doing a lot more with Docker in future.
Improvements
- Support for the OpenAPI /Swagger API Specification.
- Adding Docker Compose support for deploying both of the Containers together.