Skip to content

Commit

Permalink
Merge pull request #510 from ORNL-AMO/develop
Browse files Browse the repository at this point in the history
Update Master with latest from develop
  • Loading branch information
gaccawi authored Jun 11, 2020
2 parents 89935fb + 2bea7d3 commit 4f279c5
Show file tree
Hide file tree
Showing 47 changed files with 5,904 additions and 131 deletions.
80 changes: 52 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,59 @@
language: cpp
if: tag IS blank

os:
- linux
- osx
language: node_js
node_js:
- 12.8.0

compiler:
- gcc
# - clang

matrix:
include:
- name: Linux Build
os: linux
- name: Mac Build
os: osx
- name: Windows Build
os: windows

before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update;
brew install doxygen;
nvm install 12.8.0;
nvm use 12.8.0;

else
sudo apt-get update;
sudo apt-get install doxygen;
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -;
sudo apt-get install -y nodejs;
fi

install: travis_retry npm install

script:
- chmod 777 travis_scripts/*
- export PRODUCTION="master"
- travis_retry ./travis_scripts/before_install.sh
- node --version
- cmake ./
- make
- ./bin/amo_tools_suite_tests
- npm install
- npm run test
- npm run at
- doxygen Doxyfile.in
install:
- travis_retry npm install
script:
- ./travis_scripts/build_test.sh
- ls -a
- echo "Building and testing complete"
#- ls -a Release/
before_deploy:
#function keep_alive() {
# while true; do
# echo -en "\a"
# sleep 5
# done
#}
#keep_alive &
- export TRAVIS_TAG="release_draft"
deploy:
provider: releases
api_key:
secure: ae/L9wH/mRCWvMQVwoY1qiTT510I/mcbS+OPwBMRtRvP1Svg3klkd7eDxnurIh6bdTgqNdc/Bu1AHXS0xK9pJ27hsJdFsnFaLGZ5kzj4dcH47G9pigEbPKUBHkQzZxn/KikYBvY2M8K+AA39w1In1+V8BE2YPZQYEHwL2g9i0wwqI6xgWl5eUgP1r3Z9+0SNYcWhUsYyx3sYGLwa3E6Sr+/JEHre+qLzHqrdB0PZygxKmjRTeksr3i/tYlAIYaDVXL/xbfewxSuSDYgnz6js5HqdUlpmSDH+aEgPcUopuQOH8utYMBfjKZYpbH3XqcFyPTCQHiJ28FRAi3PnvCZSqdyIkuX6e32GFULbAjJCYpY+pB7Tp89W+/rzOMzZ/H63fDtekfTH+6Q5aDc3WJx1ENh+U7WYHFKu4/qVwDwNfenmUpHR/CGJ/29Waw5+lNVb8RaGl9kiztBOsNAmcsK+qxHPwzIwM/lzlg0fksjoQJ+reNkPJwSpJg6Sn3VvsSKmRGb49qqToYzMsTW4pKhjtyDzaP0g+GxMl/a71KqP9lAxGf9/Auwh1zlp2TsZDOFxLLDFuT24GGto+btdF1TjvzIuym/qwkHac+EPCVm0qGG4+TwSJih7yBd5FL0RNR0VwJW3UQY2PDhv//IvpVF/Pmz8lJJ6AgsUumtYU5bnw+U=
file:
- "amo_tools_suite--Linux-x86_64.sh"
- "amo_tools_suite--Linux-x86_64.tar.gz"
- "amo_tools_suite--Darwin-x86_64.sh"
- "amo_tools_suite--Darwin-x86_64.tar.gz"
- "amo_tools_suite--Windows-i386.exe"
overwrite: true
skip_cleanup: true
draft: true
name: "RELEASE DRAFT"
#tag_name: "release_draft"
on:
repo: ORNL-AMO/AMO-Tools-Suite
branch: master
#condition: type = push AND branch = master
#tags: false
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ set(SOURCE_FILES
src/calculator/util/NaturalGasReduction.cpp
src/calculator/util/CompressedAirReduction.cpp
src/calculator/util/CompressedAirPressureReduction.cpp
src/calculator/util/CompressedAirLeakSurvey.cpp
src/calculator/util/WaterReduction.cpp
src/calculator/util/insulation/pipes/InsulatedPipeInput.cpp
src/calculator/util/insulation/pipes/InsulatedPipeCalculator.cpp
Expand All @@ -194,7 +195,10 @@ set(SOURCE_FILES
src/calculator/util/insulation/services/RayleighNumber.cpp
src/calculator/util/insulation/services/ReynoldsNumber.cpp
src/calculator/util/insulation/services/ThermalResistance.cpp
src/calculator/util/SteamReduction.cpp)
src/calculator/util/SteamReduction.cpp
src/calculator/pump/PumpData.cpp
src/calculator/motor/MotorData.cpp
src/chillers/CoolingTower.cpp)

set(INCLUDE_FILES
include/results/Results.h
Expand Down Expand Up @@ -350,6 +354,7 @@ set(INCLUDE_FILES
include/calculator/util/ElectricityReduction.h
include/calculator/util/NaturalGasReduction.h
include/calculator/util/CompressedAirReduction.h
include/calculator/util/CompressedAirLeakSurvey.h
include/calculator/util/CompressedAirPressureReduction.h
include/calculator/util/WaterReduction.h
include/calculator/util/insulation/pipes/InsulatedPipeInput.h
Expand All @@ -372,8 +377,15 @@ set(INCLUDE_FILES
include/fans/FanEnergyIndex.h
include/fans/OptimalFanEfficiency.h
include/ssmt/HeatExchanger.h
include/calculator/pump/PumpData.h
include/sqlite/PumpData.h
include/calculator/motor/MotorData.h
include/sqlite/MotorData.h
include/chillers/CoolingTower.h
)

# Pending: PumpData calculator unit test

set(TEST_FILES
tests/OptimalSpecificSpeedCorrection.unit.cpp
tests/MotorEfficiency.unit.cpp
Expand Down Expand Up @@ -402,6 +414,7 @@ set(TEST_FILES
tests/ElectricityReduction.unit.cpp
tests/NaturalGasReduction.unit.cpp
tests/CompressedAirReduction.unit.cpp
tests/CompressedAirLeakSurvey.unit.cpp
tests/CompressedAirPressureReduction.unit.cpp
tests/WaterReduction.unit.cpp
tests/InsulatedPipeReduction.unit.cpp
Expand Down Expand Up @@ -434,7 +447,8 @@ set(TEST_FILES
tests/steamapi/HeaderInput.unit.cpp
tests/steamapi/OperationsInput.unit.cpp
tests/steamapi/SteamModeler.unit.cpp
tests/steamapi/TurbineInput.unit.cpp)
tests/steamapi/TurbineInput.unit.cpp
tests/CoolingTower.unit.cpp)

#find_package(PythonInterp 2.7 REQUIRED)
#execute_process( COMMAND ${PYTHON_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/seed_database.py" "${CMAKE_DATABASE_OUTPUT_DIRECTORY}/amo_tools_suite.db")
Expand Down
Empty file added Docker/.git_keep
Empty file.
148 changes: 148 additions & 0 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
FROM ubuntu:18.04

WORKDIR /home/

RUN apt -y update
RUN apt -y upgrade

# Install gcc
RUN apt -y install build-essential
RUN apt-get -y install manpages-dev
RUN gcc --version

# Install Python
RUN apt-get -y install python
RUN python --version

# Install curl
RUN apt -y install curl

# Install cmake
RUN apt -y install cmake
RUN cmake --version

# Install ccmake
RUN apt -y install cmake-curses-gui
RUN ccmake --version

# Install Doxygen
RUN apt -y install doxygen
RUN doxygen --version

# --------------------------------------------------------------------------------------------

# Install nvm, node and npm
#RUN touch ~/.bash_profile
#RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
# replace shell with bash so we can source files
#RUN rm /bin/sh && ln -s /bin/bash /bin/sh
#RUN source ~/.nvm/nvm.sh \ nvm --version
#RUN export NVM_DIR="$HOME/.nvm"
#RUN [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#RUN [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
#RUN nvm --version



# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

# update the repository sources list
# and install dependencies
RUN apt-get update \
&& apt-get install -y curl \
&& apt-get -y autoclean

# nvm environment variables
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 12.8.0

# install nvm
# https://github.com/creationix/nvm#install-script
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash

# install node and npm
RUN source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default

# add node and npm to path so the commands are available
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH

# confirm installation
RUN node -v
RUN npm -v
# ---------------------------------------------------------------------------------------------

# ---------------------------------------------------------------------------------------------
# This section is currently inactive

# Install node.js and npm (https://github.com/nodesource/distributions/blob/master/README.md)
#RUN nvm install node
#RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
#RUN apt-get install -y nodejs
#RUN node --version
#RUN npm --version

# Install npm
#RUN apt -y install npm
#RUN npm --version
# ---------------------------------------------------------------------------------------------

# Install gyp
RUN npm install -g node-gyp@4.0.0
RUN node-gyp -v


# Add AMO-Tools-Suite
RUN mkdir AMO
RUN mkdir AMO/AMO-Tools-Suite
# Inside AMO-Tools-Suite directory
ADD . /home/AMO/AMO-Tools-Suite/


#RUN touch package.json
WORKDIR /home/AMO/AMO-Tools-Suite/

# Install Node Tap (test suite)
# @12.6.0, --save-dev
RUN npm install tap@12.6.0 --save-dev
#RUN apt -y install node-tap
#RUN tap --version

WORKDIR /home/

# Install emacs
#RUN apt-get -y install emacs
#RUN emacs --version

# Install sqlite3
RUN apt-get install sqlite3 libsqlite3-dev
RUN sqlite3 --version


# Commands to run for building/testing/running AMO-Tools-Suite
# -------------------------------------------------------------
WORKDIR /home/AMO/AMO-Tools-Suite/

RUN cmake -D BUILD_TESTING:BOOL=ON -D BUILD_PACKAGE:BOOL=OFF --config Debug ./

RUN cmake --build .

RUN ./bin/amo_tools_suite_tests

RUN npm install

RUN node-gyp rebuild

RUN npm run test

RUN npm run at

RUN doxygen Doxyfile.in
#RUN cat debug.txt
#--------------------------------------------------------------

#WORKDIR /home/
43 changes: 43 additions & 0 deletions Docker/docker_commands.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
docker image build -f Docker/Dockerfile -t comma64/ornl:amo-tools-suite .
docker run -t -d --name amo-suite comma64/ornl:amo-tools-suite

# Mount a host directory to persist source code and builds
docker run -t -d -v "/home/81c/AMO/src:/home/AMO/src/" --name amo-suite comma64/ornl:amo-tools-suite


docker exec -it amo-suite /bin/bash

docker container rm --force amo-suite
docker rmi comma64/ornl:amo-tools-suite

docker login
docker push comma64/ornl:amo-tools-suite

PowerShell (remove all images):
docker rmi $(docker images -q) --force

docker stop $(docker ps -aq) 2>/dev/null || true
docker rm $(docker ps -a -q) 2>/dev/null|| true
docker rmi $(docker images -q) 2>/dev/null || true
docker image prune -fa || sudo systemctl restart docker
docker system prune -fa || sudo systemctl restart docker


# Commands to run for building/testing/running AMO-Tools-Suite
# --------------------------------------------------------------

cmake -D BUILD_TESTING:BOOL=ON -D BUILD_PACKAGE:BOOL=OFF --config Debug ./
alternatively: ccmake .

cmake --build . --target amo_tools_suite_tests
alternatively: cmake --build .

./bin/amo_tools_suite_tests

npm install (OR (if necessary): npm install --unsafe-perm)
alternatively (if already installed): node-gyp rebuild

npm run test

npm run at
#--------------------------------------------------------------
2 changes: 1 addition & 1 deletion Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = AMO-Tools-Suite
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v.0.3.3
PROJECT_NUMBER = v.0.7.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
Loading

0 comments on commit 4f279c5

Please sign in to comment.