Inspiration

As a team of DevOps engineers, we constantly wonder whether the resources we’re provisioning are cost and energy efficient. Since a wide range of different types of resources is available, it can get very complicated in knowing how to choose the right and most suitable one. Therefore, the team came up with a unique tool that analyses your terraform code and recommends the most suitable types of resources for you to achieve your goals. Furthermore, clients have also wanted a greener and more sustainable solution that will ensure their infrastructure reduce their carbon footprint.

We also wanted to create a solution that would help tackle the climate crisis by aiming to reduce a company’s carbon footprint. Green Coding can help by providing engineers with a guide that would make their code more environmentally friendly. Therefore, we thought by providing Green Coding recommendations we could help make it easier for users to have environmentally friendly code.

What it does

Our tool provides recommendations on how to improve a user’s terraform code. The user uploads their files then using AI our tools will analyse the code and look for ways that the user can improve their code e.g. by using more cost/energy efficient resources. Then the user will receive the results in a user-friendly and readable way. This tool is also recommended to be used before terraform apply in order to eliminate high-cost resource deployment.

How we built it

We built this project armed with knowledge we accumulated from doing research for example on the best architecture to use and the ethics of AI. Working in agile, we had daily stand-ups and review sessions with senior engineers from our company. We completed this project with a team of 5 junior DevOps engineers split into groups each tackling the project’s main components: Frontend, Decision Engine, and Database. Below you can find each of these components described by what our prototype does and our vision for their future development.

Frontend - Using HTML, CSS and JavaScript we built a user-friendly website with a modern and elegant interface. In our Prototype, the frontend allows users to paste in their terraform code and receive recommendations on how to improve it as well as some statistics to help the user make a more informed decision. In future versions, the frontend will allow users to upload all their terraform files including any modules they are using.

Decision Engine - The Decision Engine utilises Azure Machine Learning resources. Azure Machine Learning gives users access to Azure Notebooks where AI scripts can be created and run to simulate the processing of data sets and to create the recommendation for the user’s code. The Decision Engine requires the use of a compute instance, and in the case of this project, the AI script that has been created does not require a very high compute power so the cheapest compute instance was utilised.

Database - The database was made as a SQL database. This is aligning with what the project wants to achieve, in line with cost efficiency. The database will hold records of Azure technologies (for the first iteration we are solely focusing on Azure VMs). Data is inserted into the database both manually and through a PowerShell script to automate the process of new VMs.

Challenges we ran into

Our team consists of DevOps engineers with 1-2 years of experience. We are called padawans in GFT. Most of us didn’t have related experience prior to starting this job. Therefore, this hackathon was a learning experience for us all. We were guided by senior engineers, but most of the work was done by us.

One of the most difficult challenges was to build an architecture that consisted of Frontend, AI, and Database into a single product. The most effort-consuming part was AI, where the decision would have been made. However, we realised that our team lacks expertise in this area, which could be fixed by involving more experienced colleagues or adding more time. Therefore, we decided to pause the development of AI and focus on other areas.

Additionally, in order to complete this project, we should have a full dataset with all types of resources that Azure has to offer. Plus, we had to create a logic that would calculate the effect on the environment, which relates to Green Coding and Sustainability. Considering a large number of parameters and calculation creation itself, we realised that we should prioritise building infrastructure rather than datasets at this stage.

Accomplishments that we're proud of

Discovering new azure technologies has been a key accomplishment for our team. Specifically learning about AI and ML techniques. The frontend website is a feature the team is proud of because it adheres to not only our company’s branding criteria but also has a high level of professionalism to it. We are proud of our ability to work cohesively and effectively as a team, we implemented an agile methodology when it came to doing this project including having daily stand-ups, reviews, and sprints. This in turn made it easier for the team to recognise what needed to be improved on each week.

What we learned

We learned multiple things during this project. For example, we learned how to work with AI technologies and Azure ML Notebook. We also learned about Azure’s Cosmos Database and how to use it. Moreover, we improved our knowledge of Green Coding and Sustainability. We are going to use this knowledge to achieve our company’s goal of becoming more environmentally conscious.

What's next for IaC Sustainability Assessment Engine

The next step for IaC Sustainability Assessment Engine would be to work on AI and creating datasets. Datasets should have information about all resources and the types that Azure has to offer including their names, prices, disks, and energy consumption. Then, we create a logic that would decide what recommendation to give based on datasets. Eventually, it all should be connected to a Frontend, where the user is able to see the output. After the prototype is fully working, we should test it internally first by encouraging our colleagues to use it. This would result in feedback that we could use to change part of the solution. Eventually, we could advertise it in dedicated forums or to our clients and promote it as an open-source tool. Alternatively, the IaC Sustainability Assessment Engine could be a Microsoft-only tool instead that would encourage developers to use Azure services with terraform.

Built With

Share this project:

Updates