Skip to content

Commit

Permalink
Finalize repository configuration updates v0.7.5
Browse files Browse the repository at this point in the history
This commit consolidates multiple changes made during the repository configuration update. The following adjustments have been made:

Remove TODO in .github/ISSUE_TEMPLATE/config.yml.
Remove .bash file.
Remove TODOs from configuration files.
Remove TODOs and update versions in pyproject.toml.
Revert changes to older versions in various files.
Delete old files and directories in the docs folder for v0.7.0 update.
Remove arm64-related configurations.
Edit CODEOWNERS.
Remove remaining TODO in mkdocs.yml.

These changes ensure a clean repository configuration state, updates to documentation, and version alignment with v0.7.5.

Signed-off-by: noah-kreutzer-frequenz <[email protected]>
  • Loading branch information
noah-kreutzer-frequenz committed Dec 8, 2023
1 parent e388e25 commit 4cb343a
Show file tree
Hide file tree
Showing 21 changed files with 214 additions and 323 deletions.
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ body:
- Documentation (part:docs)
- Unit, integration and performance tests (part:tests)
- Build script, CI, dependencies, etc. (part:tooling)
# TODO(cookiecutter): Add other parts
# Please have in mind that that the part:xxx labels need to
# be created in the GitHub repository.
validations:
required: true
- type: textarea
Expand Down
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ blank_issues_enabled: true
contact_links:
- name: Ask a question ❓
url: https://github.com/frequenz-floss/frequenz-api-weather/discussions/new?category=support
# TODO(cookiecutter): Make sure the GitHub repository has a discussion category "Support"
# Rename the "Q&A" category to "Support" and change the emoji to 🆘 (SOS)
about: Use this if you are not sure how to do something, have installation problems, etc.

This file was deleted.

9 changes: 0 additions & 9 deletions .github/containers/nox-cross-arch/entrypoint.bash

This file was deleted.

5 changes: 1 addition & 4 deletions .github/keylabeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@ labelMappings:
"part:docs": "part:docs"
"part:tests": "part:tests"
"part:tooling": "part:tooling"
"part:❓": "part:❓"
# TODO(cookiecutter): Add other parts
# Please have in mind that that the part:xxx labels need to
# be created in the GitHub repository.
"part:❓": "part:❓"
114 changes: 1 addition & 113 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,118 +116,6 @@ jobs:
- name: Return true
run: "true"

nox-cross-arch:
name: Cross-arch tests with nox
if: github.event_name != 'pull_request'
strategy:
fail-fast: false
# Before adding new items to this matrix, make sure that a dockerfile
# exists for the combination of items in the matrix.
# Refer to .github/containers/nox-cross-arch/README.md to learn how to
# add and name new dockerfiles.
matrix:
arch:
- arm64
os:
- ubuntu-20.04
python:
- "3.11"
nox-session:
- "pytest_min"
- "pytest_max"
runs-on: ${{ matrix.os }}

steps:
- name: Fetch sources
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/${{ matrix.arch }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# This is a workaround to prevent the cache from growing indefinitely.
# https://docs.docker.com/build/ci/github-actions/cache/#local-cache
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Cache container layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-nox-${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.python }}

- name: Build image
uses: docker/build-push-action@v5
with:
context: .github/containers/nox-cross-arch
file: .github/containers/nox-cross-arch/${{ matrix.arch }}-${{ matrix.os }}-python-${{ matrix.python }}.Dockerfile
platforms: linux/${{ matrix.arch }}
tags: localhost/nox-cross-arch:latest
push: false
load: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

# Refer to the workaround mentioned above
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
# Cache pip downloads
- name: Cache pip downloads
uses: actions/cache@v3
with:
path: /tmp/pip-cache
key: nox-${{ matrix.nox-session }}-${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('**/pyproject.toml') }}

# This ensures that the docker container has access to the pip cache.
# Changing the user in the docker-run step causes it to fail due to
# incorrect permissions. Setting the ownership of the pip cache to root
# before running is a workaround to this issue.
- name: Set pip cache owners to root for docker
run: if [[ -e /tmp/pip-cache ]]; then sudo chown -R root:root /tmp/pip-cache; fi

- name: Run nox
run: |
docker run \
--rm \
-v $(pwd):/${{ github.workspace }} \
-v /tmp/pip-cache:/root/.cache/pip \
-w ${{ github.workspace }} \
--net=host \
--platform linux/${{ matrix.arch }} \
localhost/nox-cross-arch:latest \
bash -c "pip install -e .[dev-noxfile]; nox --install-only -e ${{ matrix.nox-session }}; pip freeze; nox -e ${{ matrix.nox-session }}"
timeout-minutes: 30

# This ensures that the runner has access to the pip cache.
- name: Reset pip cache ownership
if: always()
run: sudo chown -R $USER:$USER /tmp/pip-cache

# This job runs if all the `nox-cross-arch` matrix jobs ran and succeeded.
# As the `nox-all` job, its main purpose is to provide a single point of
# reference in branch protection rules, similar to how `nox-all` operates.
# However, there's a crucial difference: the `nox-cross-arch` job is omitted
# in PRs. Without the `nox-cross-arch-all` job, the inner matrix wouldn't be
# expanded in such scenarios. This would lead to the CI indefinitely waiting
# for these jobs to complete due to the branch protection rules, essentially
# causing it to hang. This behavior is tied to a recognized GitHub matrices
# issue when certain jobs are skipped. For a deeper understanding, refer to:
# https://github.com/orgs/community/discussions/9141
nox-cross-arch-all:
# The job name should match the name of the `nox-cross-arch` job.
name: Cross-arch tests with nox
needs: ["nox-cross-arch"]
runs-on: ubuntu-20.04
steps:
- name: Return true
run: "true"

build:
name: Build distribution packages
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -325,7 +213,7 @@ jobs:

publish-docs:
name: Publish documentation website to GitHub pages
needs: ["nox-all", "nox-cross-arch-all", "test-installation", "protolint"]
needs: ["nox-all", "test-installation", "protolint"]
if: github.event_name == 'push'
runs-on: ubuntu-20.04
permissions:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release-notes-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
if: github.event_name == 'pull_request'
uses: brettcannon/check-for-changed-files@4170644959a21843b31f1181f2a1761d65ef4791 # v1.2.0
with:
# TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it
# token: ${{ secrets.github_token }}
file-pattern: "RELEASE_NOTES.md"
prereq-pattern: "{proto,py}/**"
skip-label: "cmd:skip-release-notes"
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ __pycache__/
*.py[cod]
*$py.class

# Auto-generated python files from the protocol buffer compiler
py/**/*_pb2.py
py/**/*_pb2.pyi
py/**/*_pb2_grpc.py
py/**/*_pb2_grpc.pyi

# C extensions
*.so

Expand Down
3 changes: 1 addition & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
# Fallback owner.
# These are the default owners for everything in the repo, unless a later match
# takes precedence.
# TODO(cookiecutter): Add more specific code-owners, check if the default is correct
* @frequenz-floss/api-team
* @frequenz-floss/api-weather-team
29 changes: 1 addition & 28 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,31 +197,4 @@ These are the steps to create a new release:
Commit the new release notes and create a PR (this step should be automated
eventually too).

7. Celebrate!

## Cross-Arch Testing

This project has built-in support for testing across multiple architectures.
Currently, our CI conducts tests on `arm64` machines using QEMU emulation. We
also have the flexibility to expand this support to include additional
architectures in the future.

This project contains Dockerfiles that can be used in the CI to test the
python package in non-native machine architectures, e.g., `arm64`. The
Dockerfiles exist in the directory `.github/containers/nox-cross-arch`, and
follow a naming scheme so that they can be easily used in build matrices in the
CI, in `nox-cross-arch` job. The naming scheme is:

```
<arch>-<os>-python-<python-version>.Dockerfile
```

E.g.,

```
arm64-ubuntu-20.04-python-3.11.Dockerfile
```

If a Dockerfile for your desired target architecture, OS, and python version
does not exist here, please add one before proceeding to add your options to
the test matrix.
7. Celebrate!
54 changes: 41 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,49 @@
[![PyPI Package](https://img.shields.io/pypi/v/frequenz-api-weather)](https://pypi.org/project/frequenz-api-weather/)
[![Docs](https://img.shields.io/badge/docs-latest-informational)](https://frequenz-floss.github.io/frequenz-api-weather/)

## Introduction

Frequenz gRPC API for retrieving weather forecasts.

TODO(cookiecutter): Improve the README file

## Supported Platforms

The following platforms are officially supported (tested):

- **Python:** 3.11
- **Operating System:** Ubuntu Linux 20.04
- **Architectures:** amd64, arm64
## Overview
This Weather Forecast API provides access to weather forecast data. The forecast
data includes features such as wind components and solar radiation levels at
specified geographic coordinates. The forecasting process involves predicting
atmospheric conditions based on various factors and models. The data provided by
this API represents the forecasted state of the atmosphere at different heights
above the ground and for various forecast creation times.

## Objective
The primary objective of this API is to provide real-time and historical weather
forecast data to enable more efficient
energy management, trading, and planning within microgrids and larger gridpool
portfolios.

## Key Features
- Real-time Weather Forecasting: Access current atmospheric conditions based on
recent data.
- Historical Data Access: Retrieve past weather forecasts for analysis and trend
prediction.
- Feature Customization: Choose from a variety of weather features like wind speed,
solar radiation, and more.
- Geographical Flexibility: Get forecasts for any location specified by latitude and
longitude.

## Example Use Cases
- Adjusting the trading of photovoltaic (PV) surplus production based on future
solar radiation forecasts.
- Feeding excess energy into batteries when low consumption or high production is
forecasted.
- Dynamic pricing strategies for energy trading based on anticipated weather
conditions.
- Resource allocation in microgrids for anticipated energy demands, guided by
weather forecasts.
- Risk assessment and contingency planning for severe weather events.

## Target Audience
This API is designed for application developers in the energy sector who focus on
the tasks of optimizing microgrid electricity flows or trading of energy. Its design
aims to be as developer-friendly as possible, requiring no prior knowledge in
electrical engineering and systems and/or weather forecast services.

## Contributing

If you want to know how to build this project and contribute to it, please
check out the [Contributing Guide](CONTRIBUTING.md).

5 changes: 1 addition & 4 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

## Summary

<!-- Here goes a general summary of what this release is about -->

## Upgrading

<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->

## New Features

<!-- Here goes the main new features and examples or instructions on how to use them -->
- Introduce Pagination to the historical RPC of the service.

## Bug Fixes

<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
44 changes: 0 additions & 44 deletions docs/css/mkdocstrings.css

This file was deleted.

Loading

0 comments on commit 4cb343a

Please sign in to comment.