Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue617 refactor service with history 2 #652

Open
wants to merge 253 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
253 commits
Select commit Hold shift + click to select a range
f323037
Add initialize and advance rest endpoints with demo
kbenne Sep 24, 2020
8331822
WIP: Add boptest endpoints
kbenne Sep 25, 2020
6277063
Add service api for get/set step
kbenne Sep 28, 2020
85809a5
Add time to measurement payload
kbenne Sep 28, 2020
fb3eb6e
Post result to dashboard when a simulation is done
kbenne Sep 29, 2020
a076cd1
Add kpi, results, and stop APIs to service
kbenne Sep 29, 2020
da83794
Merge pull request #236 from NREL/boptest-service
dhblum Sep 30, 2020
5615176
Add forecast api to service interface
kbenne Oct 20, 2020
19c68e3
Fix build error
kbenne Jan 25, 2021
c6150e8
Fix bug related to forecast parameters
kbenne Jan 26, 2021
6b8c748
autoformatting, whitespace
nllong Feb 5, 2021
3a3b701
Remove copyright at the file level
kbenne Feb 9, 2021
d7c418a
WIP: partial update of testcase1 example for service
kbenne Feb 23, 2021
df67faf
WIP: add support for results on demand
kbenne Mar 9, 2021
7cd2db1
Fix syntax errors
kbenne Mar 9, 2021
6a6114e
Finalize on demand based results retrieval
kbenne Mar 11, 2021
0f64513
BOPTEST-Service: Make kpis "just in time"
kbenne Mar 12, 2021
40b357b
WIP: make tests pass against service
kbenne Mar 17, 2021
b3763cd
WIP: Update put step
kbenne Mar 17, 2021
c0cb3d5
BOPTEST-Service: return y values from initialize
kbenne Mar 18, 2021
e6e16fb
BOPTEST-Service: Reimplement advance
kbenne Mar 18, 2021
245a3b4
BOPTEST-Service: Enable more unit tests
kbenne Mar 18, 2021
ff01584
BOPTEST-Serivce: Enable tests related to forecast
kbenne Mar 23, 2021
3afe052
BOPTEST-Service: Add api and enable tests for scenarios
kbenne Mar 23, 2021
2e2535e
BOPTEST-Service: Adjust timeouts for communication with worker
kbenne Mar 23, 2021
c5e473e
BOPTEST-Service: Fix failing test named ExampleProportionalPython
kbenne Mar 24, 2021
df39d8e
BOPTEST-Service: Consolidate controllers
kbenne Mar 24, 2021
ac6eacd
Make "most of" testcase1 pass
kbenne Jun 29, 2021
f7d4725
Remove "app" a vestige of Alfalfa
kbenne Jun 29, 2021
fc8e2f0
Use config.py located in fmu resources
kbenne Jun 29, 2021
f6e090a
Update setScenario
kbenne Jun 30, 2021
8fb6f1b
Service: Fix corner cases when setting new scenario
kbenne Jun 30, 2021
7d40ed4
Service: Update worker container dockerfile
kbenne Jul 7, 2021
962e805
Service: Sanitize control inputs to advance function
kbenne Jul 7, 2021
fb56455
Service: Pass fmu path to TestCase
kbenne Jul 7, 2021
58df3d5
Service: Add version api
kbenne Jul 7, 2021
6dfe64b
Service: Change control input sanitizer to a validator
kbenne Jul 8, 2021
4475ff3
Service: Extensive renaming and cleanup
kbenne Jul 9, 2021
5489b2e
Service: A argument for testcase name on submit
kbenne Jul 11, 2021
b141f1a
Service: Add "select" api
kbenne Jul 14, 2021
6d9208e
Service: General improvements to code consistency
kbenne Jul 14, 2021
d43c640
Service: Fix regression related to advance
kbenne Jul 14, 2021
68eb76e
Service: Improve method of sending commands to worker
kbenne Jul 14, 2021
e245ad2
Service: Purge unused nodejs packages
kbenne Jul 14, 2021
645c12d
Service: Implement a two minute timeout
kbenne Jul 14, 2021
3172450
Service: Add comprehensive validation of user input
kbenne Jul 15, 2021
1b2c245
Service: Add a service to pre provision testcases
kbenne Jul 16, 2021
eeecfb6
Service: Remove extraneous redis subscribe/unsubscribe
kbenne Jul 16, 2021
2e6c14b
Service: Update API timeouts
kbenne Jul 16, 2021
a769e65
Service: Avoid frequent redis sub / unsub
kbenne Jul 22, 2021
f61bec1
Service: Promisify redis functions
kbenne Jul 22, 2021
109f77f
Service: remove unused cruft in web
kbenne Jul 22, 2021
93640d9
Bump worker timeout to 15 minutes
kbenne Aug 26, 2021
bb3b12b
Add provision function for the BOPTEST Dashboard
kbenne Dec 21, 2021
04ab99c
Update post_results_to_dashboard
kbenne Dec 22, 2021
4d2826e
Add api_key to select api
kbenne Jan 18, 2022
4cf0f0c
Update pip install command for worker
kbenne Feb 22, 2022
f3cf124
Update service with status codes
kbenne Jul 14, 2022
f1bde7e
Migrate to "MessagePack" going in/out of Redis
kbenne Jul 19, 2022
c01e311
Tweaks to fix testcases
kbenne Jul 20, 2022
4b9d380
Service: Rename the redis controller
kbenne Jul 20, 2022
b192c51
Service: Add submit api
kbenne Jul 21, 2022
7d33ff2
Merge pull request #455 from ibpsa/issue448-service-submit
kbenne Jul 26, 2022
29e0f0e
Update dashbaord provision script with new testcases
kbenne Jul 28, 2022
87c223a
Merge pull request #460 from ibpsa/issue424_v030_service
kbenne Jul 29, 2022
7c7d3f1
Service: (re)add Spawn install commands
kbenne Sep 14, 2022
0ed735d
Service: Fix GET /testcases API
kbenne Sep 14, 2022
f831424
Service: Add API to remove testcases
kbenne Sep 14, 2022
8bd6b20
Service: Consolidate timeouts into a single env var
kbenne Sep 14, 2022
f52af6c
Consume BOPTEST from a subtree
kbenne Oct 20, 2022
e3f95c3
Add license and readme
kbenne Oct 20, 2022
2cd65e5
Remove mongodb
kbenne Oct 21, 2022
c64895c
Fix inactivity timeout
kbenne Nov 2, 2022
a4098f0
Remove stale/unused code and comments
kbenne Nov 2, 2022
5a58b11
Reorganize routers into "public" and "authorized"
kbenne Nov 3, 2022
41a1c32
Add "authorizer" middleware to fetch user info
kbenne Nov 3, 2022
a6aa62a
Avoid passing s3 and sqs through function calls
kbenne Nov 3, 2022
f9d041f
Update docker ignore files for faster builds
kbenne Nov 3, 2022
eb17cf5
Add my/testcases routes
kbenne Nov 4, 2022
d907def
add nodemon to web
Nov 7, 2022
30e4fb2
WIP: Update provision script
kbenne Nov 14, 2022
dee9d20
Merge branch 'develop' into get_all_tests
Nov 14, 2022
2cbdbbe
Update provision library
kbenne Nov 18, 2022
1feae72
Change select
Nov 18, 2022
a5fafdb
REDIS public test routes fixed
jmythms Nov 21, 2022
b7dbe68
Merge branch 'issue/9-user-test-cases' of https://github.com/NREL/bop…
jmythms Nov 21, 2022
c14e5eb
Add /tests
jmythms Nov 21, 2022
39d79ea
Update provision tool with support for user test cases
kbenne Nov 22, 2022
8ab098b
add in GitHub action to build, test and publish docker container images
tijcolem Nov 22, 2022
4c65379
setStatus: fix args + remove unnecessary code
jmythms Nov 26, 2022
9693113
fix cleanup on worker side
jmythms Nov 27, 2022
c98ce07
not validated stop
jmythms Nov 27, 2022
12a4158
working my Tests
jmythms Nov 28, 2022
7442453
fix _getTests to work without userID
jmythms Nov 28, 2022
8f5ccf5
working testid validator
jmythms Nov 29, 2022
a0fd076
fix tests_string output
jmythms Nov 29, 2022
ac601cf
Merge pull request #21 from NREL/public_tests_debug
jmythms Nov 29, 2022
008e160
Create tests for test case management
kbenne Nov 30, 2022
dae08cc
try and update the pod deletion cost annotation between jobs
tijcolem Dec 8, 2022
bbea994
add kubernetes python client
tijcolem Dec 8, 2022
fd1da9e
Add tests for user defined test case api
kbenne Dec 8, 2022
f7108ee
fix versions to work with python2 and 3
tijcolem Dec 9, 2022
dd61ddb
add in some logging when updating pod costs
tijcolem Dec 13, 2022
303399c
Merge pull request #22 from NREL/k8s_pod_deletion_cost
kbenne Dec 13, 2022
540e301
Merge pull request #18 from NREL/issue_12
kbenne Dec 13, 2022
fbed98d
Report boptest-service version from `/version` endpoint
kbenne Dec 14, 2022
1a774b1
lower case for registry name for docker hub
tijcolem Dec 14, 2022
19db0d5
Merge pull request #23 from NREL/fix_dockerhub
kbenne Dec 14, 2022
068d968
Add configuration for test accounts
kbenne Dec 19, 2022
ac314ea
Simplify config for s3 url
kbenne Dec 19, 2022
42c67c0
Reorganize web src files
kbenne Dec 22, 2022
8c050ea
Merge remote-tracking branch 'origin/develop' into issue/9-user-test-…
kbenne Dec 22, 2022
56172ea
Update dockerignore
kbenne Dec 22, 2022
2dec377
Merge remote-tracking branch 'origin/get_all_tests' into issue/9-user…
kbenne Jan 4, 2023
6f0a1f1
Add unit test for get /tests api
kbenne Jan 4, 2023
ef85841
User user "subject" instead of username
kbenne Jan 4, 2023
86731b7
Reorganize and simplify web/server files
kbenne Jan 4, 2023
8b9b5f3
Remove validation of testid
kbenne Jan 4, 2023
5779c87
Add feature to abort queued tests
kbenne Jan 6, 2023
0a694c7
Update api to return 400 for invalid testid
kbenne Jan 6, 2023
05d5511
Use sscan to get all tests
kbenne Jan 6, 2023
d4d7a48
Stop tests if they timeout during select
kbenne Jan 6, 2023
3d6f456
Fix warning about `body-parser deprecated undefined extended`
kbenne Jan 6, 2023
4358eee
Add a default api key for provisioning in dev mode
kbenne Jan 6, 2023
666af44
Fix version api regression
kbenne Jan 10, 2023
bf3bd7e
Update test environment and correct failing tests
kbenne Jan 15, 2023
43489cb
Update dockerignore
kbenne Jan 15, 2023
dce7b1b
Add WebSocket API
kbenne Jan 18, 2023
5f17153
Add websocket example for running one boptest
kbenne Jan 20, 2023
b5afe6b
Add test to demonstrate advancing multiple tests over websocket
kbenne Jan 20, 2023
1c749f1
Adjust default number of parallel boptests in unit test
kbenne Jan 20, 2023
300aaff
Align pub/sub message format with canonical BOPTEST api doc
kbenne Jan 20, 2023
c255a51
Improve error messages (especially for websocket)
kbenne Jan 20, 2023
f43882c
Run boptest-service test as an action
kbenne Jan 21, 2023
3e1d66c
Use check instead of assert in tests
kbenne Jan 21, 2023
41a613d
Move WebSocket to dedicate endpoint at ws://<host>/ws
kbenne Feb 10, 2023
21b6d78
Send more descriptive error messages on internal server errors
kbenne Feb 14, 2023
241ae42
Improve stop implementation
kbenne Feb 14, 2023
7e3178e
Return a 401 when trying to select an invalid test case
kbenne Feb 14, 2023
dd6c4ec
Add a websocket test that sends params
kbenne Feb 15, 2023
596446c
Test overwritting signals via websocket
kbenne Mar 9, 2023
175b38f
Use python arrays instead of list
dhblum Feb 24, 2023
2b4a5a9
Update docs
kbenne Mar 10, 2023
5055f51
Merge pull request #25 from NREL/issue/24-websocket
kbenne Mar 13, 2023
55acf7a
Capture simulation output
kbenne Mar 13, 2023
483a14e
Allow test cases and simulation results to be downloaded
kbenne Mar 13, 2023
6f742cc
Tweaks for passing tests in boptest 0.4.0
kbenne Mar 31, 2023
851a3bd
fix the envs in the docker push as these are no longer in .env
tijcolem Mar 31, 2023
7adc9ef
fix docker tagging
tijcolem Mar 31, 2023
a6eb1e0
Fix bug related to timeouts on the websocket
kbenne Aug 2, 2023
87577d4
Custom json parsing for Infinity
kbenne Sep 12, 2023
447feba
Update BOPTEST-Service worker for pyfmi3 dependencies
kbenne Sep 20, 2023
187eb08
Increase web<->worker messaging timeout
kbenne Sep 21, 2023
0167761
Fix failing test related to websocket
kbenne Sep 21, 2023
259f462
Merge remote-tracking branch 'origin/issue/29-sim-output' into issue1…
kbenne Sep 22, 2023
62ec472
Remove all files from a completed worker job
kbenne Sep 22, 2023
6b25727
Merge remote-tracking branch 'origin/issue/28-simulation-download' in…
kbenne Sep 22, 2023
bff76df
Log when user auth fails
kbenne Dec 12, 2023
eef34d0
Fix an issue related to user auth
kbenne Dec 13, 2023
b7a68a0
create experimental branch and change CI logic to publish docker imag…
tijcolem Jan 24, 2024
2da2f5c
fix typo in bash script
tijcolem Jan 24, 2024
7f8b660
Add two zone apartment to provision script
kbenne Feb 16, 2024
7ba3ee7
Return 404 if a test case namespace does not exist
kbenne Feb 21, 2024
1d9b2bc
Use check.equal instead of check.is_true for status codes
kbenne Feb 21, 2024
690a42d
Send 401 for invalid authorization instead of 404
kbenne Feb 22, 2024
4bdec37
Add user and test case name tags for results
kbenne Feb 27, 2024
5ec462d
Change account.dis to account.sub
kbenne Feb 28, 2024
bf468ff
Store test results under "tests"
kbenne Feb 28, 2024
a1c4d3e
Change bucket name from alfalfa to boptest
kbenne Feb 28, 2024
76ac96b
Factor redis functions into a dedicated module
kbenne Mar 1, 2024
3555dc7
Replace SQS with a simple redis queue
kbenne Mar 7, 2024
e85ecbd
Merge branch 'v0.6.0-dev' into experimental
tijcolem Mar 27, 2024
21433f8
Merge NREL/boptest-service into issue617_refactorService_with_history2
kbenne Jun 13, 2024
0106c04
Initial use of service only
dhblum Feb 5, 2024
fe3b2ea
Pass bestest_air tests except invalid_name
dhblum Feb 6, 2024
1d8b63a
Pass bestest_hydronic and bestest_hydronic_heat_pump
dhblum Feb 6, 2024
0356f74
Pass singlezone_commercial_hydronic
dhblum Feb 6, 2024
a6daa1c
Pass test_testcase1 python
dhblum Feb 6, 2024
7bd9474
Pass examples python
dhblum Feb 7, 2024
8aed79a
Pass test_bacnet
dhblum Feb 8, 2024
b3f91c2
Updates for julia examples
dhblum Feb 9, 2024
0a311b8
Update license to refer to NREL boptest-service
dhblum Feb 9, 2024
f852251
Update .travis.yml to use latest version of docker
dhblum Feb 21, 2024
95f7b64
Update .travis.yml to start docker again after stop and update
dhblum Feb 22, 2024
5e7898b
Update service/README.md
dhblum Apr 9, 2024
b9ee911
Remove ref to OpenAIGym in Service dir readme
dhblum Apr 9, 2024
018b5b5
Updates to README.md [ci skip]
dhblum Apr 9, 2024
65bb3c6
Updates to README.md [ci skip]
dhblum Apr 9, 2024
222e3af
Update for Service v0.4.0
dhblum May 7, 2024
dea4b19
Update travis dist to focal
dhblum May 8, 2024
41226d3
Suppress docker build outputs
dhblum May 9, 2024
b5aef38
Fix quiet argumet
dhblum May 13, 2024
d0dff4f
Build docker seperate to further reduce log output in travis
dhblum May 13, 2024
bdec483
Remove wrong comment [ci skip]
dhblum May 14, 2024
895e752
Update dockerignore files
kbenne Jun 13, 2024
179fb11
Update docker-compose
kbenne Jun 13, 2024
96c1d08
Update conda and pyfmi version manually, including scipy version tag
dhblum Jul 1, 2024
c1d234a
Fix missing code in utilities.py
dhblum Jul 1, 2024
c14f85d
Update .travis.yml to specify Python 3.9.6
dhblum Jul 2, 2024
dbb2e18
Update utilities.py to isolate use of matplotlib
dhblum Jul 2, 2024
71063e9
Merge branch 'master' into issue617_refactorService_with_history2
dhblum Jul 30, 2024
183765e
Fix typo
dhblum Jul 30, 2024
594bb23
Fix for julia examples
dhblum Jul 30, 2024
af22ad7
Quiet julia docker build
dhblum Jul 31, 2024
08801ab
Quiet javascript example docker build
dhblum Jul 31, 2024
57d8ff0
Merge branch 'issue617_refactorService_with_history2' of https://gith…
dhblum Jul 31, 2024
35c9aaa
Fix typo in julia example
dhblum Aug 2, 2024
742ce84
Merge branch 'master' into issue617_refactorService_with_history2
dhblum Aug 2, 2024
a03033c
Resolve errant merge conflict markers
kbenne Aug 12, 2024
780fac5
Specify ubuntu docker platform and numpy version for worker
dhblum Aug 23, 2024
cae82e0
Fix for #671 and unit test update
dhblum Aug 23, 2024
a9af191
Fix julia example controllers to stop test case
dhblum Aug 23, 2024
8c6c73e
Merge branch 'master' into issue617_refactorService_with_history2
dhblum Aug 29, 2024
90b9ca9
Update unit testing for new test case
dhblum Aug 29, 2024
7892d28
Merge branch 'master' into issue617_refactorService_with_history2
dhblum Aug 30, 2024
6771499
Update readmes [ci skip]
dhblum Aug 30, 2024
bb75c96
Further readme edits [ci skip]
dhblum Aug 30, 2024
7611612
Draft release notes [ci skip]
dhblum Aug 30, 2024
5bc01fe
Mark releasenotes.md important [ci skip]
dhblum Aug 30, 2024
659681e
Merge branch 'master' into issue617_refactorService_with_history2
dhblum Sep 3, 2024
58aeea2
Add line in readme pointing to service readme
dhblum Sep 3, 2024
940f3ca
Initial service api testing migration
dhblum Sep 4, 2024
a3cf7f1
Remove redis port exposure from docker-compose
dhblum Sep 5, 2024
167e036
Add service API tests to travis and test failure as expected
dhblum Sep 11, 2024
9d2591f
Try passing exit code from docker
dhblum Sep 11, 2024
6534348
Correct service API tests so should pass and edit releasenotes
dhblum Sep 11, 2024
7c01cea
Remove exposing port 29043
dhblum Sep 17, 2024
fea197c
Improve logging and diagnostic information
kbenne Sep 12, 2024
c6ea785
Adjust message timeout between web and worker
kbenne Sep 16, 2024
38bd2b6
Further adjust messaging timeout
kbenne Sep 17, 2024
891f99b
Merge pull request #685 from ibpsa/issue684_service_timeout_and_logging
dhblum Sep 27, 2024
420ad3e
Update comment in docker-compose.yml
dhblum Oct 9, 2024
7530d59
Remove service gitignore
dhblum Oct 9, 2024
aedb622
Remove testing code for Python2
dhblum Oct 9, 2024
b648373
Remove "service-version"
kbenne Oct 10, 2024
ef54ed0
Update get_html_IO file for test case documentation to work with new …
EttoreZ Nov 1, 2024
5aa41c2
Update find_days script to work with BOPTEST service architecture
EttoreZ Nov 3, 2024
5950ab4
Update find_days and get_html_IO headers
EttoreZ Nov 3, 2024
5175ec7
Update find_days header [ci skip]
EttoreZ Nov 3, 2024
aa5da6f
Edit find_days and get_html_IO doc strings and find_days script for e…
dhblum Nov 5, 2024
0eedaeb
Merge branch 'master' into issue617_refactorService_with_history2
dhblum Nov 5, 2024
72420f4
Append variables to filter list in simulate_skip_API and remove img name
EttoreZ Nov 5, 2024
cca7aae
Update bacnet create_ttl.py to work with service architecture [ci skip]
EttoreZ Nov 5, 2024
878e0a9
Edit doc string for create_ttl
dhblum Nov 6, 2024
4db5a0c
Proposal for merged readmes [ci skip]
dhblum Nov 6, 2024
8bc7abd
Edit readme [ci skip]
dhblum Nov 6, 2024
f290155
Edit readme [ci skip]
dhblum Nov 6, 2024
319b215
Edit readme [ci skip]
dhblum Nov 6, 2024
384a6f5
Update license [ci skip]
dhblum Nov 6, 2024
00add91
Run pre-commit
dhblum Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
TESTCASE='testcase2'

APP_PATH='/home/user'
# Performance configuration
NODE_ENV=production
BOPTEST_TIMEOUT=900
BOPTEST_LOGLEVEL=INFO

# Redis configuration
BOPTEST_REDIS_HOST=redis

# Job queue configuration
BOPTEST_JOB_QUEUE_URL=http://goaws:4100/queue/local-queue1
AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxx
AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
MINIO_ROOT_USER=user
MINIO_ROOT_PASSWORD=password

# Object store (S3) related configuration
BOPTEST_INTERNAL_S3_URL=http://minio:9000
BOPTEST_PUBLIC_S3_URL=http://minio:9000
BOPTEST_S3_BUCKET=boptest
BOPTEST_REGION=us-west-1

# Provisioning and test configuration
BOPTEST_SERVER=http://web
BOPTEST_WS_SERVER=ws://web/ws

BOPTEST_DASHBOARD_SERVER=https://dashboard.boptest.net/

# Testing configuration
# These fake test accounts will be used in place of BOPTEST_DASHBOARD_SERVER accounts
BOPTEST_USE_TEST_USERS="true"
BOPTEST_TEST_USERNAME="canary"
BOPTEST_TEST_KEY="canarykey"
BOPTEST_TEST_PRIVILEGED_USERNAME="crusader"
BOPTEST_TEST_PRIVILEGED_KEY="crusaderkey"
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist: focal

language: python

branches:
Expand All @@ -13,20 +15,20 @@ notifications:
services:
- docker

env:
- DOCKER_COMPOSE_VERSION=1.26.0

before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- sudo systemctl stop docker.service && sudo systemctl stop docker.socket
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- yes | sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- sudo systemctl start docker

before_script:
- export PYTHONPATH=$PYTHONPATH:$(pwd)

jobs:
include:
- script: docker compose up -d web worker provision && sleep 10 && docker compose up test --no-deps --exit-code-from test
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 requests==2.25.1
script: cd testing && make build_jm_image && make test_parser
Expand Down
41 changes: 0 additions & 41 deletions Dockerfile

This file was deleted.

144 changes: 94 additions & 50 deletions README.md

Large diffs are not rendered by default.

32 changes: 19 additions & 13 deletions bacnet/BopTestProxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
nextState = None
g = None

baseurl = "http://localhost:5000"
baseurl = "http://127.0.0.1:80"
boptest_measurements = None
boptest_inputs = None

Expand Down Expand Up @@ -140,7 +140,7 @@ def update_boptest_data():
"""Read the current simulation data from the API and set the object values."""
if _debug:
update_boptest_data._debug("update_boptest_data")
global objects, inputs, baseurl
global objects, inputs, baseurl, testid

# ask the web service
# We get results direct from /advance now but you could ask the simulation for historic data
Expand Down Expand Up @@ -180,11 +180,7 @@ def update_boptest_data():


#print("Advancing with signals: " + str(signals))
response = requests.post(
# "http://localhost:5000/advance", json={"oveAct_u": next_oveAct_u, "oveAct_activate": next_oveAct_activate}
'{0}/advance'.format(baseurl), json=signals

)
response = requests.post('{0}/advance/{1}'.format(baseurl,testid), json=signals)
if response.status_code != 200:
print("Error response: %r" % (response.status_code,))
return
Expand Down Expand Up @@ -228,9 +224,10 @@ def main():

parser = ConfigArgumentParser(description=__doc__)

parser.add_argument('testcase', type=str, help="Name of BOPTEST test case to deploy")
parser.add_argument('start_time', type=int, default=0, help="timestamp (in seconds) at which to start the simulation")
parser.add_argument('warmup_period', type=int, default=0, help="timestamp (in seconds) at which to start the simulation")
parser.add_argument('--baseurl', dest='baseurl', type=str, default='http://localhost:5000', help="URL for BOPTest endpoint")
parser.add_argument('--baseurl', dest='baseurl', type=str, default='http://127.0.0.1:80', help="URL for BOPTest endpoint")
# parse the command line arguments
args = parser.parse_args()
baseurl = args.baseurl
Expand All @@ -243,28 +240,31 @@ def main():
# TODO: check the results to make sure we acutally get an OK!
#
global nextState
global testid

res = requests.put('{0}/initialize'.format(baseurl), json={'start_time':args.start_time, 'warmup_period':args.warmup_period} ).json()
testid = requests.post("{0}/testcases/{1}/select".format(baseurl, args.testcase)).json()["testid"]
res = requests.put('{0}/initialize/{1}'.format(baseurl,testid), json={'start_time':args.start_time, 'warmup_period':args.warmup_period} ).json()
nextState = res

global boptest_measurements, boptest_inputs
boptest_measurements = requests.get(baseurl + "/measurements").json()
boptest_inputs = requests.get(baseurl+"/inputs").json()
boptest_measurements = requests.get('{0}/measurements/{1}'.format(baseurl,testid)).json()
boptest_inputs = requests.get('{0}/inputs/{1}'.format(baseurl,testid)).json()

# We advance the simulation by 5 seconds at each call to /advance, and APPINTERVAL is also 5 seconds, so the simulationo
# moves in sync with wallclock time. To see things happen faster, set this time greater than 5 seconds
res = requests.put('{0}/step'.format(baseurl), json={'step':5})
res = requests.put('{0}/step/{1}'.format(baseurl,testid), json={'step':5})

# make a device object
this_device = LocalDeviceObject(ini=args.ini)
print(args.ini)
if _debug:
_log.debug(" - this_device: %r", this_device)

# make a sample application
this_application = ReadPropertyMultipleApplication(this_device, args.ini.address)

# create the objects and add them to the application
test_case_name = requests.get('{0}/name'.format(baseurl)).json()['payload']['name']
test_case_name = requests.get('{0}/name/{1}'.format(baseurl,testid)).json()['payload']['name']
file_name = '../testcases/{0}/models/bacnet.ttl'.format(test_case_name)
create_objects(this_application, file_name)

Expand All @@ -276,6 +276,12 @@ def main():

run()

# shutdown test case when done
res = requests.put("{0}/stop/{1}".format(baseurl, testid))
if res.status_code == 200:
_log.debug('Done shutting down test case.')
else:
_log.debug('Error shutting down test case.')
if _debug:
_log.debug("fini")

Expand Down
2 changes: 1 addition & 1 deletion bacnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The BACnet objects are configured based on a .ttl file for each test case locate

2. Configure ``BACpypes.ini``, particularly the address to define where the BACnet device will sit on the network.

3. In a new terminal, run ``$ python BopTestProxy.py 0 0`` to deploy the BACnet device and objects for the test case and initialize the test case with start time of 0 and warmup period of 0.
3. In a new terminal, run ``$ python BopTestProxy.py bestest_air 0 0`` to deploy the BACnet device and objects for the test case ``bestest_air`` (or choose another) and initialize it with start time of 0 and warmup period of 0.

4. Use a BACnet application to locate the device and objects on the network and communicate with them.

Expand Down
24 changes: 17 additions & 7 deletions bacnet/create_ttl.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# -*- coding: utf-8 -*-
"""
Creates ttl file for creation of Brick objects.
Deploy a test case and then use this file to read the available input
and measurement points and create the ttl file accordingly.

To run this script:
1. Deploy BOPTEST as described in README.md at root of repository
2. Set 'test_case_name' parameter to test case that needs bacnet .ttl
(i.e. bestest_air)
3. Run script
4. ''<test_case_name>.ttl'' file will be generated with inputs and measurement
bacnet points

"""

import requests

# Set url for BOPTEST test case
baseurl = 'http://localhost:5000'
baseurl = 'http://127.0.0.1:80'

# Get the test case name
test_case_name = requests.get('{0}/name'.format(baseurl)).json()['payload']['name']
# Instatiate test case
test_case_name = 'bestest_air'
testid = requests.post("{0}/testcases/{1}/select".format(baseurl, test_case_name)).json()["testid"]

# Write the file prefix
prefix = '@prefix bldg: <urn:example#> .\n\
Expand All @@ -31,10 +38,13 @@
f.write(prefix)

# Get all the points and their metadata from BOPTEST test case
measurement_points = requests.get('{0}/measurements'.format(baseurl)).json()['payload']
input_points = requests.get('{0}/inputs'.format(baseurl)).json()['payload']
measurement_points = requests.get('{0}/measurements/{1}'.format(baseurl,testid)).json()['payload']
input_points = requests.get('{0}/inputs/{1}'.format(baseurl,testid)).json()['payload']
points = measurement_points | input_points

# Stop test case
requests.put('{0}/stop/{1}'.format(baseurl, testid))

# Write the bacnet objects for each point in the file
with open(test_case_name+'.ttl', 'a') as f:
obj_id = 1
Expand Down
Loading