Green-Software-Foundation / hack

Carbon Hack 24 - The annual hackathon from the Green Software Foundation
https://grnsft.org/hack/github
15 stars 2 forks source link

GreenCode - helping developers write greener code #86

Open djurisic3 opened 7 months ago

djurisic3 commented 7 months ago

Prize category

Best Plugin

Overview

GreenCode is evolving. My existing MVP, a robust static analyzer within VSCode, now embarks on a groundbreaking journey to integrate IF. This implementation is designed to revolutionize how sustainability departments monitor and forecast software energy consumption directly from the development environment.

Core Features:

Energy Consumption Analysis: GreenCode will now assess the energy impact of code changes, translating complex analyses into actionable insights. Impact Framework Integration: By incorporating IF, GreenCode will offer precise kWh forecasts, empowering developers to see the future energy footprint of their software as they code. Sustainability at Your Fingertips: Tailored for both developers and sustainability departments, our tool aims to bridge the gap between software development and environmental stewardship.

Questions to be answered

No response

Have you got a project team yet?

No, we would like your help to find team-mates

Project team

No response

Terms of Participation

Summary GreenCode revolutionizes sustainable software development by seamlessly integrating detection and suggestion of code optimizations within the developer's workflow, focusing on reducing energy consumption and carbon footprint. In the demo video, you can see two different code snippets, standard (unoptimized) and green (optimized with GreenCode). It leverages the Impact Framework to provide precise measurements of these optimizations' environmental impact. IF will be executed in the background of the VSCode Extension, in the demo video. IF with its Azure plugin is part of the GreenCode VSCode Extension as of version 0.2.1.

Problems The environmental impact of software development, notably its energy consumption and carbon footprint, often goes unnoticed, leading to inefficient and unsustainable applications. GreenCode tackles this by enabling developers to directly identify and rectify energy inefficiencies in their code, while the Impact Framework quantifies the environmental benefits of these optimizations.

Application GreenCode, a VSCode extension, empowers developers to detect and replace inefficient code patterns with energy-efficient alternatives in real-time. Working alongside the Impact Framework, it measures the environmental impact of software, offering a comprehensive toolkit for sustainable development by providing actionable insights and precise impact measurements.

Judging Criteria

Video https://youtu.be/Qe9_IBCE3r0

Artefacts https://marketplace.visualstudio.com/items?itemName=GreenCode.greencode

Usage Ensure Prerequisites: Confirm that both GreenCode and the Azure plugin for the Impact Framework are installed and configured in your VSCode environment.

Open Your Project: Launch VSCode and navigate to the project you wish to analyze.

Configure IF Settings: In your project, make sure you have an azure_test_gc.yaml (or similarly named) file as well as the .env configured with the necessary details for the Azure plugin. This includes specifying your Azure subscription ID, resource group, VM name you're monitoring. In the .env file: tenant ID, client ID, client secret.

Analyze CPU Utilization:

Open the command palette in VSCode using Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS). Type and select GreenCode: Run IF and display results. This command triggers the Azure plugin through the Impact Framework to start the analysis. GreenCode communicates with the Impact Framework, which then fetches and processes CPU utilization data from your specified Azure resources.

View Results: Once the analysis is complete, GreenCode displays the CPU utilization insights directly in VSCode. Look for the output panel or a pop-up notification in VSCode showing the CPU utilization percentage, observation window, and any recommendations for optimization if the utilization suggests inefficiencies.

Process The development journey began with integrating the Impact Framework's measurement capabilities into GreenCode, enabling real-time environmental impact assessments. Focusing on using IF to measure two different sets of instructions run in SQL (eco vs. standard), I conducted extensive testing to ensure the tool's accuracy and effectiveness in development environments.

Inspiration The inspiration behind GreenCode was the realization that software developers could play a pivotal role in environmental sustainability if given the right tools. By creating a solution that not only detects inefficiencies but also leverages the Impact Framework for impact measurement, I envisioned transforming software development into a force for good.

Challenges One of the main challenges was making the Azure plugin work in IF, I wanted to keep the workflow simple for the hackathon and had the idea of running the code on an Azure VM, but I had to make many additional changes (not part of the IF tutorial) for the plugin to work. The challenge after that was integrating IF as smooth as possible into the VSCode Plugin GreenCode.

Accomplishments I'm particularly proud of how the plugin facilitates a significant shift towards sustainable development practices. Its ability to detect, suggest, and, with the Impact Framework, measure the environmental impact of code changes represents a groundbreaking advancement in eco-friendly software development.

Learnings Developing the plugin taught me the profound potential of integrating sustainability into the software development lifecycle. I learned the technical challenges of accurate environmental impact measurement and the importance of providing developers with immediate, actionable feedback on their code's sustainability.

What's Next? GreenCode aims to broaden its detection capabilities, support more programming languages, and deepen integration with the Impact Framework for even more precise impact measurements. Moreover, GreenCode is currently in the process of being implemented in a corporate environment. By building a community around sustainable development, GreenCode will continue to drive the software industry towards a more environmentally conscious future.

iamkennis commented 6 months ago

I will love to be part of your team

Sophietn commented 6 months ago

Hi @djurisic3 I see you have the recruiting label on your issue. Are you looking for additional team participants? Would you like to attend our Launch event on the 18th March 2.30pm GMT, to discuss your project idea and attract team members?

djurisic3 commented 6 months ago

@iamkennis hi, let's do it, can you give me your email so we can get in contact.

djurisic3 commented 6 months ago

hi @Sophietn, yes I am, I would gladly join the launch event, can you send me an invitation

iamkennis commented 6 months ago

@iamkennis hi, let's do it, can you give me your email so we can get in contact.

amodukehindee@gmail.com

Sophietn commented 6 months ago

Hi both,

@djurisic3 great news you'd like to join our launch event.

Could you and @iamkennis please follow the participant guide steps?

Next step is to please register your project and ask any existing team members to register at the same link, under the same team name. From here we'll get your email address so I can invite you to the launch event. We'll also start a thread with all team members so you can communicate directly there. Thanks!

pchan2 commented 6 months ago

Hello, are you looking for additional members as I am looking for a team to join. 2-3 years experience in software eng, polyglot (JS, C#, Java, Python). Thanks

Aide-C commented 6 months ago

Hello, @djurisic3 I would love to join the project if you are still looking for teammates. I have coding experience in Python, C++, JavaScript, and a bit of Java (I would need to have a refresher).

djurisic3 commented 6 months ago

I think I could use some help, could you two give me your phone numbers, we could use Whatsapp for communication?

iamkennis commented 6 months ago

@djurisic3 Can I also share my WhatsApp contact too

cliftonreddy commented 6 months ago

@djurisic3 are you still looking for people to help? I have Java experience I can help with or can pick up anything the team is working on.

djurisic3 commented 6 months ago

@djurisic3 Can I also share my WhatsApp contact too

iamkennis, can you please share your Whatsapp number, if you are still available

iamkennis commented 6 months ago

08108444864

djurisic3 commented 6 months ago

can you please write the complete number with the country code

djurisic3 commented 6 months ago

@djurisic3 are you still looking for people to help? I have Java experience I can help with or can pick up anything the team is working on.

hi Clifton, are you still interested in the project? Can you give me your phone number so we can chat via Whatsapp