Skip to content

NREL/boptest-service

Repository files navigation

BOPTEST-Service

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
Loading

Getting Started

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.

BOPTEST-Service APIs

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/
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.

OpenAI Gym Interface

An OpenAI-Gym environment for BOPTEST is available.

Building and Running on a Personal Computer

  1. Clone this repository.

git clone https://github.com/NREL/boptest-service.git

  1. Install Docker.

  2. Use Docker to build and run BOPTEST-Service.

docker compose up web worker provision

  1. 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.

  2. Shutdown the test case by the command docker compose down executed in the root directory of this repository.

Kubernetes Based Deployment

NREL maintains a helm chart for Kubernetes based deployments of BOPTEST-Service.

Running the developer Test Suite

Testing is based on the BOPTEST test suite with small adaptations to conform to the BOPTEST-Service API. Follow the README for more information.

Project Management

Development is tracked by three branches within the project repository.

  • develop maintains the latest stable version of the project.
  • main tracks the latest release version and corresponds to the current production deployment on https://api.boptest.net. A tag is also created for each release version.
  • experimental is for versions of the project under evaluation and corresponds to a deployment on the "dev" cluster at https://api.dev.boptest.net.