Skip to content

Commit 882b545

Browse files
Add snapshot of private api-dispatch-spec repository (#2)
This commit moves the existing code into a public repository
2 parents e9eb2bf + 1556a58 commit 882b545

File tree

16 files changed

+531
-1
lines changed

16 files changed

+531
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: frequenz-api-dispatch
2+
3+
on: [pull_request, push, release]
4+
5+
# Ensure old CI runs still being in progress are cancelled.
6+
concurrency:
7+
group: ${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
protolint:
12+
runs-on: ubuntu-20.04
13+
14+
steps:
15+
- name: Fetch sources
16+
uses: actions/checkout@v3
17+
with:
18+
submodules: true
19+
20+
- name: Get protolint
21+
run: |
22+
# checksum taken from: https://github.com/yoheimuta/protolint/releases/download/v0.44.0/checksums.txt
23+
echo "33627c1fd4392edc9363b414651f60692286c27e54424fc535ebb373a47a3004 protolint_0.44.0_Linux_x86_64.tar.gz" > checksum.txt
24+
25+
curl -LO https://github.com/yoheimuta/protolint/releases/download/v0.44.0/protolint_0.44.0_Linux_x86_64.tar.gz \
26+
&& sha256sum --check checksum.txt \
27+
&& tar xf protolint_0.44.0_Linux_x86_64.tar.gz \
28+
&& chmod +x protolint \
29+
&& sudo mv protolint /usr/local/bin/protolint
30+
31+
- name: Run protolint
32+
run: protolint lint proto
33+
34+
tests:
35+
needs: ["protolint"]
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
os:
40+
- ubuntu-20.04
41+
python-version:
42+
- "3.11"
43+
runs-on: ${{ matrix.os }}
44+
steps:
45+
- name: Fetch sources
46+
uses: actions/checkout@v3
47+
with:
48+
submodules: true
49+
50+
- name: Set up Python
51+
uses: actions/setup-python@v4
52+
with:
53+
python-version: ${{ matrix.python-version }}
54+
55+
- name: Install required Python packages
56+
run: |
57+
python -m pip install --upgrade pip
58+
python -m pip install .[dev-noxfile]
59+
- name: Run nox
60+
run: nox

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
build/*
2+
dist/*
3+
py/frequenz_api_dispatch.egg-info/*
4+
py/frequenz/api/dispatch/**/*_pb2.py
5+
py/frequenz/api/dispatch/**/*_pb2.pyi
6+
py/frequenz/api/dispatch/**/*_pb2_grpc.py
7+
py/frequenz/api/dispatch/**/*_pb2_grpc.pyi
8+
*.egg-info
9+
.nox/*
10+
__pycache__
11+
.coverage

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "submodules/api-common-protos"]
2+
path = submodules/api-common-protos
3+
url = https://github.com/googleapis/api-common-protos.git
4+
[submodule "submodules/frequenz-api-common"]
5+
path = submodules/frequenz-api-common
6+
url = https://github.com/frequenz-floss/frequenz-api-common.git

MANIFEST.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
exclude .gitignore
2+
exclude .gitmodules
3+
exclude CODEOWNERS
4+
exclude noxfile.py
5+
recursive-exclude .github *
6+
recursive-exclude pytests *
7+
recursive-include submodules/api-common-protos/google *.proto
8+
recursive-include submodules/frequenz-api-common/proto *.proto

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
# frequenz-api-dispatch
1+
Dispatch API
2+
============
3+
4+
Our dispatch API allows individual edge locations to access the latest dispatch
5+
decisions made cloud-side.
6+
7+
Dispatched resources might include, for example:
8+
9+
* hard shutdown of a location or an individual microgrid component
10+
* charging or discharging a battery
11+
* activation or deactivation of balancing power
12+
* activation or deactivation of a power plant
13+
14+
Microgrid controllers are expected to regularly query this API to keep up to
15+
date with what resources the cloud wishes them to deploy.

RELEASE_NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release notes
2+
3+
- Repository now uses `frequenz-repo-config` as a base structure.
4+
- Added `frequenz-api-common` as a dependency, removed `ComponentCategory` enum
5+
- Added specific configuration parameters for FCR prequalification dispatch type

ci.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: frequenz-api-dispatch
2+
3+
on: [pull_request, push, release]
4+
5+
# Ensure old CI runs still being in progress are cancelled.
6+
concurrency:
7+
group: ${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
protolint:
12+
runs-on: ubuntu-20.04
13+
14+
steps:
15+
- name: Fetch sources
16+
uses: actions/checkout@v3
17+
with:
18+
submodules: true
19+
20+
- name: Get protolint
21+
run: |
22+
# checksum taken from: https://github.com/yoheimuta/protolint/releases/download/v0.44.0/checksums.txt
23+
echo "33627c1fd4392edc9363b414651f60692286c27e54424fc535ebb373a47a3004 protolint_0.44.0_Linux_x86_64.tar.gz" > checksum.txt
24+
25+
curl -LO https://github.com/yoheimuta/protolint/releases/download/v0.44.0/protolint_0.44.0_Linux_x86_64.tar.gz \
26+
&& sha256sum --check checksum.txt \
27+
&& tar xf protolint_0.44.0_Linux_x86_64.tar.gz \
28+
&& chmod +x protolint \
29+
&& sudo mv protolint /usr/local/bin/protolint
30+
31+
- name: Run protolint
32+
run: protolint lint proto
33+
34+
tests:
35+
needs: ["protolint"]
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
os:
40+
- ubuntu-20.04
41+
python-version:
42+
- "3.11"
43+
runs-on: ${{ matrix.os }}
44+
steps:
45+
- name: Fetch sources
46+
uses: actions/checkout@v3
47+
with:
48+
submodules: true
49+
50+
- name: Set up Python
51+
uses: actions/setup-python@v4
52+
with:
53+
python-version: ${{ matrix.python-version }}
54+
55+
- name: Install required Python packages
56+
run: |
57+
python -m pip install --upgrade pip
58+
python -m pip install .[dev-noxfile]
59+
- name: Run nox
60+
run: nox

noxfile.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# License: MIT
2+
# Copyright © 2023 Frequenz Energy-as-a-Service GmbH
3+
4+
"""Configuration file for nox."""
5+
6+
from frequenz.repo.config import nox
7+
8+
nox.configure(nox.default.api_config)

0 commit comments

Comments
 (0)