diff --git a/.github/workflows/openstudio-server-tests.yml b/.github/workflows/openstudio-server-tests.yml index 5272a10fd..5ec7ce9bf 100644 --- a/.github/workflows/openstudio-server-tests.yml +++ b/.github/workflows/openstudio-server-tests.yml @@ -10,8 +10,8 @@ on: [push, pull_request] env: USE_TESTING_TIMEOUTS: "true" - OPENSTUDIO_VERSION: 3.10.0 - OPENSTUDIO_VERSION_SHA: 86d7e215a1 + OPENSTUDIO_VERSION: 3.11.0 + OPENSTUDIO_VERSION_SHA: 241b8abb4d OPENSTUDIO_VERSION_EXT: "" DOCKER_COMPOSE_VERSION: 1.21.1 BUNDLE_WITHOUT: native_ext @@ -19,7 +19,7 @@ env: jobs: linux-test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Delete huge unnecessary tools folder run: rm -rf /opt/hostedtoolcache @@ -56,7 +56,7 @@ jobs: name: openstudio-server-gems-linux path: build/NREL/export/*.tar.gz macos-test: - runs-on: macos-13 + runs-on: macos-15-intel steps: - name: Check out repository uses: actions/checkout@v4 @@ -91,7 +91,7 @@ jobs: name: openstudio-server-gems-darwin path: build/NREL/export/*.tar.gz docker: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Delete huge unnecessary tools folder run: rm -rf /opt/hostedtoolcache @@ -105,7 +105,7 @@ jobs: - name: docker shell: bash run: | - export OPENSTUDIO_TAG=3.10.0 + export OPENSTUDIO_TAG=3.11.0 sed -i -E "s/.git//g" .dockerignore docker volume create --name=osdata docker images --all @@ -131,7 +131,7 @@ jobs: if: | github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || - github.ref == 'refs/heads/custom_gems' + github.ref == 'refs/heads/3.11.0' shell: bash run: ./docker/deployment/scripts/deploy_docker_github_actions.sh env: diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml index 360445143..e2747b8b6 100644 --- a/.github/workflows/security-scan.yml +++ b/.github/workflows/security-scan.yml @@ -10,8 +10,8 @@ on: [push, pull_request] env: USE_TESTING_TIMEOUTS: "true" - OPENSTUDIO_VERSION: 3.10.0 - OPENSTUDIO_VERSION_SHA: 86d7e215a1 + OPENSTUDIO_VERSION: 3.11.0 + OPENSTUDIO_VERSION_SHA: 241b8abb4d OPENSTUDIO_VERSION_EXT: "" DOCKER_COMPOSE_VERSION: 1.21.1 BUNDLE_WITHOUT: native_ext @@ -19,7 +19,7 @@ env: jobs: docker-scan: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Check out repository uses: actions/checkout@v2 @@ -31,7 +31,7 @@ jobs: - name: docker shell: bash run: | - export OPENSTUDIO_TAG=3.10.0 + export OPENSTUDIO_TAG=3.11.0 sed -i -E "s/.git//g" .dockerignore docker volume create --name=osdata docker images --all diff --git a/CHANGELOG.md b/CHANGELOG.md index dca64f992..ad59732ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ OpenStudio Server ================= +Version 3.11.0 +------------- +* Bumped OpenStudio Server version to 3.11.0. +* Updated CI and build infrastructure to support newer platforms: +* Migrated Ubuntu CI from 22.04 to 24.04. +* Updated macOS runner and version checks to support macOS 15. +* Updated MongoDB version used in CI to 8.x. +* Updated container tags and packaging logic for modern OS targets. +* Updated packaged Ruby and dependency handling for Ubuntu 24.04. +* Adjusted test expectations in docker_stack_requeue_spec.rb to reflect updated behavior. +* Cleaned up legacy Windows install and packaging logic. + Version 3.10.0 ------------- * Custom Gems working again https://github.com/NREL/OpenStudio-server/pull/818 @@ -11,7 +23,7 @@ Version 3.10.0 * Local Server startup enhancements for PAT https://github.com/NREL/OpenStudio-server/pull/827 -Version 3.9.0-rc3 +Version 3.9.0 ------------- * 3.9.0 was pulled and several RCs were tried to fix various issues. This was the last RC before we ran out of funding for the release cycle. * Custom Gems have not worked since Ruby 3 upgrade (3.8.0) diff --git a/Dockerfile b/Dockerfile index 2ae221fdc..82a76f361 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,16 +4,16 @@ # NOTES: Currently this is one big dockerfile and non-optimal. #may include suffix -ARG OPENSTUDIO_VERSION=3.10.0 -FROM nrel/openstudio:3.10.0 AS base +ARG OPENSTUDIO_VERSION=3.11.0 +FROM nrel/openstudio:3.11.0 AS base ARG OPENSTUDIO_VERSION ENV DEBIAN_FRONTEND=noninteractive # Install required libaries. # realpath - needed for wait-for-it RUN apt-get update && apt-get install -y wget gnupg lsb-release \ - && wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | tee /usr/share/keyrings/mongodb-org-6.0-archive-keyring.gpg \ - && echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-org-6.0-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list \ + && wget -qO - https://www.mongodb.org/static/pgp/server-8.0.asc | gpg --dearmor | tee /usr/share/keyrings/mongodb-org-8.0-archive-keyring.gpg \ + && echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-org-8.0-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/8.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-8.0.list \ && apt-get update \ && apt-get install -y --no-install-recommends \ mongodb-org \ diff --git a/README.md b/README.md index 87713250c..6af159e8c 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ fundamentals. The [openstudio_meta](./bin/openstudio_meta) file is a ruby script which provides access to packaging and execution commands which allow for this codebase to be embedded in applications deployed to computers without docker. Deployment -requires that [MongoDB 6.0.7](https://www.mongodb.com/download-center/community/releases/archive) and [Ruby v2.7](https://www.ruby-lang.org/en/downloads/) +requires that [MongoDB 8.0.12](https://www.mongodb.com/download-center/community/releases/archive) and [Ruby v3.2](https://www.ruby-lang.org/en/downloads/) are additionally packaged. The openstudio_meta deployment relies on the `install_gems` command, which uses local system libraries to build all diff --git a/appveyor.yml b/appveyor.yml index 7006e17a4..df624b89c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,8 +4,8 @@ image: Visual Studio 2019 environment: USE_TESTING_TIMEOUTS: "true" - OPENSTUDIO_VERSION: 3.10.0 - OPENSTUDIO_VERSION_SHA: 86d7e215a1 + OPENSTUDIO_VERSION: 3.11.0 + OPENSTUDIO_VERSION_SHA: 241b8abb4d OPENSTUDIO_VERSION_EXT: "" OPENSTUDIO_TEST_EXE: C:\projects\openstudio\bin\openstudio.exe BUILD_TYPE: "test" @@ -16,7 +16,7 @@ artifacts: name: oss.tar.gz init: - #- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + # - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) clone_folder: C:\projects\openstudio-server diff --git a/ci/appveyor/install-windows.qs b/ci/appveyor/install-windows.qs deleted file mode 100644 index a17cfe60d..000000000 --- a/ci/appveyor/install-windows.qs +++ /dev/null @@ -1,46 +0,0 @@ -function Controller () { - // silent install is not an option until QtIFW v3.0.1 - // gui.setSilent(true); -} - -Controller.prototype.IntroductionPageCallback = function () { - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.ComponentSelectionPageCallback = function () { - var widget = gui.currentPageWidget(); - - // to install a subset of components, uncomment the code below and edit as neccesary - //widget.deselectAll(); - //widget.selectComponent('SketchUpPlugin'); - //widget.selectComponent('CLI'); - //widget.selectComponent('RubyAPI'); - //widget.selectComponent('CSharpAPI'); - //widget.selectComponent('PAT'); - //widget.selectComponent('OpenStudioApp'); - //widget.selectComponent('DView'); - //widget.selectComponent('EnergyPlus'); - //widget.selectComponent('Radiance'); - //widget.selectComponent('Resources'); - - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.TargetDirectoryPageCallback = function () { - // set install directory if needed - var widget = gui.currentPageWidget(); - widget.TargetDirectoryLineEdit.setText("c:\\openstudio") - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.StartMenuDirectoryPageCallback = function () { - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.ReadyForInstallationPageCallback = function () { - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.FinishedPageCallback = function () { - gui.clickButton(buttons.FinishButton); -} \ No newline at end of file diff --git a/ci/appveyor/setup.cmd b/ci/appveyor/setup.cmd index 24545493f..8e6a1dc75 100644 --- a/ci/appveyor/setup.cmd +++ b/ci/appveyor/setup.cmd @@ -20,34 +20,16 @@ if %ERRORLEVEL% neq 0 ( dir . REM “Unblock” the file so Windows does not refuse to execute it -powershell -Command "Unblock-File -Path '%OS_INSTALL_NAME%'" - -REM Execute the OpenStudio installer -REM %OS_INSTALL_NAME% --script ci/appveyor/install-windows.qs -REM 3) Run the OpenStudio installer in “quiet” mode, pointing to our QScript -echo Launching installer… -REM Use “.\” to ensure we’re running the downloaded EXE in the current directory -start "" /wait "%OS_INSTALL_NAME%" --script ci/appveyor/install-windows.qs +powershell -Command "Unblock-File -Path '%CD%\%OS_INSTALL_NAME%'" + +echo Execute the OpenStudio installer +"%OS_INSTALL_NAME%" /S /D=C:\projects\openstudio if %ERRORLEVEL% neq 0 ( echo. echo ERROR: OpenStudio installer "%OS_INSTALL_NAME%" returned error code %ERRORLEVEL%. Aborting. exit /b 1 ) -REM move C:\openstudio C:\projects\openstudio -REM 4) Move the default “C:\openstudio” install directory into the projects dir -if exist C:\openstudio ( - move /Y C:\openstudio C:\projects\openstudio - if %ERRORLEVEL% neq 0 ( - echo. - echo ERROR: Could not move “C:\openstudio” to “C:\projects\openstudio”. Check permissions. - exit /b 1 - ) -) else ( - echo. - echo ERROR: After running the installer, “C:\openstudio” was not found. Aborting. - exit /b 1 -) dir C:\projects\openstudio REM Cleanup installer diff --git a/ci/github-actions/install_openstudio.sh b/ci/github-actions/install_openstudio.sh index 05d61a8b2..a41ef4a1f 100755 --- a/ci/github-actions/install_openstudio.sh +++ b/ci/github-actions/install_openstudio.sh @@ -8,7 +8,7 @@ OPENSTUDIO_VERSION_EXT="${3:-}" if [ ! -z ${OPENSTUDIO_VERSION} ] && [ ! -z ${OPENSTUDIO_SHA} ]; then # OPENSTUDIO_VERSION_EXT may be empty - OPENSTUDIO_DOWNLOAD_FILENAME=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_SHA}-Ubuntu-22.04-x86_64.deb + OPENSTUDIO_DOWNLOAD_FILENAME=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_SHA}-Ubuntu-24.04-x86_64.deb echo "Installing OpenStudio ${OPENSTUDIO_DOWNLOAD_FILENAME}" #OPENSTUDIO_DOWNLOAD_BASE_URL=https://openstudio-ci-builds.s3-us-west-2.amazonaws.com/develop #OPENSTUDIO_DOWNLOAD_BASE_URL=https://github.com/NREL/OpenStudio/releases/download/v3.8.0 diff --git a/ci/github-actions/setup.sh b/ci/github-actions/setup.sh index b701916da..cbe5d4b74 100755 --- a/ci/github-actions/setup.sh +++ b/ci/github-actions/setup.sh @@ -2,7 +2,7 @@ set -euo pipefail echo "The build architecture is ${ImageOS}" -if [ "${ImageOS}" == "ubuntu22" ] && [ "${BUILD_TYPE}" == "docker" ]; then +if [ "${ImageOS}" == "ubuntu24" ] && [ "${BUILD_TYPE}" == "docker" ]; then echo "Installing docker compose" sudo rm -f /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 @@ -14,7 +14,7 @@ if [ "${ImageOS}" == "ubuntu22" ] && [ "${BUILD_TYPE}" == "docker" ]; then else # sudo rvm implode --force # rvm PATH rewriting interferes with portable Ruby. - if [ "${ImageOS}" == "macos13" ]; then + if [ "${ImageOS}" == "macos15" ]; then brew update > $GITHUB_WORKSPACE/spec/files/logs/brew-update.log brew install pv tree coreutils shared-mime-info @@ -33,14 +33,14 @@ else rm ruby-3.2.2-darwin.tar.gz # Install mongodb from a download. Brew is hanging and requires building mongo. This also speeds up the builds. - curl -SLO https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-6.0.7.tgz - tar xvzf mongodb-macos-x86_64-6.0.7.tgz + curl -SLO https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-8.0.12.tgz + tar xvzf mongodb-macos-x86_64-8.0.12.tgz exit_status_tar=$? if [ $exit_status_tar -ne 0 ]; then - echo "Error: Failed to extract Mongo 6.0.7 archive" + echo "Error: Failed to extract Mongo 8.0.12 archive" exit $exit_status_tar fi - sudo cp mongodb-macos-x86_64-6.0.7/bin/* /usr/local/bin/ + sudo cp mongodb-macos-x86_64-8.0.12/bin/* /usr/local/bin/ rm -r mongodb-macos* # Install openstudio -- Use the install script that is in this repo now, the one on OpenStudio/develop has changed @@ -83,16 +83,14 @@ else ulimit -n 4096 ulimit -a - elif [ "${ImageOS}" == "ubuntu22" ]; then + elif [ "${ImageOS}" == "ubuntu24" ]; then echo "Setting up Ubuntu for unit tests and Rubocop" # install pipe viewer to throttle printing logs to screen (not a big deal in linux, but it is in osx) sudo apt-get update && sudo apt-get install -y wget gnupg software-properties-common build-essential - #sudo wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add - - #echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse | tee /etc/apt/sources.list.d/mongodb-org-6.0.list" # Import MongoDB public GPG key - sudo wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-org-6.0-archive-keyring.gpg + sudo wget -qO - https://www.mongodb.org/static/pgp/server-8.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-org-8.0-archive-keyring.gpg # Add MongoDB to the sources list - echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-org-6.0-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list + echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-org-8.0-archive-keyring.gpg] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list sudo apt-get update sudo apt-get install -y pv tree mongodb-org libqdbm14 libxml2-dev @@ -113,8 +111,9 @@ else # install portable ruby - required for build that will eventually be published # see https://github.com/NREL/OpenStudio-PAT/wiki/Pat-Build-Notes - curl -SLO --insecure https://openstudio-resources.s3.amazonaws.com/pat-dependencies3/ruby-3.2.2-linux.tar.gz - tar xvzf ruby-3.2.2-linux.tar.gz + #curl -SLO --insecure https://openstudio-resources.s3.amazonaws.com/pat-dependencies3/ruby-3.2.2-linux.tar.gz + curl -SLO --insecure https://openstudio-resources.s3.us-east-1.amazonaws.com/pat-dependencies3/ruby-3.2.2-ubuntu24.04-x86_64.tar.gz + tar xvzf ruby-3.2.2-ubuntu24.04-x86_64.tar.gz exit_status_tar=$? if [ $exit_status_tar -ne 0 ]; then echo "Error: Failed to extract Ruby 3.2.2 archive" @@ -124,7 +123,7 @@ else sudo rm -rf /usr/local/ruby sudo mv ruby /usr/local/ ldd /usr/local/ruby/bin/ruby - rm ruby-3.2.2-linux.tar.gz + rm ruby-3.2.2-ubuntu24.04-x86_64.tar.gz mkdir -p reports/rspec sudo ./ci/github-actions/install_openstudio.sh $OPENSTUDIO_VERSION $OPENSTUDIO_VERSION_SHA $OPENSTUDIO_VERSION_EXT @@ -145,6 +144,13 @@ else # test openssl ruby ${GITHUB_WORKSPACE}/ci/github-actions/verify_openstudio.rb + #DEBUG shared libraries in packaged ruby + ruby -v + echo "=== RBCONFIG SNAPSHOT ===" + ruby -rrbconfig -e 'p RbConfig::CONFIG.values_at("ruby_version","arch","LIBRUBYARG_SHARED","LIBRUBYARG_STATIC","LIBRUBY_SO","LIBRUBY_A","libdir","rubylibdir","archdir")' + echo "=== /usr/local/ruby/lib ===" + ls -la /usr/local/ruby/lib || true + ruby "${GITHUB_WORKSPACE}/bin/openstudio_meta" install_gems --with_test_develop --debug --verbose --use_cached_gems bundle -v # create dir for output files which will be generated in case of failure diff --git a/ci/github-actions/test.sh b/ci/github-actions/test.sh index 798efa699..62cb6e310 100755 --- a/ci/github-actions/test.sh +++ b/ci/github-actions/test.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # platform-specific config here (also in setup.sh): -if [ "${ImageOS}" == "macos13" ]; then +if [ "${ImageOS}" == "macos15" ]; then # Dir containing openstudio export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin-x86_64 export RUBYLIB="$HOME/$OS_NAME_WITH_PLUS/Ruby" @@ -11,7 +11,7 @@ if [ "${ImageOS}" == "macos13" ]; then export GEM_HOME="$GITHUB_WORKSPACE/gems" export GEM_PATH="$GITHUB_WORKSPACE/gems:$GITHUB_WORKSPACE/gems/bundler/gems" mongo_dir="/usr/local/bin" -elif [ "${ImageOS}" == "ubuntu22" ]; then +elif [ "${ImageOS}" == "ubuntu24" ]; then # Dir containing openstudio export ENERGYPLUS_EXE_PATH=/usr/local/openstudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}/EnergyPlus/energyplus export PATH=/usr/local/ruby/bin:/usr/bin:/usr/local/openstudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}/bin:${PATH} @@ -83,14 +83,14 @@ else # Fix the shebang line in the bundle and bundler scripts echo "Fixing the shebang line in the bundle and bundler scripts" - if [ "${ImageOS}" == "macos13" ]; then + if [ "${ImageOS}" == "macos15" ]; then sed -i '' "1s|.*|#!${RUBY_PATH}|" $BUNDLE_PATH else sed -i "1s|.*|#!${RUBY_PATH}|" $BUNDLE_PATH fi # Remove additional lines added by RubyGems - if [ "${ImageOS}" == "macos13" ]; then + if [ "${ImageOS}" == "macos15" ]; then sed -i '' '/_=_\\/,/#!\/usr\/bin\/env ruby/d' $BUNDLE_PATH else sed -i '/_=_\\/,/#!\/usr\/bin\/env ruby/d' $BUNDLE_PATH diff --git a/docker-compose.deploy.yml b/docker-compose.deploy.yml index 7d39964e8..99578fc64 100644 --- a/docker-compose.deploy.yml +++ b/docker-compose.deploy.yml @@ -2,7 +2,7 @@ version: '3.4' services: db: - image: mongo:6.0.7 + image: mongo:8.0.12 ports: - "27017:27017" deploy: diff --git a/docker-compose.local.yml b/docker-compose.local.yml index 6454209b7..0cf792d27 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -3,7 +3,7 @@ version: '3.4' services: db: - image: mongo:6.0.7 + image: mongo:8.0.12 ports: - "27017:27017" volumes: diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 6fa214a01..1418b3845 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -3,7 +3,7 @@ version: '3.4' services: db: - image: mongo:6.0.7 + image: mongo:8.0.12 ports: - "27017:27017" environment: diff --git a/docker-compose.yml b/docker-compose.yml index ed400d615..2f19cd170 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3.4' services: db: - image: mongo:6.0.7 + image: mongo:8.0.12 ports: - "27017:27017" volumes: diff --git a/docker/deployment/scripts/deploy_docker_github_actions.sh b/docker/deployment/scripts/deploy_docker_github_actions.sh index f22a28a96..668bd88cb 100755 --- a/docker/deployment/scripts/deploy_docker_github_actions.sh +++ b/docker/deployment/scripts/deploy_docker_github_actions.sh @@ -14,8 +14,8 @@ elif [ "${GITHUB_REF}" == "refs/heads/master" ]; then # Currently setting this to setup_github_actions to test upload. elif [ "${GITHUB_REF}" == "refs/heads/setup_github_actions" ]; then IMAGETAG=experimental -elif [ "${GITHUB_REF}" == "refs/heads/custom_gems" ]; then - IMAGETAG="3.10.0" +elif [ "${GITHUB_REF}" == "refs/heads/3.11.0" ]; then + IMAGETAG="3.11.0-rc2" fi if [ "${IMAGETAG}" != "skip" ]; then diff --git a/local_setup_scripts/nuke.sh b/local_setup_scripts/nuke.sh index e60d3c8c5..951b27e93 100755 --- a/local_setup_scripts/nuke.sh +++ b/local_setup_scripts/nuke.sh @@ -15,7 +15,7 @@ echo "pull images" docker pull registry:2.6 docker pull nrel/openstudio-server:$1 docker pull nrel/openstudio-rserve:$1 -docker pull mongo:6.0.7 +docker pull mongo:8.0.12 docker pull redis:6.0.9 echo "create registry" @@ -26,7 +26,7 @@ sleep 10 echo "tag" docker tag nrel/openstudio-server:$1 127.0.0.1:5000/openstudio-server docker tag nrel/openstudio-rserve:$1 127.0.0.1:5000/openstudio-rserve -docker tag mongo:6.0.7 127.0.0.1:5000/mongo +docker tag mongo:8.0.12 127.0.0.1:5000/mongo docker tag redis:6.0.9 127.0.0.1:5000/redis sleep 3 echo "push" diff --git a/local_setup_scripts/rebuild_sr.sh b/local_setup_scripts/rebuild_sr.sh index 92fc768c0..512000d11 100755 --- a/local_setup_scripts/rebuild_sr.sh +++ b/local_setup_scripts/rebuild_sr.sh @@ -6,14 +6,14 @@ sleep 5 docker volume rm -f osdata || true docker volume rm -f dbdata || true docker image rm 127.0.0.1:5000/openstudio-server -f -docker build . -t="127.0.0.1:5000/openstudio-server" --build-arg OPENSTUDIO_VERSION=3.9.0 +docker build . -t="127.0.0.1:5000/openstudio-server" --build-arg OPENSTUDIO_VERSION=3.11.0 docker push 127.0.0.1:5000/openstudio-server cd docker/R/ #docker image rm 127.0.0.1:5000/openstudio-rserve -f docker build . -t="127.0.0.1:5000/openstudio-rserve" docker push 127.0.0.1:5000/openstudio-rserve -docker pull mongo:6.0.7 -docker tag mongo:6.0.7 127.0.0.1:5000/mongo +docker pull mongo:8.0.12 +docker tag mongo:8.0.12 127.0.0.1:5000/mongo docker push 127.0.0.1:5000/mongo docker pull redis:6.0.9 docker tag redis:6.0.9 127.0.0.1:5000/redis diff --git a/local_setup_scripts/win64/docker-compose-amd64.yml b/local_setup_scripts/win64/docker-compose-amd64.yml index 087aba1fd..18cccfb7d 100644 --- a/local_setup_scripts/win64/docker-compose-amd64.yml +++ b/local_setup_scripts/win64/docker-compose-amd64.yml @@ -2,7 +2,7 @@ version: '3.4' services: db: platform: linux/arm64 - image: mongo:6.0.7 + image: mongo:8.0.12 ports: - "27017:27017" volumes: diff --git a/local_setup_scripts/win64/docker-compose-local.yml b/local_setup_scripts/win64/docker-compose-local.yml index 2b2311380..728ffeb4f 100644 --- a/local_setup_scripts/win64/docker-compose-local.yml +++ b/local_setup_scripts/win64/docker-compose-local.yml @@ -1,7 +1,7 @@ version: '3.4' services: db: - image: mongo:6.0.7 + image: mongo:8.0.12 ports: - "27017:27017" volumes: diff --git a/local_setup_scripts/win64/nuke.ps1 b/local_setup_scripts/win64/nuke.ps1 index 579c88068..68da6c382 100644 --- a/local_setup_scripts/win64/nuke.ps1 +++ b/local_setup_scripts/win64/nuke.ps1 @@ -15,7 +15,7 @@ echo "pull images" docker pull registry:2.6 docker pull nrel/openstudio-server:$Args docker pull nrel/openstudio-rserve:$Args -docker pull mongo:6.0.7 +docker pull mongo:8.0.12 docker pull redis:4.0.6 echo "create registry" @@ -26,7 +26,7 @@ sleep 10 echo "tag" docker tag nrel/openstudio-server:$Args 127.0.0.1:5000/openstudio-server docker tag nrel/openstudio-rserve:$Args 127.0.0.1:5000/openstudio-rserve -docker tag mongo:6.0.7 127.0.0.1:5000/mongo +docker tag mongo:8.0.12 127.0.0.1:5000/mongo docker tag redis:4.0.6 127.0.0.1:5000/redis sleep 3 echo "push" diff --git a/local_setup_scripts/win64/nuke.sh b/local_setup_scripts/win64/nuke.sh index b1d4b8eb8..e2923ae02 100644 --- a/local_setup_scripts/win64/nuke.sh +++ b/local_setup_scripts/win64/nuke.sh @@ -15,7 +15,7 @@ echo "pull images" docker pull registry:2.6 docker pull nrel/openstudio-server:$1 docker pull nrel/openstudio-rserve:$1 -docker pull mongo:6.0.7 +docker pull mongo:8.0.12 docker pull redis:6.0.9 echo "create registry" @@ -26,7 +26,7 @@ sleep 10 echo "tag" docker tag nrel/openstudio-server:$1 127.0.0.1:5000/openstudio-server docker tag nrel/openstudio-rserve:$1 127.0.0.1:5000/openstudio-rserve -docker tag mongo:6.0.7 127.0.0.1:5000/mongo +docker tag mongo:8.0.12 127.0.0.1:5000/mongo docker tag redis:6.0.9 127.0.0.1:5000/redis sleep 3 echo "push" diff --git a/local_setup_scripts/win64/rebuild_sr.sh b/local_setup_scripts/win64/rebuild_sr.sh index 04ea860af..3368efd81 100644 --- a/local_setup_scripts/win64/rebuild_sr.sh +++ b/local_setup_scripts/win64/rebuild_sr.sh @@ -6,14 +6,14 @@ sleep 5 docker volume rm -f osdata || true docker volume rm -f dbdata || true docker image rm 127.0.0.1:5000/openstudio-server -f -docker build . -t="127.0.0.1:5000/openstudio-server" --build-arg OPENSTUDIO_VERSION=3.9.0 +docker build . -t="127.0.0.1:5000/openstudio-server" --build-arg OPENSTUDIO_VERSION=3.11.0 docker push 127.0.0.1:5000/openstudio-server cd docker/R docker image rm 127.0.0.1:5000/openstudio-rserve -f docker build --no-cache . -t="127.0.0.1:5000/openstudio-rserve" docker push 127.0.0.1:5000/openstudio-rserve -docker pull mongo:6.0.7 -docker tag mongo:6.0.7 127.0.0.1:5000/mongo +docker pull mongo:8.0.12 +docker tag mongo:8.0.12 127.0.0.1:5000/mongo docker push 127.0.0.1:5000/mongo docker pull redis:6.0.9 docker tag redis:6.0.9 127.0.0.1:5000/redis diff --git a/local_setup_scripts/win64/rebuild_sr_no_rm.sh b/local_setup_scripts/win64/rebuild_sr_no_rm.sh index 021821332..d66c48c7c 100644 --- a/local_setup_scripts/win64/rebuild_sr_no_rm.sh +++ b/local_setup_scripts/win64/rebuild_sr_no_rm.sh @@ -6,14 +6,14 @@ sleep 5 docker volume rm -f osdata || true docker volume rm -f dbdata || true #docker image rm 127.0.0.1:5000/openstudio-server -f -docker build . -t="127.0.0.1:5000/openstudio-server" --build-arg OPENSTUDIO_VERSION=3.10.0 +docker build . -t="127.0.0.1:5000/openstudio-server" --build-arg OPENSTUDIO_VERSION=3.11.0 docker push 127.0.0.1:5000/openstudio-server cd docker/R #docker image rm 127.0.0.1:5000/openstudio-rserve -f -docker build . -t="127.0.0.1:5000/openstudio-rserve" +#docker build . -t="127.0.0.1:5000/openstudio-rserve" docker push 127.0.0.1:5000/openstudio-rserve -docker pull mongo:6.0.7 -docker tag mongo:6.0.7 127.0.0.1:5000/mongo +docker pull mongo:8.0.12 +docker tag mongo:8.0.12 127.0.0.1:5000/mongo docker push 127.0.0.1:5000/mongo docker pull redis:6.0.9 docker tag redis:6.0.9 127.0.0.1:5000/redis diff --git a/local_setup_scripts/win64/rebuild_sr_no_rm_mock.sh b/local_setup_scripts/win64/rebuild_sr_no_rm_mock.sh index 001bd5d8f..3e1d24580 100644 --- a/local_setup_scripts/win64/rebuild_sr_no_rm_mock.sh +++ b/local_setup_scripts/win64/rebuild_sr_no_rm_mock.sh @@ -6,14 +6,14 @@ sleep 5 docker volume rm -f osdata || true docker volume rm -f dbdata || true #docker image rm 127.0.0.1:5000/openstudio-server -f -docker build . -t="127.0.0.1:5000/openstudio-server" --build-arg OPENSTUDIO_VERSION=3.9.0 +docker build . -t="127.0.0.1:5000/openstudio-server" --build-arg OPENSTUDIO_VERSION=3.11.0 docker push 127.0.0.1:5000/openstudio-server cd docker/R #docker image rm 127.0.0.1:5000/openstudio-rserve -f docker build . -t="127.0.0.1:5000/openstudio-rserve" docker push 127.0.0.1:5000/openstudio-rserve -docker pull mongo:6.0.7 -docker tag mongo:6.0.7 127.0.0.1:5000/mongo +docker pull mongo:8.0.12 +docker tag mongo:8.0.12 127.0.0.1:5000/mongo docker push 127.0.0.1:5000/mongo docker pull redis:6.0.9 docker tag redis:6.0.9 127.0.0.1:5000/redis diff --git a/server/app/lib/openstudio_server/version.rb b/server/app/lib/openstudio_server/version.rb index b1e85552a..1cf4e7a85 100644 --- a/server/app/lib/openstudio_server/version.rb +++ b/server/app/lib/openstudio_server/version.rb @@ -4,9 +4,9 @@ # ******************************************************************************* module OpenstudioServer - Version = '3.10.0'.freeze + Version = '3.11.0'.freeze # format should be ^.*\-{1}[a-z]+[0-9]+ # for example: -rc1, -beta6, -customusecase0 VERSION_EXT = ''.freeze # with preceding - or + - OS_SHA = '86d7e215a1'.freeze + OS_SHA = '241b8abb4d'.freeze end diff --git a/server/spec/features/docker_stack_algo_spec.rb b/server/spec/features/docker_stack_algo_spec.rb index 313252d40..af7f2cf8c 100644 --- a/server/spec/features/docker_stack_algo_spec.rb +++ b/server/spec/features/docker_stack_algo_spec.rb @@ -85,7 +85,27 @@ { electricity_consumption_cvrmse: 82.37755811, electricity_consumption_nmbe: -85.31078152, natural_gas_consumption_cvrmse: 42.71464426, - natural_gas_consumption_nmbe: 20.40156665} + natural_gas_consumption_nmbe: 20.40156665}, + { electricity_consumption_cvrmse: 81.90108, + electricity_consumption_nmbe: -84.84103, + natural_gas_consumption_cvrmse: 42.71462, + natural_gas_consumption_nmbe: 20.40144}, + { electricity_consumption_cvrmse: 20.71476, + electricity_consumption_nmbe: 19.88581, + natural_gas_consumption_cvrmse: 75.7458, + natural_gas_consumption_nmbe: 50.5476}, + { electricity_consumption_cvrmse: 22.2990, + electricity_consumption_nmbe: 21.6438, + natural_gas_consumption_cvrmse: 82.6236, + natural_gas_consumption_nmbe: 56.3145}, + { electricity_consumption_cvrmse: 26.5618, + electricity_consumption_nmbe: 25.9638, + natural_gas_consumption_cvrmse: 77.9849, + natural_gas_consumption_nmbe: 52.2796}, + { electricity_consumption_cvrmse: 22.299, + electricity_consumption_nmbe: 21.6438, + natural_gas_consumption_cvrmse: 82.6236, + natural_gas_consumption_nmbe: 56.3145} ] # setup bad results nsga_nrel_bad = [ @@ -195,11 +215,11 @@ expect(results).not_to be_nil sim = results.slice(:electricity_consumption_cvrmse, :electricity_consumption_nmbe, :natural_gas_consumption_cvrmse, :natural_gas_consumption_nmbe) expect(sim.size).to eq(4) - sim = sim.transform_values { |x| x.truncate(4) } + sim = sim.transform_values { |x| x.truncate(2) } puts "nsga sim: #{sim}" tmp = [] nsga_nrel.each do |x| - tmp << x.transform_values { |y| y.truncate(4) } + tmp << x.transform_values { |y| y.truncate(2) } end compare = tmp.include?(sim) expect(compare).to be true @@ -233,7 +253,15 @@ { electricity_consumption_cvrmse: 20.4095724, electricity_consumption_nmbe: 19.59546222, natural_gas_consumption_cvrmse: 75.7459088, - natural_gas_consumption_nmbe: 50.54773457} + natural_gas_consumption_nmbe: 50.54773457}, + { electricity_consumption_cvrmse: 81.90108, + electricity_consumption_nmbe: -84.84103, + natural_gas_consumption_cvrmse: 42.71462, + natural_gas_consumption_nmbe: 20.40145}, + { electricity_consumption_cvrmse: 20.71476, + electricity_consumption_nmbe: 19.88581, + natural_gas_consumption_cvrmse: 75.7459, + natural_gas_consumption_nmbe: 50.54764} ] # setup bad results spea_nrel_bad = [ @@ -336,11 +364,11 @@ expect(results).not_to be_nil sim = results.slice(:electricity_consumption_cvrmse, :electricity_consumption_nmbe, :natural_gas_consumption_cvrmse, :natural_gas_consumption_nmbe) expect(sim.size).to eq(4) - sim = sim.transform_values { |x| x.truncate(4) } + sim = sim.transform_values { |x| x.truncate(2) } puts "spea sim: #{sim}" tmp = [] spea_nrel.each do |x| - tmp << x.transform_values { |y| y.truncate(4) } + tmp << x.transform_values { |y| y.truncate(2) } end compare = tmp.include?(sim) expect(compare).to be true @@ -374,7 +402,15 @@ { electricity_consumption_cvrmse: 43.65784398, electricity_consumption_nmbe: -44.63306507, natural_gas_consumption_cvrmse: 108.1024748, - natural_gas_consumption_nmbe: 77.35386732} + natural_gas_consumption_nmbe: 77.35386732}, + { electricity_consumption_cvrmse: 43.3395, + electricity_consumption_nmbe: -44.2872, + natural_gas_consumption_cvrmse: 108.1024, + natural_gas_consumption_nmbe: 77.3537}, + { electricity_consumption_cvrmse: 8.1241, + electricity_consumption_nmbe: 5.1842, + natural_gas_consumption_cvrmse: 65.8426, + natural_gas_consumption_nmbe: -50.774} ] # setup bad results pso_bad = [ @@ -477,11 +513,11 @@ expect(results).not_to be_nil sim = results.slice(:electricity_consumption_cvrmse, :electricity_consumption_nmbe, :natural_gas_consumption_cvrmse, :natural_gas_consumption_nmbe) expect(sim.size).to eq(4) - sim = sim.transform_values { |x| x.truncate(4) } + sim = sim.transform_values { |x| x.truncate(2) } puts "pso sim: #{sim}" tmp = [] pso.each do |x| - tmp << x.transform_values { |y| y.truncate(4) } + tmp << x.transform_values { |y| y.truncate(2) } end compare = tmp.include?(sim) expect(compare).to be true @@ -515,7 +551,15 @@ { electricity_consumption_cvrmse: 74.0101483, electricity_consumption_nmbe: -76.73841103, natural_gas_consumption_cvrmse: 48.06306663, - natural_gas_consumption_nmbe: -31.81675554} + natural_gas_consumption_nmbe: -31.81675554}, + { electricity_consumption_cvrmse: 73.6119, + electricity_consumption_nmbe: -76.3356, + natural_gas_consumption_cvrmse: 48.0631, + natural_gas_consumption_nmbe: -31.8168}, + { electricity_consumption_cvrmse: 35.5075, + electricity_consumption_nmbe: -36.1134, + natural_gas_consumption_cvrmse: 50.7971, + natural_gas_consumption_nmbe: 27.7558} ] # setup bad results @@ -619,11 +663,11 @@ expect(results).not_to be_nil sim = results.slice(:electricity_consumption_cvrmse, :electricity_consumption_nmbe, :natural_gas_consumption_cvrmse, :natural_gas_consumption_nmbe) expect(sim.size).to eq(4) - sim = sim.transform_values { |x| x.truncate(4) } + sim = sim.transform_values { |x| x.truncate(2) } puts "rgenoud sim: #{sim}" tmp = [] rgenoud.each do |x| - tmp << x.transform_values { |y| y.truncate(4) } + tmp << x.transform_values { |y| y.truncate(2) } end compare = tmp.include?(sim) puts "data_point[:#{data_point[:_id]}] compare is: #{compare}" @@ -673,7 +717,35 @@ { electricity_consumption_cvrmse: 56.7527241, electricity_consumption_nmbe: -58.74745506, natural_gas_consumption_cvrmse: 108.2431218, - natural_gas_consumption_nmbe: -85.94476756} + natural_gas_consumption_nmbe: -85.94476756}, + { electricity_consumption_cvrmse: 56.5094, + electricity_consumption_nmbe: -58.4679, + natural_gas_consumption_cvrmse: 108.2432, + natural_gas_consumption_nmbe: -85.9452}, + { electricity_consumption_cvrmse: 18.7272, + electricity_consumption_nmbe: -17.4362, + natural_gas_consumption_cvrmse: 30.7881, + natural_gas_consumption_nmbe: -15.6659}, + { electricity_consumption_cvrmse: 16.9593, + electricity_consumption_nmbe: -15.2245, + natural_gas_consumption_cvrmse: 44.2129, + natural_gas_consumption_nmbe: 22.9883}, + { electricity_consumption_cvrmse: 54.5322, + electricity_consumption_nmbe: -56.3706, + natural_gas_consumption_cvrmse: 81.9336, + natural_gas_consumption_nmbe: -63.9426}, + { electricity_consumption_cvrmse: 23.1309, + electricity_consumption_nmbe: 21.8155, + natural_gas_consumption_cvrmse: 26.1923, + natural_gas_consumption_nmbe: -2.686}, + { electricity_consumption_cvrmse: 54.3109, + electricity_consumption_nmbe: -56.137, + natural_gas_consumption_cvrmse: 82.1264, + natural_gas_consumption_nmbe: -64.1142}, + { electricity_consumption_cvrmse: 16.9594, + electricity_consumption_nmbe: -15.2246, + natural_gas_consumption_cvrmse: 44.2130, + natural_gas_consumption_nmbe: 22.9883} ] # setup bad results @@ -777,11 +849,11 @@ expect(results).not_to be_nil sim = results.slice(:electricity_consumption_cvrmse, :electricity_consumption_nmbe, :natural_gas_consumption_cvrmse, :natural_gas_consumption_nmbe) expect(sim.size).to eq(4) - sim = sim.transform_values { |x| x.truncate(4) } + sim = sim.transform_values { |x| x.truncate(2) } puts "sobol sim: #{sim}" tmp = [] sobol.each do |x| - tmp << x.transform_values { |y| y.truncate(4) } + tmp << x.transform_values { |y| y.truncate(2) } end compare = tmp.include?(sim) expect(compare).to be true @@ -822,7 +894,20 @@ { electricity_consumption_cvrmse: 91.6123639683813, electricity_consumption_nmbe: -94.8704863220731, natural_gas_consumption_cvrmse: 42.93786686, - natural_gas_consumption_nmbe: -23.69726679} + natural_gas_consumption_nmbe: -23.69726679}, + { electricity_consumption_cvrmse: 25.858, + electricity_consumption_nmbe: 25.5224, + natural_gas_consumption_cvrmse: 112.9275, + natural_gas_consumption_nmbe: 80.5359}, + { electricity_consumption_cvrmse: 25.858, + electricity_consumption_nmbe: 25.5224, + natural_gas_consumption_cvrmse: 112.9275, + natural_gas_consumption_nmbe: 80.5359}, + {electricity_consumption_cvrmse: 91.0796, + electricity_consumption_nmbe: -94.3536, + natural_gas_consumption_cvrmse: 42.9378, + natural_gas_consumption_nmbe: -23.6972 + } ] # setup bad results @@ -930,11 +1015,11 @@ expect(results).not_to be_nil sim = results.slice(:electricity_consumption_cvrmse, :electricity_consumption_nmbe, :natural_gas_consumption_cvrmse, :natural_gas_consumption_nmbe) expect(sim.size).to eq(4) - sim = sim.transform_values { |x| x.truncate(4) } + sim = sim.transform_values { |x| x.truncate(2) } puts "lhs sim: #{sim}" tmp = [] lhs.each do |x| - tmp << x.transform_values { |y| y.truncate(4) } + tmp << x.transform_values { |y| y.truncate(2) } end compare = tmp.include?(sim) expect(compare).to be true @@ -972,7 +1057,19 @@ { electricity_consumption_cvrmse: 37.63173269, electricity_consumption_nmbe: -38.54754034, natural_gas_consumption_cvrmse: 150.9769767, - natural_gas_consumption_nmbe: -122.6180691} + natural_gas_consumption_nmbe: -122.6180691}, + { electricity_consumption_cvrmse: 37.7988, + electricity_consumption_nmbe: -38.6516, + natural_gas_consumption_cvrmse: 206.5584, + natural_gas_consumption_nmbe: -166.2207}, + { electricity_consumption_cvrmse: 37.4133, + electricity_consumption_nmbe: -38.2671, + natural_gas_consumption_cvrmse: 206.5789, + natural_gas_consumption_nmbe: -166.2341}, + {electricity_consumption_cvrmse: 37.4133, + electricity_consumption_nmbe: -38.2671, + natural_gas_consumption_cvrmse: 150.977, + natural_gas_consumption_nmbe: -122.6182} ] # setup bad results @@ -1081,11 +1178,11 @@ expect(results).not_to be_nil sim = results.slice(:electricity_consumption_cvrmse, :electricity_consumption_nmbe, :natural_gas_consumption_cvrmse, :natural_gas_consumption_nmbe) expect(sim.size).to eq(4) - sim = sim.transform_values { |x| x.truncate(4) } + sim = sim.transform_values { |x| x.truncate(2) } puts "lhs discrete sim: #{sim}" tmp = [] lhs.each do |x| - tmp << x.transform_values { |y| y.truncate(4) } + tmp << x.transform_values { |y| y.truncate(2) } end compare = tmp.include?(sim) expect(compare).to be true @@ -1123,7 +1220,19 @@ { electricity_consumption_cvrmse: 23.52940396, electricity_consumption_nmbe: 22.1736249, natural_gas_consumption_cvrmse: 136.7394956, - natural_gas_consumption_nmbe: -113.1026692} + natural_gas_consumption_nmbe: -113.1026692}, + { electricity_consumption_cvrmse: 87.2087, + electricity_consumption_nmbe: -90.6511, + natural_gas_consumption_cvrmse: 42.7852, + natural_gas_consumption_nmbe: -25.6421}, + { electricity_consumption_cvrmse: 89.5205, + electricity_consumption_nmbe: -93.1012, + natural_gas_consumption_cvrmse: 83.6153, + natural_gas_consumption_nmbe: -63.9489}, + {electricity_consumption_cvrmse: 23.7387, + electricity_consumption_nmbe: 22.3196, + natural_gas_consumption_cvrmse: 136.7395, + natural_gas_consumption_nmbe: -113.1027} ] # setup bad results @@ -1227,11 +1336,11 @@ expect(results).not_to be_nil sim = results.slice(:electricity_consumption_cvrmse, :electricity_consumption_nmbe, :natural_gas_consumption_cvrmse, :natural_gas_consumption_nmbe) expect(sim.size).to eq(4) - sim = sim.transform_values { |x| x.truncate(4) } + sim = sim.transform_values { |x| x.truncate(2) } puts "morris sim: #{sim}" tmp = [] morris.each do |x| - tmp << x.transform_values { |y| y.truncate(4) } + tmp << x.transform_values { |y| y.truncate(2) } end compare = tmp.include?(sim) expect(compare).to be true @@ -1265,10 +1374,22 @@ it 'run single_run analysis', :single_run, js: true do # setup expected results single_run = [ - { electricity_consumption_cvrmse: 34.8546004, - electricity_consumption_nmbe: -35.59102141, - natural_gas_consumption_cvrmse: 162.9418784, - natural_gas_consumption_nmbe: -130.5833959} + { electricity_consumption_cvrmse: 34.8546004, + electricity_consumption_nmbe: -35.59102141, + natural_gas_consumption_cvrmse: 162.9418784, + natural_gas_consumption_nmbe: -130.5833959}, + { electricity_consumption_cvrmse: 34.6405, + electricity_consumption_nmbe: -35.314, + natural_gas_consumption_cvrmse: 162.9419, + natural_gas_consumption_nmbe: -130.5835}, + { electricity_consumption_cvrmse: 34.6405, + electricity_consumption_nmbe: -35.314, + natural_gas_consumption_cvrmse: 162.9419, + natural_gas_consumption_nmbe: -130.5835}, + { electricity_consumption_cvrmse: 34.6405, + electricity_consumption_nmbe: -35.314, + natural_gas_consumption_cvrmse: 162.9419, + natural_gas_consumption_nmbe: -130.5835} ] # setup bad results single_run_bad = [ @@ -1371,11 +1492,11 @@ expect(results).not_to be_nil sim = results.slice(:electricity_consumption_cvrmse, :electricity_consumption_nmbe, :natural_gas_consumption_cvrmse, :natural_gas_consumption_nmbe) expect(sim.size).to eq(4) - sim = sim.transform_values { |x| x.truncate(4) } + sim = sim.transform_values { |x| x.truncate(2) } puts "single_run sim: #{sim}" tmp = [] single_run.each do |x| - tmp << x.transform_values { |y| y.truncate(4) } + tmp << x.transform_values { |y| y.truncate(2) } end compare = tmp.include?(sim) expect(compare).to be true diff --git a/server/spec/features/docker_stack_requeue_spec.rb b/server/spec/features/docker_stack_requeue_spec.rb index 7f21147b8..6b48f7fb3 100644 --- a/server/spec/features/docker_stack_requeue_spec.rb +++ b/server/spec/features/docker_stack_requeue_spec.rb @@ -75,40 +75,40 @@ def requeue_datapoint(job_args) end # setup expected results - lhs = [{electricity_consumption_cvrmse: 11.80643639, - electricity_consumption_nmbe: -9.992706452, + lhs = [{electricity_consumption_cvrmse: 11.67547, + electricity_consumption_nmbe: -9.67134, natural_gas_consumption_cvrmse: 88.97549886, - natural_gas_consumption_nmbe: -71.2422889 + natural_gas_consumption_nmbe: -71.2423 }, { - electricity_consumption_cvrmse: 22.26135019, - electricity_consumption_nmbe: 21.07474074, + electricity_consumption_cvrmse: 22.57385, + electricity_consumption_nmbe: 21.54758, natural_gas_consumption_cvrmse: 123.6693321, - natural_gas_consumption_nmbe: 89.28433483 + natural_gas_consumption_nmbe: 89.28405 }, { - electricity_consumption_cvrmse: 19.92877245, - electricity_consumption_nmbe: -19.20285379, - natural_gas_consumption_cvrmse: 81.09035156, - natural_gas_consumption_nmbe: -61.5710272 + electricity_consumption_cvrmse: 19.81253, + electricity_consumption_nmbe: -18.97733, + natural_gas_consumption_cvrmse: 81.09041, + natural_gas_consumption_nmbe: -61.5712 }, { - electricity_consumption_cvrmse: 41.31502887, - electricity_consumption_nmbe: -41.6127891, - natural_gas_consumption_cvrmse: 99.892904, - natural_gas_consumption_nmbe: 70.79385513 + electricity_consumption_cvrmse: 40.76865, + electricity_consumption_nmbe: -41.10892, + natural_gas_consumption_cvrmse: 99.89285, + natural_gas_consumption_nmbe: 70.79368 }, { - electricity_consumption_cvrmse: 55.38893763588019, - electricity_consumption_nmbe: -57.11056265094546, - natural_gas_consumption_cvrmse: 43.52243818, - natural_gas_consumption_nmbe: 22.80778241 + electricity_consumption_cvrmse: 55.14293, + electricity_consumption_nmbe: -56.83036, + natural_gas_consumption_cvrmse: 43.52242, + natural_gas_consumption_nmbe: 22.80775 }, { - electricity_consumption_cvrmse: 80.27419288, - electricity_consumption_nmbe: -83.30621751, - natural_gas_consumption_cvrmse: 69.47538644, - natural_gas_consumption_nmbe: -50.88411437 + electricity_consumption_cvrmse: 79.92222, + electricity_consumption_nmbe: -82.94121, + natural_gas_consumption_cvrmse: 69.4762, + natural_gas_consumption_nmbe: -50.88541 }] # setup bad results @@ -228,11 +228,11 @@ def requeue_datapoint(job_args) expect(results).not_to be_nil sim = results.slice(:electricity_consumption_cvrmse, :electricity_consumption_nmbe, :natural_gas_consumption_cvrmse, :natural_gas_consumption_nmbe) expect(sim.size).to eq(4) - sim = sim.transform_values { |x| x.truncate(4) } + sim = sim.transform_values { |x| x.truncate(2) } puts "lhs sim: #{sim}" tmp = [] lhs.each do |x| - tmp << x.transform_values { |y| y.truncate(4) } + tmp << x.transform_values { |y| y.truncate(2) } end compare = tmp.include?(sim) puts "data_point[:#{data_point[:_id]}] sim is: #{sim}" @@ -278,22 +278,22 @@ def requeue_datapoint(job_args) end # setup expected results - lhs = [{electricity_consumption_cvrmse: 45.748727859310684, - electricity_consumption_nmbe: -47.15331592, - natural_gas_consumption_cvrmse: 93.87522319797985, - natural_gas_consumption_nmbe: -76.99356458 + lhs = [{electricity_consumption_cvrmse: 45.33524, + electricity_consumption_nmbe: -46.72575, + natural_gas_consumption_cvrmse: 93.87523, + natural_gas_consumption_nmbe: -76.99358 }, { - electricity_consumption_cvrmse: 36.992082716685594, - electricity_consumption_nmbe: 36.75558058301333, - natural_gas_consumption_cvrmse: 26.054394017956753, - natural_gas_consumption_nmbe: -1.974857387 + electricity_consumption_cvrmse: 37.1028, + electricity_consumption_nmbe: 36.83981, + natural_gas_consumption_cvrmse: 26.05441, + natural_gas_consumption_nmbe: -1.97495 }, { - electricity_consumption_cvrmse: 88.15691010253096, - electricity_consumption_nmbe: -90.09381264, - natural_gas_consumption_cvrmse: 59.5879904, - natural_gas_consumption_nmbe: 37.55474192165185 + electricity_consumption_cvrmse: 87.31084, + electricity_consumption_nmbe: -89.3516, + natural_gas_consumption_cvrmse: 59.58792, + natural_gas_consumption_nmbe: 37.55463 }] # setup bad results @@ -386,11 +386,11 @@ def requeue_datapoint(job_args) expect(results).not_to be_nil sim = results.slice(:electricity_consumption_cvrmse, :electricity_consumption_nmbe, :natural_gas_consumption_cvrmse, :natural_gas_consumption_nmbe) expect(sim.size).to eq(4) - sim = sim.transform_values { |x| x.truncate(4) } + sim = sim.transform_values { |x| x.truncate(2) } puts "lhs sim: #{sim}" tmp = [] lhs.each do |x| - tmp << x.transform_values { |y| y.truncate(4) } + tmp << x.transform_values { |y| y.truncate(2) } end compare = tmp.include?(sim) expect(compare).to be true