Skip to content

Commit

Permalink
Merge pull request #37 from openEDI/jm/new_feeder
Browse files Browse the repository at this point in the history
Update feeder along with gadal -> oedisi
  • Loading branch information
AadilLatif authored Jul 7, 2023
2 parents c82c413 + cb9d092 commit 2214b06
Show file tree
Hide file tree
Showing 28 changed files with 2,239 additions and 962 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ jobs:
- name: build docker container
shell: bash
run: |
echo "$SSH_KEY" > gadal_docker_key
docker build --secret id=gadal_github_key,src=gadal_docker_key --progress=plain -t gadal-example:0.0.0 .
docker build --progress=plain -t oedisi-example:0.0.0 .
env:
SSH_KEY: ${{secrets.SGIDAL_CLONE_KEY}}
DOCKER_BUILDKIT: '1'
- name: run docker continaer
shell: bash
run: |
mkdir outputs_build
docker volume create --name gadal_output --opt type=none --opt device=$(pwd)/outputs_build --opt o=bind
docker run --rm --mount source=gadal_output,target=/simulation/outputs gadal-example:0.0.0
docker volume create --name oedisi_output --opt type=none --opt device=$(pwd)/outputs_build --opt o=bind
docker run --rm --mount source=oedisi_output,target=/simulation/outputs oedisi-example:0.0.0
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -34,9 +33,7 @@ jobs:
shell: bash -l {0}
run: |
pip install matplotlib pyarrow numpy matplotlib pandas
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.SGIDAL_CLONE_KEY }}'
pip install git+ssh://[email protected]/openEDI/[email protected]
pip install oedisi==1.0.0
python post_analysis.py outputs_build
- name: Archive logs
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ jobs:
shell: bash -l {0}
run: |
pip install -r requirements.txt
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.SGIDAL_CLONE_KEY }}'
pip install git+ssh://[email protected]/openEDI/[email protected]
- name: Run example
shell: bash -l {0}
run: |
python test_full_systems.py
helics run --path=build/test_system_runner.json
oedisi build --system scenarios/docker_system.json
oedisi run
python post_analysis.py
- name: Archive logs
uses: actions/upload-artifact@v2
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/test-local-feeder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: TestLocalFeeder

on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.10']
#include:
#- os: ubuntu-latest
#python-version: 3.10

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
shell: bash -l {0}
run: |
pip install -r requirements.txt
pip install plotille pytest
- name: Run pytest on LocalFeeder
shell: bash -l {0}
run: |
cd LocalFeeder
pytest -s .
env:
PYTEST_ADDOPTS: "--color=yes"
PYTHONIOENCODING: UTF-8
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.981
hooks:
- id: mypy
additional_dependencies: [pydantic] # add if use pydantic
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ FROM python:3.10.6-slim-bullseye
RUN apt-get update && apt-get install -y git ssh

RUN mkdir -p /root/.ssh
ENV GIT_SSH_COMMAND="ssh -i /run/secrets/gadal_github_key"
RUN ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
RUN --mount=type=secret,id=gadal_github_key pip install git+ssh://[email protected]/openEDI/[email protected]

WORKDIR /simulation

COPY test_full_systems.py .
COPY scenarios/docker_system.json docker_system.json
COPY components.json .
COPY LocalFeeder LocalFeeder
COPY README.md .
COPY measuring_federate measuring_federate
COPY wls_federate wls_federate
COPY recorder recorder

RUN mkdir -p outputs build
RUN python test_full_systems.py --system docker_system.json

COPY requirements.txt .
RUN pip install -r requirements.txt
ENTRYPOINT ["helics", "run", "--path=build/test_system_runner.json"]

RUN oedisi build --system docker_system.json
ENTRYPOINT ["oedisi", "run"]
3 changes: 3 additions & 0 deletions LocalFeeder/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
base_*.csv
base_*.npz
opendss
profiles

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
Loading

0 comments on commit 2214b06

Please sign in to comment.