 Hello. Hi, so thanks for coming everyone. My name's Fergus, this is my colleague Shimon and we want to talk to you a bit today around some of the work we've been doing in the GreenSoft Health Foundation which is one of the foundations under the Linux Foundation umbrella. I'm the chair of one of the projects and Shimon is the co-chair of one of the projects so we're just going to kind of explain a little bit about what the GreenSoft rydych yn cyd-dweud ar gyfer o'r mwyaf o'r projektyn ydyn ni'n gofio, ac rydyn ni'n gan y gallu gwneud yn bwysig o'r ddweud ac yn ddweud. Yn y gweithio'r projektyn yma, mae'n gwneud am y cerddwyd gyda'r projektyn yma, yma'r un o'r parwysion yw'r cyfnodd Sdk, sy'n ddod i'r cyfeinio'r cyffredig, ac mae'r cyfnodd CICD pipeline, oherwydd rydyn ni'n fawr i'r cyfnodd ddweud. Beth angen dw i'w dwy'n cael ei wneud i'w Chymyn o'r reagent yma'n ymlaen?bod, ddwi'n dod wrth i'r wych ar wirbydd eich cyfrof guidance ar gyfroedd CSF, wedi cyfroedd CSF, ar gyfer cydaniaeth hynny. Yna mae fy mod i ddim yn ysbeth cos yn siwtio ar gyfer rydych chi. Ac mae'r cyfroedd CIS, i ddin yn ysbeth, neu y gallwn hynny yn cymru cyfroedd cyfroedd cyfroedd cyfroedd cyfroedd cyfroedd CIS, ac dros awdurdod yn ganlymwys y projello a muwg'r cyfynnwys iaith cyfnodi'r sgif . Rhaid i fi gilydd y ffordd y Gymraeth Gweithgaf nhw? Felly rydych yn fawr ei gweld iddyn nhw. Rhaid i fi'n gymryd Fardd Gweithgaf nhw yn oed yn ôl gweithio mewn cydweithio ymgyrchu yma gan fvargrifeni. today we will talk a little bit more about the tooling specifically some of the projects that we're running in order to generate the tooling that people can use to ensure that they're getting green software. I'm going to brush over these so we can get into the demo and things but there's a manifesto online which you can read if you just google green software foundation or green software dot foundation is the website you can read sy'n gwneud o tiesiol sy'n gweld fynd i'r ddechrau sydd o ysgolio a'r sgolio, ac oaf i'r prathau dechrau. Gwylwyr maen nhw'n gŷnol ar sydd eich gryffydd pern o gwybod gyda'r cyfrwyngau newydd er mwyn i gwrthu gen i maen nhw gwn gwirio ar gyfer y gwirio i gyrdoedd yma, a'r gyrddur ac yn gyrwbeth o fwrdd gwiswng gwirio ar gyfer gwirio? Mewn ysgrifennu bwrdd ei wneud o gweithredau One is sustainability within technology. Stud, sustainability within the technology that we're using. If you think about your laptop you got hardware, chips, software all sorts of carbon going into the manufacture but also the running of your laptop, the energy that it uses but also the energy in the cloud service it relies on. Also there is this idea sustainability with technology. This might be looking at how we can improve efficiency of processes Be tynnu o'r tynnu yn unigol, mae'nungsibu weld i'r byw, a'r cyfweld i chi eisiau cydyddio amiodedraethau, cymdeithasol iaith deimlo, unigol, gyfan systr yn iaith. Ynno, byddwn ei wneud yn cael eu cyfanyddiol임 yn cefnogaeth, fel y maes y plawdd enghreifftid yn datblygu, i'r cyfanyddiolydd a'r cyfanydd wedi yn ymddangos arnod yn cael eu cyfanydd. Yn rhaid i'n mynd i'ch cyfeidio'r accwr gwylliant what we're talking about today across green software. So we are talking about software, things like facilities management, and especially energy usage will come up quite a lot because that's where the majority of the carbon in using technology is going to come from. We do also consider embodied carbon, which is basically the carbon that it took to manufacture a chip or a computer or a server that is essentially trapped in that device until it's recycled or reused. We do ond there are some aspects of green software which have blurred out a little bit on the screen. Things like water usage. The amount of water it takes to produce a device you may have seen adverts around online around the amount of water it takes to produce a smartphone and why using a refurbished smartphone has a great impact on the environment just because of the water usage alone that goes into manufacturing smartphones. Also, things like single use ond mae'n cael ei gweisio arddangos a gynnig dechrau – dyna ond allan nhw ydych chi gael. Dyghodd, hwnnw nes yn fwy gwaith na sicrhau'n gwybod, gan ymweld o'r pryd Cymru a'ch ges proceedingau. Ioriad yn ymgyrch yn ddaeth yn bwysig rydym ni, ond rydym yn ei erioed, ond i wych yn bwysig bod hynny am mwy o gyflym siar. Ond y gallwn eitemigau'n cyffredinog, sy'n ei gael iawn. Mae'r iawn eitemigau cwestior ffnwyr i dduch yn ei hunain. Yn mynd i ddisgwetiau, yn ymgwych y rhai ffnwyr sy'n, yw'r hwn, ymlaen ar gyfer y system cyffredinog, beth ydy'r hynny mae'r effeithiaid yn yr cwestior hyffredinog, yn llai ei bwysig ar y cyfredinog, the hardware efficiency of that software and the the carbon awareness. So excuse me, so this is really a methodology for measuring the the carbon in software and the purpose is to help users and developers be more informed about their choices, about what they're developing, what they're deploying, and what technologies they are using so that they're more aware of the carbon impact in and around the basically what we're developing every day right. So what do you actually need to create an SCI score? Well we've come up with some some steps here. First is decide what you're actually measuring at any one point and we'll talk a little bit about this in the in both of the projects. So we call this the software boundary so which actual have a think about which actual components you are looking at in the in what you're trying to measure the SCI. The second thing which I'd like to call out as kind of specifically important is what we call the scale and this is essentially what you're measuring against. So the software carbon intensity per watt, if for example you're just creating an API that might be per API call, if you had a full website maybe per user it may be per per transaction there's lots of different ways you can measure that which is quite important but that needs to be stable for the software that you're measuring against and it needs to make sense for the use case. You then need to think about how you're actually measuring that what quantification methods you're actually using this is a big a big question mark around SCIs because that data source needs to be reliable we need to know how much energy a particular chipset is using or a particular data service is using so how you're actually measuring that and then quantifying that so for each every value within your boundary quantify the software carbon intensity and then the fifth and final one is report how you're actually thinking about reporting that back to the user back to the developer so they can actually make informed choices and we'll talk a little bit more about the type of choices they might make when we actually go through the projects themselves and then four and five I won't go into too much detail around the specifics of the software boundaries and the core characteristics but this is just the the full specification so so these slides are available so please do go through and have a look but just to like go back to the point of what the SCI is it's the this is a methodology for calculating the rate of carbon emissions for any software system so it doesn't actually matter what the software system is using these these five steps we can we can calculate the SCI and then use that as a baseline to compare against other applications other pieces of software and the aim is would essentially be to reduce the SCI the software carbon intensity of any piece of software or development that we are are building so I'll hand over to Simon now to go over the specifics for the carbon aware SDK thanks figures so before I introduce carbon awareness itself I have to do a quick intro to to what actually is carbon awareness and we will start off by just simply explaining what what it actually is so carbon awareness in principle is simply doing less when the electricity is dirty and doing more when it's clean and what do you understand by cleanness on dirtiness of energy if you look at the diagram here on the left basically energy is more clean when the composition of where the energy comes from is more focused on renewable energy so stuff like wind or solar then we can see that the carbon intensity so how much carbon is produced per kilowatt hour is smaller so that is well what actually mostly is about and how do we actually apply carbon awareness in software so how do we use it there are two main methods of doing that the first one is by doing time shifting so that's moving our shifting our load to different times of day because basically electricity might be cleaner at a different time of day maybe like at noon or something there is more sun so there is more solar in the grid and then there is a smaller carbon intensity so by time shifting we can take tasks that can be performed asynchronously so such things like training an AI model or maybe posting some invoices and doing it either later during the day or even at a completely different time and then the other option is by doing location shifting so location shifting it's a very similar principle but instead of moving it in time we are moving it in space so we are looking at what other locations the electricity might be cleaner so some tasks that aren't like region bound which for example the data doesn't need to be specifically in that region that can be moved anywhere at all we can move to a different location to produce this carbon and I'll touch upon some of the carbon aware pain points I won't dive into them too deeply because we want to get to the demo I think that's our main core of the presentation here but some of the most important carbon aware pain points is understanding the return of investment so why do we actually might want to care about carbon awareness what do we gain from it next one is disparate integration approaches this being a new thing there's a lot of different teams trying to achieve this at the same time and we want to prevent people from reinventing the wheel every single time so we don't create different approaches with different data sources because that's just it's going to be too hard to track what is actually the standard next thing is that teams are blocked without data providers so if we don't have access to carbon intensity data or other stuff there is no way of moving forwards auditability is another thing so we need to understand why certain business decisions are made why do we decide to actually shift some load to a different region what is the actual gain from it next one is the integrity of approaches so how can we actually be sure that we are not greenwashing stuff so how do we know that the data we're using the data on which we base our carbon aware decisions isn't isn't false or isn't skewed to cause us to make false decisions another thing is that there's oh you might notice as well that there's an increasing pressure in legislature and regulatory compliance from bodies like EU for example to push towards making greener software and businesses might want to get ahead of the problem and to address it before it becomes the problem and be ready for when carbon awareness is going to be the standard not the option and finally this all leads up to the need for a unified approach to have a single single tool to both to address and to create carbon aware products so why a carbon aware SDK we'll start off by showing what our the carbon aware SDK we at GST have developed so it is a piece of software that sits between your application which might be somewhere in the cloud or locally on your computer and the data providers so the data might be coming from data sources such as what time or electricity maps or it can be even your own data you've collected and you've used and what the SDK does is it gives you a single interface for incorporating carbon awareness into our applications for a single point for adding carbon optimization logic as well so if around through the business you have some already predefined options for calculating stuff around carbon or decisions that you make around carbon instead of making them repeating them for every single piece of software you can just have a single single point of action where you analyze the data and you just pull the SDK and you get all the data from from that single centralized point so just yeah and the other thing that's quite important is it gives you the option to measure the operation carbon intensity of your platform so what that means is it can let you check what is the carbon density at right now at this current point by checking the current carbon density data or even allows you to run hypothetical models so looking at future data and predicting how your software how your platform might do in the future and the next one some of these points are already repeated as well so i'll run through them quickly so we do want essentialized carbon awareness intelligence we do want a single spot where which which we access to to make our carbon carbon awareness decisions from we don't want to repeat this in every single piece of software you just want a single one um the SDK gives us the option to also abstract the data providers we don't have to have custom apis for each one of them we can just pull the single SDK or api um and still get the same results no matter if it's what time that's your data provider electricity maps or even your own data you've collected um once again it lets you abstract the carbon logic away from your software to a single spot um and gives you the option to also protect and manage secret keys secrets and keys uh for accessing those services um so you don't have to do that in your own software you have a single spot where you do it and i'll move on to the demo um i think i'll have to put away the microphone so hopefully you can still hear me fine without without it okay great and let me move jump to the demo so the demo is in a Jupiter notebook cos uh let's join us carbon awareness is also something that is quite important to uh data scientists as well and this being a tool that's often often used by them i decided to create a demo in in the uh in a notebook and uh we'll start off by just throwing a number to you generally what i've come to a conclusion after running through those calculations is that making carbon by making applications carbon aware we can decrease the carbon footprint of software by up to 76 percent so that's based on the data we are analysing later on in this slide in this uh in this notebook so that's pretty pretty a big quite a big improvement in my opinion um and we'll start off by simply showing off time shifting so as i mentioned before carbon awareness can be applied by two main principles like time shifting and location shifting so we start off with time shifting and the scenario is that we have a software engineer that is running some computationally intensive uh data processing job and he's running it at 8 55 p.m. every single day and the job is run in west central yes uh azure data center um and what they want want to do is they want to see if maybe running it at a different time of day um might produce less carbon emissions um because maybe there is more solar energy in that grid during the day so what they do is they can run the uh sdk so i'm not going to run through all of the cells but we can already see the results because i've pre-run them before this talk um what we want to focus on here is this section because this is just initialisation of the sdk and then this is actually what is pulling the sdk so what he does is he gets uh he he goes that gets emission data for location by time uh end point so maybe i should explain what's actually happening here because i haven't really introduced that what we have here we have is we have the sdk deployed as a web api somewhere in the cloud and uh what we are doing here in code is uh we're just configuring it because what we have is uh we have a client library that interacts with the sdk right um and what we can do now is we can simply pull the already deployed sdk and get data from it and this particular instance we we're using what time as the data provider um yep can just check the time okay we're still fine um so what the software engineer can do is they can pull it to see uh the time from from the beginning of the day until the end and they first they can check what is the well what is the current carbon intensity so at the time they're running it at 8.55 pm when they pull it we can see that it's 928.5 grams of 0 to per kilowatt hour so that's quite a bit and what they can do next is they can call a different uh end point so it's the emissions by locations best end point of the sdk what that end point gives you is um the best time and location uh with the lowest carbon intensity so they provide as input uh their region their sorry they're interested in the start time which is 12 am previous of that day until the end of that day and what they get in response after running this query is they get the region which they're interested in so that's the west central s but simply mapped to to the what time region so the data provider region and they get the carbon carbon rating of that so we can see that by just moving it from 8.55 pm to 11.55 pm so that's the time we receive the carbon footprint can be decreased by 47 percent and that's based on a single data point of a single day so what we can do now is we can do the same thing but looking at it on a 55 day scale so what would have happened if you did this 55 days ago the sdk also allows us to do that because it's audible it allows us to check how the data would have been some time ago so what we do now is once again pull the sdk and we get all of the data for 55 days and we sort it nicely using some python tricks to get only the data at 11.55 in that region we put it on a table and we can see in comparison for all the different days from 22nd of june this year up to the 15th of august for the 8.55 time and 11.55 at that region and if we plot it on a graph we can see that on average at 11.55 the carbon intensity here is much lower than at 8.55 and if we were to do some calculations and get the average percentage decrease overall over those 55 days ago if we did this shift 55 days ago we'd have a 38.76 percent decrease so it's a bit smaller smaller than on the day we looked at before but overall it's still quite a big a big big decrease sorry not an increase a big decrease in the carbon carbon emitted let me just check the time okay still good to go so this is time shifting next we're looking at is location shifting so let's say that the software engineer we're looking at he is currently restricted to only work in the US regions because that's his company policy and he cannot move outside that that's a fairly valid restriction so we're looking at those particular azure regions we're interested in and once again we're only looking at at the time that was of interest for us the time you found best for that job in that particular region so 11.55 and what we get is that the best region to do it for once again we determine the best region by pulling the emissions by locations best end point and we get that the best region is azps which maps to the azure region west us 3 and just by looking at the at the location shift on a single data point we already get a 30.3 percent decrease of carbon emissions so already another increase and that's on top of the previous one so that's not combined that's a further 30.3 percent decrease and what we can again do is do a little experiment by looking what would have happened if we did this 55 days ago um so how would we have how much would they have saved carbon if we did this 55 days ago are we still fine for time or okay lovely um so again we repeat the same thing as for the time but instead we look at the locations so we pull the emissions by locations end point what that end point gives us is the emission data for a list of locations in a particular time window and the locations we're interested in is the west central less so the one that where we originally performed that task and west us 3 and after sorting the data and putting it in a nice panda data frame we have all the data here where we can compare it um and we'll just move on to the plot so we can see it more visually and this blue line here is the new region we're looking at so the west us 3 region at 11 55 p.m and this is the west central us region at 11 55 so if you remember correctly before when we looked at west central rest there was uh we look at um was it eight eight fifty or something like that and that had an either higher carbon intensity index of all all of those days and we can see that this always is almost always be uh under west central yes so if you look at the average average decrease we can see that it isn't as good sorry miss clicking um it isn't as great as on that day um and we can even see that on the graph that this day was very lucky there was a very big dip but still on average it's a further 18.18 percent decrease over the 55 days so that's still a really good result and the last thing we're looking at is uh we're looking at the location shifts globally so something I only touched upon previously during the presentation about having fully mentioned is that if our company for example has a restriction for us to stick stick to only a certain regions to a certain country maybe we cannot move our data outside of our country for some reason uh because it's sensitive we can still look how how our carbon intensity carbon emissions would have changed if we could do it anywhere in the world and maybe build a business case to convince our our company to change this uh change this regulation so we can move it somewhere else so here we're looking globally we're looking at uh almost all of the azure regions that are supported um by what time and once again we are using the handy emissions by locations best endpoint and what we get here is that the best location to perform this task is actually France and it has a carbon rating of 257 grams and again here in this place we are only looking at the single day of data it's the same day we've looked at previously at 11 55 p.m and just by looking at that day we get a decrease from the original region which was uh i mean sorry we get a further decrease of 25.38% so let's confirm that by looking at the bigger batch of data and looking at 55 days so this is just repeated so i'm just going to scroll through it and get to the graph which is easier to to look at and more pleasant so once again we are only looking at 11 55 because we have decided that this is the best time in western Australia's region and we can again see that this was our initial location shift which gave us again a decrease and this if we could have moved it to France would have been yet another quite big carbon emission decrease so if we go down to it and look at the average we can see that the carbon intensity percentage so maybe i'll point here so the carbon intensity percentage decreased as a result of location shifting from west us 3 so from here to front central would have been 41% and the result of doing the location shift from the original region from west central west would have been 51.76% so as we can see carbon awareness definitely does play a big role in making our our software more green because just by being carbon aware and just by looking at location and time and not running it by default as a nightly build always at night because that's how it we always did or always at 8pm because yeah that's how we always did it for that project we can look at different times different locations and make our decisions more informed about the well the carbon produced okay and let me jump back to the presentation so we're gonna skip or maybe i'll just do a quick run through well once again we're visiting the end the pain points so what we get from the sdk is we actually have the ability to run hypothetical models and understanding well what is the impact of moving stuff of actually making our application carbon aware and how can we look at in the future or in the past as we saw in the demo we get a single unified approach to create a standardized tooling give the developers a single a single tool to you so they don't have to learn different ways how we can apply carbon awareness but just use a single tool and apply it for for everything something i haven't mentioned before is the the sdk gives you uses swagger and open api to generate sdks for well up to 50 languages supporting by open api so it's not limited to just to just a dotnet or which we develop it in but it can be almost any language many any mainstream language available um it is highly auditable so we have the ability as shown in the demo to replay understand why some decisions were made or why they weren't made so we can always look back at 55 days ago or how many days ago we wanted to and see if the decision was correct or what it could have been how it could have been different it has high integrity because all data sources we use are known and are confirmed to to give us good data so and well being an open source project anyone can always jump in and verify if it is or if it isn't and finally audibility by having centralized logging so similar to this we can always confirm the decision was correct or not and the final point i guess this is also with a bit of a shameless plug it's highly hackathonable so right now as gsf we are starting a carbon hack 2020 so i don't have a link here but i can share it with you later if you want or put it in the slides um and this is a hackathon running around carbon aware SDK for producing and and using carbon aware um software so if you are interested dark surprise involved as well but also can give you quite a good head start to to using um the the sdk and uh becoming a green software engineer as well and i'll hand off the focus now to to talk about the carbon side pipeline project great thank you so um shaman has perfectly explained um the benefit some of the benefits of of doing this location and time shifting uh to reduce your software carbon intensity um and i think the interesting thing to take away is looking back 55 days is useful for that audit process but it's it's not useful to reduce the carbon in those 55 days right so what what um we're also looking at in the green software foundation is the idea of putting these tools straight into your ci so you're in continuous integration pipeline um right now what does that look like what does continuous integration look like well we have these cycles of kind of code test build code test build and then test release and deploy um which are you know fairly standard processes uh they're well understood we have lots of tools to deal with those but the result really is that once we get to that deploy section um we just uh if we're talking about a cloud deployment for example we kind of throw a load of resources up into the cloud and then they're running they we know where they are we know what time of day they're running but we haven't measured the sci we haven't thought about this the impact on the environment from that software or any of the the elements that are running in there so when we do a measurement like using the carbon aware stk and we look at the sci we pretty usually get a bad measurement so one of those high graphs right um so is there a better way um because by using tools like the carbon aware stk we can do some of those location shifts we can do some of those time shifts we can even scale things like uh things down if we're not actually using them to get a better sci score but by this point it's already too late if you're made the changes 55 days 100 days whatever it is later you've already wasted uh energy and carbon so our idea with this new project is to put a new step into the continuous integration uh cycle which is assess so at each point uh at both points of your build and test cycle and your release and deploy you're actually assessing your sci before that deployment so you're actually getting a score for what your future carbon uh your software carbon intensity will be in the future so you can actually make the decisions about where to deploy things when to deploy things uh what elements you want to deploy before you actually click deploy and before they actually start generating carbon um so what do we need well uh shaman's thankfully already covered uh some of this this is just a screenshot of the electricity map api and this is a graphical representation of the carbon intensity of different electricity grids around europe so you can see uh from when this was taken france is coming up quite well that's why in the sdk suggests france quite often because they do a lot of nuclear energy often the nordics are very good because they have a lot of hydropower and other countries burning more coal and gas may come up as as red and uh countries to potentially avoid uh if they're not using as many renewable energies at any point the other thing we need to know is how much um how much energy our compute resources are actually using at any one time and this is uh you know an area where we need a lot of collaboration across different organizations to actually understand what chipsets are using different amounts of power and how that's going uh what's the last thing that we need is you so everyone everyone here at the linux foundation can join up to the green software foundation get involved in these projects start contributing to both the carbon aware stk so this is um the projects page on the green software foundation website so his shaman in the carbon aware stk and the carbon ti pipeline tooling is here as well we definitely need uh you know more developers more help with people who are interested in sustainability as well um i put the link here so it's green software dot foundation you can go there to to learn more um we do have a couple of minutes for questions if anybody has any questions in the room or online please do let us know we'll do the our best to answer them in the next couple of minutes yes i'll come over the microphone what is the input data is it a standard format or can it be different in other across many countries yeah that's a really good question um the tools that we've been looking at in terms of electricity map and what time are standardized across the the the globe in the regions that they have access to the data for which is really really helpful um what isn't standardized is the data and is more difficult to get i would say is the the data coming from different providers so if we have a you know an sql server for example running in azure if we have an sql running server running in aws we can figure out if we know how much electricity they use we can use tools like electricity map or what time to figure out how much carbon is related to the energy they use but we need to know from the providers how much energy is used and that's where there isn't a standardization right now so there is a project in the green software foundation to try and do that data standardization um that we would definitely invite you if you if you have an interest to sign up and and help with that because that's something we're actually working towards is getting to a point where we have a nice standardized data and a really good understanding of of what different resources are using different amounts of energy uh at any time but yeah so that's that's something we're actively working towards but isn't necessarily available um from every different provider good question um any other last questions maybe have one time or one more yeah so my question is just around is there any intention to possibly get this automated in the cloud service providers for example so getting them to do this as opposed to me forecasting and then deciding yeah that's a great question i think it depends on the cloud provider i don't know if you want to add anything but i would say it depends on the cloud provider i would say for uh it's definitely of of interest you know add like 20 seconds yeah i mean basically like at this point obviously we want we want the cloud providers to get interested and to actually care about this so i guess our approach is to start doing it and once they have a pressure from other people in other organizations to start doing it maybe then one of the providers will eventually decide hey this is something we're interested in maybe let's join in there for it and start doing it and once one follows hopefully others will as well awesome so i think we're out of time but so thank you so much for for coming um and asking questions if you have any more questions for us we'll be around after the event um but yeah please do visit the link uh have a look at some of the other projects as well this is just two of many projects under the green software foundation but thank you very much