Skip to content

Commit

Permalink
Merge branch 'dev' into pr/generate-java-webapi-client
Browse files Browse the repository at this point in the history
Signed-off-by: Yasumasa Suenaga <suenaga@oss.nttdata.com>
  • Loading branch information
YaSuenag committed Apr 4, 2024
2 parents 8287182 + fd6db72 commit 42ab919
Show file tree
Hide file tree
Showing 101 changed files with 1,380 additions and 617 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0
FROM mcr.microsoft.com/dotnet/sdk:8.0

RUN apt-get update

Expand Down
34 changes: 19 additions & 15 deletions .github/workflows/1-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
# web app
DOCKERFILE_PATH: "CarbonAware.WebApi/src/Dockerfile"
HEALTH_ENDPOINT: "0.0.0.0:8080/health"
DLL_FILE_PATH: "./bin/Release/net6.0/CarbonAware.WebApi.dll"
DLL_FILE_PATH: "./bin/Release/net8.0/CarbonAware.WebApi.dll"
DOTNET_SRC_DIR: "./src"
# console app packages
DOTNET_SOLUTION: "src/GSF.CarbonAware/src/GSF.CarbonAware.csproj"
Expand Down Expand Up @@ -40,9 +40,9 @@ jobs:

- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down Expand Up @@ -86,14 +86,14 @@ jobs:
needs: sln-build-and-test
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/sdk:6.0
image: mcr.microsoft.com/dotnet/sdk:8.0
steps:
- uses: actions/checkout@v3

- name: Setup .NET Core SDK 6
uses: actions/setup-dotnet@v2
- name: Setup .NET Core SDK 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
include-prerelease: false

- name: Install dependencies
Expand Down Expand Up @@ -123,6 +123,8 @@ jobs:

- name: Generate Open API
run: dotnet tool run swagger tofile --output ./wwwroot/api/v1/swagger.yaml --yaml ${{ env.DLL_FILE_PATH }} v1
env:
DOTNET_ROLL_FORWARD: LatestMajor
working-directory: ./src/CarbonAware.WebApi/src

- name: Upload swagger artifact
Expand All @@ -144,7 +146,7 @@ jobs:

- name: Docker Run Container
run: |
docker run -d --name runnable-container -p 8080:80 ca-api
docker run -d --name runnable-container -p 8080:8080 ca-api
docker container ls
- name: Docker WGET Health Endpoint
Expand All @@ -164,10 +166,10 @@ jobs:
uses: actions/checkout@v3
with:
ref: dev
- name: Setup .NET Core SDK 6
uses: actions/setup-dotnet@v2
- name: Setup .NET Core SDK 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
include-prerelease: false
- name: Install dependencies
run: dotnet restore
Expand All @@ -179,6 +181,8 @@ jobs:
working-directory: ${{ env.DOTNET_SRC_DIR }}
- name: Generate Open API
run: dotnet tool run swagger tofile --output ./wwwroot/api/v1/swagger.yaml --yaml ${{ env.DLL_FILE_PATH }} v1
env:
DOTNET_ROLL_FORWARD: LatestMajor
- name: Upload dev artifact
uses: actions/upload-artifact@v1
with:
Expand All @@ -199,10 +203,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET Core SDK 6
uses: actions/setup-dotnet@v2
- name: Setup .NET Core SDK 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
include-prerelease: false

- name: Create packages
Expand Down Expand Up @@ -244,4 +248,4 @@ jobs:
command: config
globs: |
./custom.markdownlint.jsonc
{"*[^.github]/**,*"}.md
{"*[^.github]/**,*"}.md
2 changes: 2 additions & 0 deletions .github/workflows/6-jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
run: |
# Moving the samples folder at build& deploy time of the docs so that it appears in the end result
cp -r ./samples/ ./casdk-docs/docs/
cp -r ./README.md ./casdk-docs/docs/overview/overview.md
cp -r ./CONTRIBUTING.md ./casdk-docs/docs/overview/contributing.md
working-directory: .

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_carbon-aware-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
include-prerelease: true

- name: Build with dotnet
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "buildCLI",
"program": "${workspaceFolder}/src/CarbonAware.CLI/src/bin/Debug/net6.0/caw.dll",
"program": "${workspaceFolder}/src/CarbonAware.CLI/src/bin/Debug/net8.0/caw.dll",
"args": [
"emissions",
"--location", "${input:caw_location}"
Expand All @@ -27,7 +27,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "buildWebApi",
"program": "${workspaceFolder}/src/CarbonAware.WebApi/src/bin/Debug/net6.0/CarbonAware.WebApi.dll",
"program": "${workspaceFolder}/src/CarbonAware.WebApi/src/bin/Debug/net8.0/CarbonAware.WebApi.dll",
"args": [],
"cwd": "${workspaceFolder}/src/CarbonAware.WebApi/src/",
"stopAtEntry": false,
Expand Down
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@

All notable changes to the Carbon Aware SDK will be documented in this file.

## [1.3.0] - 2024-02

### Added

- docs site at https://carbon-aware-sdk.greensoftware.foundation/
- [PR #464 Create SECURITY.md ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/464)
- [PR #461 CarbonHack24 Update to README.md ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/461)
- [PR #457 Features/codespaces quickstart ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/457)
- [PR #459 Readme updates for clarity ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/459)
- [PR #449 Support location source setting in Helm chart ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/449)
- [PR #431 Update documentation of Usefulness (adopters.md) ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/431)%
- [#416 Add disclaimer banner to any public-facing documentation (docusaurus webpage) ](https://github.com/Green-Software-Foundation/carbon-aware-s dk/issues/416)
- [#415 Update documentation of secureness (security.md) ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/issues/415)
- [#414 Update documentation of Usefulness (adopters.md) ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/issues/414)
- [#413 Update documentation for Test Coverage ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/issues/413)
- [#412 Update documentation for End User Guide (enablement.md) ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/issues/412)
- [#410 Update documentation for How to contribute (contributing.md ) ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/issues/410)

### Fixed

- [#344 [Bug]: Fix and update doc deployment workflow ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/issues/344)

### Changed

- [#411 Update documentation for Project overview (ReadMe) ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/issues/411)
- [PR #454 Update quickstart.md ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/454)
- [PR #453 Update overview.md ](https://github.com/Green-Software-Foundation/carbon-aware-sdk/pull/453)

#### API

-

#### API Deployment

-

#### SDK

-


#### Other

-


For more details, checkout [https://github.com/Green-Software-Foundation/carbon-aware-sdk/issues/474](https://github.com/Green-Software-Foundation/carbon-aware-sdk/issues/474)

## [1.2.0] - 2024-01

### Added
Expand Down
16 changes: 9 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ and the approved contribution process that members should follow.
- [Collaborating with the OSWG](#collaborating-with-the-opensource-working-group)

## Current Opportunities
We have opportunities for both code and non code contributors.
We have opportunities for both code and non code contributors. We're currently looking all contributions, with some areas of extra opportunity outlined in the table below.

We're currently looking for contributions in the following areas:
1. Sample Creation
2. Documentation Updates, including getting docusaurus up and running
3. Video Content Creation (how to enable, demos etc)
4. Slide Deck Creation, available for presenter use, including real time video demo

| Contribution Areas | Description |
|----------|----------|
|**Sample Creation** | These help adopters of the SDK learn how they can quick get started and build their own carbon aware solutions.|
|**Documentation Updates** | The documentation always can be improved to make the Carbon Aware SDK more accessible to everyone. Guides, SDK and API document, and more! |
|**Video Content Creation (how to enable, demos etc)** | Quick videos help adopters undersatnd just how easy it is to get started in an easy to consume form.
|**Slide Deck Creation <br /> Available for presenter use, including real time video demo**| We get a lot of traction at conferences, and if we have a standard deck for anyone to present, it will enable those who might not be able to create a deck, but could easily present it, to also participate.

## How To Get Started
Introduce yourself on on our [discussions page](https://github.com/orgs/Green-Software-Foundation/discussions/65) and let us know where you think you can help.
Expand Down Expand Up @@ -83,7 +85,7 @@ do **not** open an issue to request features.
3. PR to be submitted against the **DEV feature branch**
4. PR discussed with the WG. If agreed, the WG Chair will merge into **DEV
Feature branch**
![GSF Single-Trunk Based Branch Flow](/docs/images/single-trunk-branch.svg)
![GSF Single-Trunk Based Branch Flow](./images/readme/single-trunk-branch.svg)
5. See
[The Way we Work](https://github.com/Green-Software-Foundation/standards_wg/blob/main/the_way_we_work.md)
for futher details.
40 changes: 12 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
<div id="header" align="center">
<img style=”margin: 0px” src=./images/hack-banner.png alt=”banner” height=”500" />
</div>

----------------------------

**Welcome to [CarbonHack 24](https://grnsft.org/hack/github) from the Green Software Foundation.**

> From Monday, 18th March - Monday, 8th April 2024, participants will compete to showcase their best application of IF in measuring the environmental impacts of software.
>
> Carbon Hack is a dynamic competition that combines healthy rivalry with collaborative innovation. Hackers will push the limits of the framework, uncover potential weaknesses, and create innovations to enhance the tool.
>
> CarbonHack is open to all, including software practitioners and those with a passion for Green Software.
>
> Find out more about CarbonHack 2024 on the [CarbonHack website](https://grnsft.org/hack/github). Check out the [FAQ on GitHub](https://github.com/Green-Software-Foundation/hack/blob/main/FAQ.md).
>
> Registration opens 15th January!
----------------------------

---
sidebar_position: 2
---

# Carbon Aware SDK
Carbon aware software does more when it can leverage greener energy sources, and less when the energy CO2 emissions are higher.

The Carbon Aware SDK is a toolset to help you measure the carbon emissions of your software, in turn helping you **measure and reduce your software's carbon emissions**, and choose when and where you run your software to make it greener.

![Carbon Aware Software](./images/carbon-aware-software.png)
![Carbon Aware Software](./images/readme/carbon-aware-software.png)


By knowing the carbon emissions of the energy that powers your applications, you and your organisation can leverage greener energy sources to reduce your CO2 emissions by:
Expand All @@ -33,18 +17,18 @@ By knowing the carbon emissions of the energy that powers your applications, you
* Running software updates at greener energy time windows
* Using data to run hypothetical models to understand how you could start driving impact and reduce emissions, drive business cases for change, and create a greener future.

Withing the [Green Software Foundations Theory of Change](https://greensoftware.foundation/articles/theory-of-change), we look at 3 pillars, that being **Knowledge**, **Tech Culture**, and **Tooling** as focus areas to drive this change. The Carbon Aware SDK at it's core sits firmly in the **Tooling** pillar, and also supports the other pillars, providing **Knowledge** through emissions data to inform change, and being core enabler for the **Tech Culture** for building carbon aware software.
Within the [Green Software Foundations Theory of Change](https://greensoftware.foundation/articles/theory-of-change), we look at 3 pillars, that being **Knowledge**, **Tech Culture**, and **Tooling** as focus areas to drive this change. The Carbon Aware SDK at it's core sits firmly in the **Tooling** pillar, and also supports the other pillars, providing **Knowledge** through emissions data to inform change, and being core enabler for the **Tech Culture** for building carbon aware software.

Companies including UBS and Vestas have already deployed the Carbon Aware SDK to build greener software, and you can too!

# Getting Started Overview

Head on over to the [Getting Started Overview Guide](./docs/overview.md) to get up and running.
Head on over to the [Getting Started Overview Guide](./casdk-docs/docs/overview/overview.md) to get up and running.

Get started on creating sustainable software innovation for a greener future
today!

![Green Software](./images/what-is-green-software.avif)
![Green Software](./images/readme/what-is-green-software.avif)

# How Does This Work?
You can reduce the carbon footprint of your application by just running things
Expand All @@ -56,7 +40,7 @@ When software does more when the electricity is clean and do less when the
electricity is dirty, or runs in a location where the energy is cleaner, we call
this **carbon aware software**.

![Carbon Aware Software](./images/types-of-green-software.png)
![Carbon Aware Software](./images/readme/types-of-green-software.png)

The Carbon Aware SDK helps you build the carbon aware software solutions with
the intelligence to use the greenest energy sources. Run them at the greenest
Expand All @@ -75,7 +59,7 @@ At its core the Carbon Aware SDK is a WebApi and Command Line Interface (CLI) to
assist in building carbon aware software. The functionality across the CLI and
WebApi is identical by design.

You can use these to attain carbon emissions data for the energy that powers your applications, and in turn programatically make greener decisions in your software.
You can use these to attain carbon emissions data for the energy that powers your applications, and in turn programmatically make greener decisions in your software.

### The WebApi

Expand All @@ -84,7 +68,7 @@ management and increase control and auditability, especially in regulated
environments. It can be deployed as a container for easy management, and can be
deployed alongside an application within a cluster or separately.

![WebApi Screenshot](./images/screenshot_web_api.png)
![WebApi Screenshot](./images/readme/screenshot_web_api.png)

### The CLI

Expand All @@ -93,7 +77,7 @@ where a command-line can be used. This tends to be common with legacy DevOps
pipelines to drive deployment for integration testing where you can test your
deployment in the greenest location.

![WebApi Screenshot](./images/screenshot_cli.png)
![WebApi Screenshot](./images/readme/screenshot_cli.png)

## Who Is Using the Carbon Aware SDK?

Expand Down Expand Up @@ -178,7 +162,7 @@ prefer to use for on premises workloads, which you can combine in aggregate with

## Is it possible to retrieve energy mix information from the SDK?

Energy mix (the percentages that are from different energy soruces i.e. coal,
Energy mix (the percentages that are from different energy sources i.e. coal,
nuclear, wind, gas, solar, tidal, hydro etc) is not provided in the API to date.
This may be a feature we will consider in the future. The SDK provides emissions
percentage information only at the moment.
Expand Down
2 changes: 2 additions & 0 deletions casdk-docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

docs/overview/README.md
2 changes: 1 addition & 1 deletion casdk-docs/docs/overview/adopters.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 6
sidebar_position: 7
---

# Carbon Aware SDK adopters
Expand Down
Loading

0 comments on commit 42ab919

Please sign in to comment.