This software extends BOPTEST to a web service architecture, which enables support for multiple clients and multiple simultaneous tests at a large scale. This is a containerized design that can be deployed on a personal computer, however the software is targeted at commercial cloud computing environments such as AWS. For details about BOPTEST, refer to the project homepage.
The canonical BOPTEST source code is incorporated into this repository as a git subtree located at <project-root>/boptest
and used under the terms of the license located at <project-root>/boptest/license.md
.
BOPTEST-Service is a sibling of Alfalfa, which follows the same architecture, but adopts a more general purpose API to support interactive building simulation, whereas the BOPTEST API is designed around predetermined test scenarios.
flowchart LR
A[API Client] <--> B[Web Frontend]
subgraph cloud [Cloud Deployment]
B <--> C[(Message Broker)]
C <--> D[Worker 1]
C <--> E[Worker 2]
C <--> F[Worker N]
subgraph workers [Worker Pool]
D
E
F
end
end
A simple demonstration of using the BOPTEST API is available in this interactive tutorial. This tutorial leverages a publicly available deployment of BOPTEST-Service, which can be reached at https://api.boptest.net.
The core BOPTEST APIs are documented as part of the upstream BOPTEST project. The BOPTEST-Service defines a number of APIs on top of BOPTEST for the purpose of managing test cases and running tests.
Description | Request |
---|---|
List official BOPTEST test cases. | GET testcases |
List unofficial test cases in a namespace. | GET testcases/{namespace} |
List private user test cases. (Auth required) | GET users/{username}/testcases/ |
Check if specific test case exists. | GET testcases/{testcase_name} |
Check if specific test case exists in the namespace. | GET testcases/{namespace}/{testcase_name} |
Check if specific private user test case exists. | GET users/{username}/testcases/{testcase_name} |
Select a test case and begin a new test. (Auth optional) | POST testcases/{testcase_name}/select |
Select a test case from the namespace and begin a new test. (Auth optional) | POST testcases/{namespace}/{testcase_name}/select |
Select a private user test case and begin a new test. (Auth required) | POST users/{username}/testcases/{testcase_name}/select |
Get test status as Running or Queued |
GET status/{testid} |
Stop a queued or running test. | PUT stop/{testid} |
List tests for a user. (Auth required) | GET users/{username}/tests |
The family of the select
APIs are used to choose a test case and begin a running test. Select returns a testid
which is required by all APIs that interact with the test or provide test information.
An OpenAI-Gym environment for BOPTEST is available.
- Clone this repository.
git clone https://github.com/NREL/boptest-service.git
-
Install Docker.
-
Use Docker to build and run BOPTEST-Service.
docker compose up web worker provision
-
In a separate process, use the core BOPTEST APIs as well as BOPTEST-service APIs to interact with the test case using your test controller.
-
Shutdown the test case by the command
docker compose down
executed in the root directory of this repository.
NREL maintains a helm chart for Kubernetes based deployments of BOPTEST-Service.
Testing is based on the BOPTEST test suite with small adaptations to conform to the BOPTEST-Service API. Follow the README for more information.