Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 15 additions & 10 deletions .github/workflows/build_pat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- '*'
tags:
- '*'
- '*'

jobs:
pat_build:
Expand Down Expand Up @@ -39,10 +39,10 @@ jobs:


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -60,7 +60,7 @@ jobs:
sudo ./qtfiw_installer/QtInstallerFramework-macOS-x64-4.3.0.app/Contents/MacOS/QtInstallerFramework-macOS-x64-4.3.0 --verbose --script ./ci/install_script_qtifw.qs
ls ~/Qt/QtIFW-4.3.0 || true
echo "~/Qt/QtIFW-4.3.0/bin/" >> $GITHUB_PATH
echo MACOSX_DEPLOYMENT_TARGET=${{ matrix.MACOSX_DEPLOYMENT_TARGET }} >> $GITHUB_ENV
echo MACOSX_DEPLOYMENT_TARGET=${{ matrix.MACOSX_DEPLOYMENT_TARGET }} >> $GITHUB_ENV
# echo CMAKE_MACOSX_DEPLOYMENT_TARGET='-DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET' >> $GITHUB_ENV
elif [ "$RUNNER_OS" == "Windows" ]; then
curl -L -O https://download.qt.io/archive/qt-installer-framework/4.3.0/QtInstallerFramework-windows-x86-4.3.0.exe
Expand All @@ -71,7 +71,7 @@ jobs:
#echo CMAKE_GENERATOR='Visual Studio 16 2019' >> $GITHUB_ENV
#echo CMAKE_GENERATOR_PLATFORM=x64 >> $GITHUB_ENV
# C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
# Command below no longer working and returning the version number.
# Command below no longer working and returning the version number.
# MSVC_DIR=$(cmd.exe /c "vswhere -products * -requires Microsoft.Component.MSBuild -property installationPath -latest")
MSVC_DIR="C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
echo "Latest is: $MSVC_DIR"
Expand All @@ -80,6 +80,10 @@ jobs:
echo "$MSVC_DIR\VC\Auxiliary\Build" >> $GITHUB_PATH
fi;

N=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu)
echo "There are $N threads available"
echo "N=$N" >> $GITHUB_ENV

- name: Create Build Directory
run: cmake -E make_directory ./build/

Expand All @@ -92,8 +96,8 @@ jobs:
echo "Using vcvarsall to initialize the development environment"
call vcvarsall.bat x64
cmake -G "Visual Studio 17 2022" -A x64 ..
cmake --build . --target package -j 2 --config Release
cmake --build . --target package -j ${{ env.N }} --config Release

- name: Configure CMake & build (Linux)
working-directory: ./build
if: runner.os == 'Linux'
Expand All @@ -108,7 +112,7 @@ jobs:
-DCPACK_BINARY_STGZ=OFF \
-DCPACK_BINARY_TBZ2=OFF \
../
cmake --build . --target package -j 2
cmake --build . --target package -j $N

- name: Configure CMake & build (macOS)
working-directory: ./build
Expand All @@ -120,12 +124,13 @@ jobs:
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_BUILD_TYPE=Release \
../
cmake --build . --target package -j 2
cmake --build . --target package -j $N

- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: PAT-Installer-${{ matrix.name }}
path: ./build/ParametricAnalysisTool-*
#name: OpenStudio-PAT-{{ matrix.name }}-${{ github.sha }}



10 changes: 5 additions & 5 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on:
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 17
cache: npm
Expand All @@ -23,7 +23,7 @@ jobs:
run: npm ci
- name: Cache runtime dependencies
id: cache-runtime-deps
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: depend/
key: ${{ runner.os }}-${{ hashFiles('manifest.json') }}
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Prepare tmp test files
run: npm run test:tmpFiles
- name: Run playwright tests
uses: GabrielBB/xvfb-action@v1
uses: coactions/setup-xvfb@v1
with:
run: |
npm run test:parallel
Expand Down
77 changes: 36 additions & 41 deletions app/app/main/measureManagerService.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@

startMeasureManager() {
const vm = this;

// find an open port
portfinder.getPortPromise({
port: 3100,
Expand All @@ -70,67 +69,61 @@
vm.port = port;
vm.$log.info('Measure Manager port: ', vm.port);

vm.$log.info('Start Measure Manager Server: ', vm.cliPath, ' measure -s ', vm.port);
vm.cli = vm.spawn(vm.cliPath, ['classic', 'measure', '-s', vm.port]);
vm.$log.info('Start Measure Manager Server: ', vm.cliPath, 'measure -s ', vm.port);
vm.cli = vm.spawn(vm.cliPath, ['measure', '-s', vm.port], { cwd: '.', stdio : 'pipe' });
Comment on lines +72 to +73
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether the { cwd: '.', stdio : 'pipe' } is needed, it was in #267

vm.cli.stdout.on('data', (data) => {
// record errors
if (data.indexOf('<0>') !== -1) {
// WARNING
vm.$log.warn(`MeasureManager WARNING: ${data}`);
vm.Message.appendMeasureManagerError({type: 'warning', data: data.toString()});
} else if (data.indexOf('<1>') !== -1) {
// ERROR
vm.$log.error(`MeasureManager ERROR: ${data}`);
vm.Message.appendMeasureManagerError({type: 'error', data: data.toString()});
} else if(data.indexOf('<2>') !== -1) {
// ERROR
// FATAL
vm.$log.error(`MeasureManager ERROR: ${data}`);
vm.Message.appendMeasureManagerError({type: 'fatal', data: data.toString()});
} else {
if (vm.Message.showDebug()) {
vm.$log.debug(`MeasureManager: ${data}`);
}
}
else {
if (vm.Message.showDebug()) vm.$log.debug(`MeasureManager: ${data}`);
}

// check that the mm was started correctly: resolve readyDeferred
const str = data.toString();
if (str.indexOf('WEBrick::HTTPServer#start: pid=') !== -1) {
if (vm.Message.showDebug()) vm.$log.debug('Found WEBrick Start!, resolve promise');
vm.mmReadyDeferred.resolve();
}
// TODO: THIS IS TEMPORARY (windows):
else if (str.indexOf('Only one usage of each socket address') !== -1) {
if (vm.Message.showDebug()) vm.$log.debug('WEBrick already running...assuming MeasureManager is already up');
if ((str.indexOf('Accepting requests on:') !== -1) ||
(str.indexOf('MeasureManager Ready') !== -1)) {
vm.$log.info('Found MeasureManager Start, MeasureManager is running');
vm.mmReadyDeferred.resolve();
}
// TODO: THIS IS TEMPORARY (mac):
else if (str.indexOf('Error: Address already in use') !== -1) {
if (vm.Message.showDebug()) vm.$log.debug('WEBrick already running...assuming MeasureManager is already up');
vm.mmReadyDeferred.resolve();
}

});
vm.cli.stderr.on('data', (data) => {
vm.$log.info(`MeasureManager: ${data}`);
// check that the mm was started correctly: resolve readyDeferred
const str = data.toString();
if (str.indexOf('WEBrick::HTTPServer#start: pid=') !== -1) {
if (vm.Message.showDebug()) vm.$log.debug('Found WEBrick Start!, resolve promise');
vm.mmReadyDeferred.resolve();
}
// TODO: THIS IS TEMPORARY (windows):
else if (str.indexOf('Only one usage of each socket address') !== -1) {
if (vm.Message.showDebug()) vm.$log.debug('WEBrick already running...using tempMeasureManager');
vm.mmReadyDeferred.resolve();
}
// TODO: THIS IS TEMPORARY (mac):
else if (str.indexOf('Error: Address already in use') !== -1) {
if (vm.Message.showDebug()) vm.$log.debug('WEBrick already running...using tempMeasureManager');
vm.mmReadyDeferred.resolve();
}
// C++ CLI printing errors when requests fail on stderr, eg when post
// data is missing:
// [2024-11-14T13:32:17+01:00] "POST /compute_arguments HTTP/1.1" 400
vm.$log.error(`MeasureManager: ${data}`);
Comment on lines +102 to +105
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what's wanted here

});
vm.cli.on('error', (err) => {
console.log('Failed to start measure manager');
});
vm.cli.on('message', (msg) => {
console.log(`child message due to receipt of signal ${msg}`);
});

vm.cli.on('close', (code) => {
vm.$log.info(`Measure Manager exited with code ${code}`);
});
}).catch(() => vm.$log.error('Error locating an open port for measure manager.'));
vm.cli.on('exit', (code) => {
if (code !== 0) {
const msg = `Failed with code = ${code}`;
console.log(msg);
}
});

}).catch((err) => {
vm.$log.error('Error locating an open port for measure manager.');
});
Comment on lines +117 to +126
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kept from #267

}

stopMeasureManager() {
Expand Down Expand Up @@ -249,7 +242,6 @@

// reset MeasureManagerErrors when a new action
vm.Message.resetMeasureManagerErrors();

return vm.$http.post(`${vm.url}:${vm.port}/set`, params)
.then(res => {
vm.$log.info('Measure Manager setMyMeasuresDir Success!, status: ', res.status);
Expand Down Expand Up @@ -289,7 +281,10 @@
.then(res => {
vm.$log.info('Measure Manager download_bcl_measure Success!, status: ', res.status);
vm.$log.info('Data: ', res.data);
return res.data[0];
// Classic (Ruby) CLI uses to return a single-element list
// C++ CLI returns the element directly
//return res.data[0];
return res.data

Check failure on line 287 in app/app/main/measureManagerService.js

View workflow job for this annotation

GitHub Actions / Build Ubuntu

Missing semicolon

Check failure on line 287 in app/app/main/measureManagerService.js

View workflow job for this annotation

GitHub Actions / Build Ubuntu

Missing semicolon

Check failure on line 287 in app/app/main/measureManagerService.js

View workflow job for this annotation

GitHub Actions / test

Missing semicolon

Check failure on line 287 in app/app/main/measureManagerService.js

View workflow job for this annotation

GitHub Actions / test

Missing semicolon

Check failure on line 287 in app/app/main/measureManagerService.js

View workflow job for this annotation

GitHub Actions / Build Windows_2022

Missing semicolon

Check failure on line 287 in app/app/main/measureManagerService.js

View workflow job for this annotation

GitHub Actions / Build macOS

Missing semicolon

Check failure on line 287 in app/app/main/measureManagerService.js

View workflow job for this annotation

GitHub Actions / Build macOS

Missing semicolon

Check failure on line 287 in app/app/main/measureManagerService.js

View workflow job for this annotation

GitHub Actions / Build Windows_2022

Missing semicolon
})
.catch(res => {
vm.$log.error('Measure Manager download_bcl_measure Error: ', res.data);
Expand Down
2 changes: 1 addition & 1 deletion copyright.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OpenStudio
Copyright (c) 2008-2020, Alliance for Sustainable Energy
Copyright (c) 2008-2025, Alliance for Sustainable Energy
All Rights Reserved.


Expand Down
2 changes: 1 addition & 1 deletion license.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2008-2020, Alliance for Sustainable Energy.
Copyright (c) 2008-2025, Alliance for Sustainable Energy.
All rights reserved.

NOTICE
Expand Down
Loading