Skip to content

Commit

Permalink
Merge branch 'ibpsa:master' into singlezone_commercial_hydronic_Adren…
Browse files Browse the repository at this point in the history
…alin
  • Loading branch information
HWalnum authored Feb 11, 2025
2 parents 7b02c05 + a1d0eaf commit 239aae7
Show file tree
Hide file tree
Showing 18 changed files with 140 additions and 24 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/build_test_containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build, test and publish containers

on:
pull_request:
branches:
- '*'
push:
branches:
- '*'
tags:
- '*'

jobs:

simulation-tests:
name: Build containers and run boptest simulation tests
runs-on: ubuntu-22.04
timeout-minutes: 240
env:
COMPOSE_PROJECT_NAME: boptest_service
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Build and run stack
run: |
cd service
docker compose build
docker compose up -d web worker
- name: dump docker logs
uses: jwalton/gh-docker-logs@v1

- name: Upload test cases to minio
run: |
# The provision script will wait for the web service to be available,
# so there is no need for an external wait-for-it script
cd service
docker compose run --no-deps provision
curl http://localhost/testcases
- name: Run example
run: |
python --version
pip install requests matplotlib numpy pandas
PYTHONPATH=$GITHUB_WORKSPACE
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
# Storing PYTHONPATH above doesn't work for python so setting it below at run
PYTHONPATH=$PWD python examples/python/testcase1.py
- name: Run tests
run: |
cd service
docker compose run --no-deps test
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v1

- name: Log in to the GitHub container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GH_REGISTRY }}

- name: Publish docker images to GitHub Registry
if: |
github.ref == 'refs/heads/develop' ||
contains(github.ref, 'refs/tags')
shell: bash
run: service/ci/publish_to_github.sh

#------------------ Push to docker hub (disabled) -------------------------------------
#
# - name: Log in to Docker Hub
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
# with:
# username: ${{ secrets.DOCKER_USER }}
# password: ${{ secrets.DOCKER_PASS }}
#
# - name: Publish docker images to Docker Hub
# if: |
# github.ref == 'refs/heads/develop' ||
# github.ref == 'refs/heads/experimental' ||
# contains(github.ref, 'refs/tags')
# shell: bash
# run: service/ci/publish_to_docker.sh
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ BOPTEST can be deployed and used on your own computing resource by following the

2) Install [Docker](https://docs.docker.com/get-docker/).

3) Use Docker to build and run BOPTEST. In the root of this repository, run the following command. Note that if you want to be able to deploy multiple test cases at the same time, append the argument ``--scale worker=n`` where ``n`` equals the number of test cases you want to be able to have running at the same time.
3) Use Docker to build and run BOPTEST. In the root of this repository, run the following command:

``docker compose up web worker provision``

- If you want to be able to deploy multiple test cases at the same time, append the argument ``--scale worker=n`` to the command above where ``n`` equals the number of test cases you want to be able to have running at the same time.
- If no request is made to a running test case for some time, the test case will be automatically stopped and the associated worker will be freed up. By default this timeout is 15 minutes. If you would like to change this timeout period, you can edit the environment variable ``BOPTEST_TIMEOUT`` in the ``.env`` file before starting BOPTEST with the command above.

4) In a separate process, use the API below to first select a test case to run, and then interact with it using your test controller. Send API requests to ``http://127.0.0.1:80/<request>``

5) Shutdown BOPTEST by the command ``docker compose down`` executed in the root directory of this repository. NOTE: This is the best and most complete way to shutdown BOPTEST to prevent issues upon redeployment.
Expand Down Expand Up @@ -139,13 +142,17 @@ as a hook on all commits by calling `pre-commit install` in the root directory o

## Additional Software

### OpenAI-Gym Environment
An OpenAI-Gym environment for BOPTEST is implemented in [ibpsa/project1-boptest-gym](https://github.com/ibpsa/project1-boptest-gym).
### OpenAI-Gym Environment Interface
An OpenAI-Gym environment interface for BOPTEST is implemented in [ibpsa/project1-boptest-gym](https://github.com/ibpsa/project1-boptest-gym).
See the documentation there for getting started.

### BACnet Interface
A BACnet interface for BOPTEST is implemented in the ``/bacnet`` directory of this repository. See the ``/bacnet/README.md`` there for getting started.

### Julia Interface
A Julia interface for BOPTEST is implemented as a Julia package in [BOPTestAPI.jl](https://terion-io.github.io/BOPTestAPI.jl/stable/).
See the documentation there for getting started.

### Results Dashboard
A proposed BOPTEST home page and dashboard for creating accounts and sharing results is published here https://xd.adobe.com/view/0e0c63d4-3916-40a9-5e5c-cc03f853f40a-783d/.

Expand Down
13 changes: 12 additions & 1 deletion releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# Release Notes

## BOPTEST v0.7.0-dev
## BOPTEST v0.7.1-dev

Released on xx/xx/xxxx.


## BOPTEST v0.7.1

Released on 01/21/2025.

**The following changes are backwards-compatible and do not significantly change benchmark results:**

- Add note to ``README.md`` about using environment variable ``BOPTEST_TIMEOUT`` to edit the timeout period for idle workers. This is for [#715](https://github.com/ibpsa/project1-boptest/issues/715).
- Add note to ``README.md`` about a Julia interface implemented by [BOPTestAPI.jl](https://terion-io.github.io/BOPTestAPI.jl/stable/). This is for [#707](https://github.com/ibpsa/project1-boptest/issues/707).
- Add github actions to build docker images for web and worker and post them as packages in the ibpsa repository. This is for [#712](https://github.com/ibpsa/project1-boptest/issues/712).


## BOPTEST v0.7.0

Released on 11/25/2024.
Expand Down
5 changes: 3 additions & 2 deletions service/ci/publish_to_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
export $(egrep -v '^#' .env | xargs)
export WEB_REGISTRY_URI=boptest_service-web
export WORKER_REGISTRY_URI=boptest_service-worker
export DOCKER_HUB_WEB_REGISTRY_URI=nrel/boptest-web
export DOCKER_HUB_WORKER_REGISTRY_URI=nrel/boptest-worker
export DOCKER_ORG=nrel
export DOCKER_HUB_WEB_REGISTRY_URI=$DOCKER_ORG/boptest-web
export DOCKER_HUB_WORKER_REGISTRY_URI=$DOCKER_ORG/boptest-worker

if [[ "${GITHUB_REF}" == "refs/heads/develop" ]]; then
export VERSION_TAG="develop"
Expand Down
14 changes: 9 additions & 5 deletions service/ci/publish_to_github.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# load .env defines in root of repo
export $(egrep -v '^#' .env | xargs)
export GITHUB_WEB_REGISTRY_URI=ghcr.io/NREL/boptest-web
export GITHUB_WORKER_REGISTRY_URI=ghcr.io/NREL/boptest-worker
export WEB_REGISTRY_URI=boptest_service-web
export WORKER_REGISTRY_URI=boptest_service-worker
export GITHUB_ORG=ibpsa
export GITHUB_WEB_REGISTRY_URI=ghcr.io/$GITHUB_ORG/boptest-web
export GITHUB_WORKER_REGISTRY_URI=ghcr.io/$GITHUB_ORG/boptest-worker


if [[ "${GITHUB_REF}" == "refs/heads/develop" ]]; then
export VERSION_TAG="develop"
echo "The docker tag is set to: ${VERSION_TAG}"
elif [[ "${GITHUB_REF}" =~ ^refs/tags/v[0-9].* ]]; then
export VERSION_TAG="${GITHUB_REF/refs\/tags\//}"
echo "The docker tag is set to: ${VERSION_TAG}"
# use conditional below if you want to build a custom branch
# elif [[] "${GITHUB_REF}" == "refs/heads/boptest-service-custom" ]]; then
# export VERSION_TAG="experimental"
elif [[ "${GITHUB_REF}" == "refs/heads/experimental" ]]; then
export VERSION_TAG="experimental"
echo "The docker tag is set to: ${VERSION_TAG}"
fi

if [[ "${VERSION_TAG}" == "develop" ]] || [[ "${VERSION_TAG}" =~ ^v[0-9].* ]] || [[ "${VERSION_TAG}" == "experimental" ]] ; then
Expand Down
2 changes: 1 addition & 1 deletion testing/references/bestest_air/submit.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.0-dev\n", "buildingType": {"uid": "bestest_air"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.02730719968271573, "emis_tot": 0.785590772991245, "ener_tot": 3.7227262062358055, "idis_tot": 1221.6529527806554, "pdih_tot": null, "pele_tot": 0.010216143907980911, "pgas_tot": 0.12133848299596474, "tdis_tot": 5.687288484421467, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.1-dev\n", "buildingType": {"uid": "bestest_air"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.02730719968271573, "emis_tot": 0.785590772991245, "ener_tot": 3.7227262062358055, "idis_tot": 1221.6529527806554, "pdih_tot": null, "pele_tot": 0.010216143907980911, "pgas_tot": 0.12133848299596474, "tdis_tot": 5.687288484421467, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
2 changes: 1 addition & 1 deletion testing/references/bestest_hydronic/submit.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.0-dev\n", "buildingType": {"uid": "bestest_hydronic"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.4660775943925745, "emis_tot": 1.6291465071977262, "ener_tot": 9.00349952561408, "idis_tot": 0.0, "pdih_tot": null, "pele_tot": 0.00025517153990852024, "pgas_tot": 0.11798036181564837, "tdis_tot": 18.21783776691252, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.1-dev\n", "buildingType": {"uid": "bestest_hydronic"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.4660775943925745, "emis_tot": 1.6291465071977262, "ener_tot": 9.00349952561408, "idis_tot": 0.0, "pdih_tot": null, "pele_tot": 0.00025517153990852024, "pgas_tot": 0.11798036181564837, "tdis_tot": 18.21783776691252, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
2 changes: 1 addition & 1 deletion testing/references/bestest_hydronic_heat_pump/submit.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.0-dev\n", "buildingType": {"uid": "bestest_hydronic_heat_pump"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.8827810790417875, "emis_tot": 0.5807880184554309, "ener_tot": 3.4777725656013834, "idis_tot": 0.0, "pdih_tot": null, "pele_tot": 0.01891307030662192, "pgas_tot": null, "tdis_tot": 8.381692942513078, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.1-dev\n", "buildingType": {"uid": "bestest_hydronic_heat_pump"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.8827810790417875, "emis_tot": 0.5807880184554309, "ener_tot": 3.4777725656013834, "idis_tot": 0.0, "pdih_tot": null, "pele_tot": 0.01891307030662192, "pgas_tot": null, "tdis_tot": 8.381692942513078, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
2 changes: 1 addition & 1 deletion testing/references/multizone_office_simple_air/submit.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.0-dev\n", "buildingType": {"uid": "multizone_office_simple_air"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.1653760825456517, "emis_tot": 0.6104864888960548, "ener_tot": 1.7902829586394566, "idis_tot": 0.0, "pdih_tot": null, "pele_tot": 0.03334236916573142, "pgas_tot": null, "tdis_tot": 11.835570350490515, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.1-dev\n", "buildingType": {"uid": "multizone_office_simple_air"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.1653760825456517, "emis_tot": 0.6104864888960548, "ener_tot": 1.7902829586394566, "idis_tot": 0.0, "pdih_tot": null, "pele_tot": 0.03334236916573142, "pgas_tot": null, "tdis_tot": 11.835570350490515, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.0-dev\n", "buildingType": {"uid": "multizone_office_simple_hydronic"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.1635567919951241, "emis_tot": 0.20668064092366395, "ener_tot": 1.073923612094895, "idis_tot": 0.0, "pdih_tot": null, "pele_tot": 0.01725481348883811, "pgas_tot": null, "tdis_tot": 4.834027893201376, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.1-dev\n", "buildingType": {"uid": "multizone_office_simple_hydronic"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.1635567919951241, "emis_tot": 0.20668064092366395, "ener_tot": 1.073923612094895, "idis_tot": 0.0, "pdih_tot": null, "pele_tot": 0.01725481348883811, "pgas_tot": null, "tdis_tot": 4.834027893201376, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.0-dev\n", "buildingType": {"uid": "multizone_residential_hydronic"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.8145745610598426, "emis_tot": 1.4321317708442538, "ener_tot": 8.24351289540961, "idis_tot": 9141.559410046144, "pdih_tot": null, "pele_tot": 0.0017390231869758264, "pgas_tot": 0.09592720495532532, "tdis_tot": 21.408637265613642, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.1-dev\n", "buildingType": {"uid": "multizone_residential_hydronic"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.8145745610598426, "emis_tot": 1.4321317708442538, "ener_tot": 8.24351289540961, "idis_tot": 9141.559410046144, "pdih_tot": null, "pele_tot": 0.0017390231869758264, "pgas_tot": 0.09592720495532532, "tdis_tot": 21.408637265613642, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.0-dev\n", "buildingType": {"uid": "singlezone_commercial_hydronic"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.2631876743024744, "emis_tot": 0.3835816361039315, "ener_tot": 3.216796741203613, "idis_tot": 5.423390226236728, "pdih_tot": 0.08966856983946767, "pele_tot": 0.004907797325142573, "pgas_tot": null, "tdis_tot": 7.995222085010505, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.1-dev\n", "buildingType": {"uid": "singlezone_commercial_hydronic"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.2631876743024744, "emis_tot": 0.3835816361039315, "ener_tot": 3.216796741203613, "idis_tot": 5.423390226236728, "pdih_tot": 0.08966856983946767, "pele_tot": 0.004907797325142573, "pgas_tot": null, "tdis_tot": 7.995222085010505, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "peak_heat_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
2 changes: 1 addition & 1 deletion testing/references/testcase1/submit.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.0-dev\n", "buildingType": {"uid": "testcase1"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.8992178091703856, "emis_tot": 2.569193740486816, "ener_tot": 12.845968702434082, "idis_tot": 7118.611500670603, "pdih_tot": null, "pele_tot": null, "pgas_tot": 0.11536491775526585, "tdis_tot": 503.9889403913656, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "test_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
{"dash_url": "https://dashboard.boptest.net//api/results", "payload": {"results": [{"account": {"apiKey": "valid_api_key"}, "boptestVersion": "0.7.1-dev\n", "buildingType": {"uid": "testcase1"}, "controlStep": "86400.0", "dateRun": "2020-05-17 00:00:00", "forecastParameters": {}, "isShared": true, "kpis": {"cost_tot": 0.8992178091703856, "emis_tot": 2.569193740486816, "ener_tot": 12.845968702434082, "idis_tot": 7118.611500670603, "pdih_tot": null, "pele_tot": null, "pgas_tot": 0.11536491775526585, "tdis_tot": 503.9889403913656, "time_rat": 0}, "scenario": {"electricityPrice": "dynamic", "timePeriod": "test_day", "weatherForecastUncertainty": "deterministic"}, "tags": ["baseline", "unit_test"], "uid": "1"}]}}
Loading

0 comments on commit 239aae7

Please sign in to comment.