Skip to content

Commit

Permalink
Merge f97afe8 into a544c3b
Browse files Browse the repository at this point in the history
  • Loading branch information
anyaelena committed Jun 3, 2019
2 parents a544c3b + f97afe8 commit 9ff2baf
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 20 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rvm: 2.2.4
env:
global:
- USE_TESTING_TIMEOUTS: "true"
- OPENSTUDIO_VERSION=2.8.0 OPENSTUDIO_VERSION_SHA=55665635f0
- OPENSTUDIO_VERSION=2.8.1 OPENSTUDIO_VERSION_SHA=809785b98f OPENSTUDIO_VERSION_EXT=-rc1
- DOCKER_COMPOSE_VERSION=1.21.1

gemfile:
Expand Down Expand Up @@ -56,13 +56,14 @@ jobs:
- BUILD_TYPE=docker
before_script:
# remove the .git in the .dockerignore so coverage can be reported correctly to coveralls
- export OPENSTUDIO_TAG=$(ruby -e "load 'server/app/lib/openstudio_server/version.rb'; print OpenstudioServer::VERSION+OpenstudioServer::VERSION_EXT")
- sed -i -E "s/.git//g" .dockerignore
- docker volume create --name=osdata
- docker images --all
- docker --version
- docker-compose --version
- docker-compose -f docker-compose.test.yml pull
- docker-compose -f docker-compose.test.yml build
- docker-compose -f docker-compose.test.yml build --build-arg OPENSTUDIO_VERSION=$OPENSTUDIO_TAG
script:
- docker-compose -f docker-compose.test.yml run web && docker-compose stop
after_script:
Expand All @@ -80,11 +81,12 @@ jobs:
env:
- BUILD_TYPE=docker
before_script:
- export OPENSTUDIO_TAG=$(ruby -e "load 'server/app/lib/openstudio_server/version.rb'; print OpenstudioServer::VERSION+OpenstudioServer::VERSION_EXT")
- docker images --all
- docker --version
- docker-compose --version
- docker volume create --name=osdata
- docker-compose build web
- docker-compose build --build-arg OPENSTUDIO_VERSION=$OPENSTUDIO_TAG web
- docker-compose build rserve
script: ./docker/deployment/scripts/deploy_docker.sh

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# TO_BUILD_AND_RUN: docker-compose up
# NOTES: Currently this is one big dockerfile and non-optimal.


ARG OPENSTUDIO_VERSION=2.8.0
#may include suffix
ARG OPENSTUDIO_VERSION
FROM nrel/openstudio:$OPENSTUDIO_VERSION as base
MAINTAINER Nicholas Long nicholas.long@nrel.gov

Expand Down
5 changes: 3 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ version: 1.0.{build}-{branch}

environment:
USE_TESTING_TIMEOUTS: "true"
OPENSTUDIO_VERSION: 2.8.0
OPENSTUDIO_VERSION_SHA: 55665635f0
OPENSTUDIO_VERSION: 2.8.1
OPENSTUDIO_VERSION_SHA: 809785b98f
OPENSTUDIO_VERSION_EXT: -rc1
OPENSTUDIO_TEST_EXE: C:\projects\openstudio\bin\openstudio.exe


Expand Down
2 changes: 1 addition & 1 deletion bin/openstudio_meta
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class InstallGems
rake_bin = File.absolute_path('./../gems/bin/rake/')
sys_cmds = []

sys_cmds << "#{$ruby_path} #{RbConfig::CONFIG['prefix']}/bin/gem install --no-env-shebang bundler -v 1.14.4"
sys_cmds << "#{$ruby_path} #{RbConfig::CONFIG['prefix']}/bin/gem install --no-env-shebang bundler -v 1.17.1"
if /darwin/.match(RUBY_PLATFORM)
sys_cmds << "#{$ruby_path} #{bundler_bin} config build.nokogiri --use-system-libraries --with-xml2-lib=/usr/lib --with-xml2-include=/usr/include"
end
Expand Down
6 changes: 3 additions & 3 deletions ci/appveyor/setup.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set PATH=C:\Program Files\Git\mingw64\bin;C:\projects\openstudio\bin;%PATH%
echo Downloading and Installing OpenStudio (%OPENSTUDIO_VERSION%.%OPENSTUDIO_VERSION_SHA%)
curl -SLO --insecure https://s3.amazonaws.com/openstudio-builds/%OPENSTUDIO_VERSION%/OpenStudio-%OPENSTUDIO_VERSION%.%OPENSTUDIO_VERSION_SHA%-Windows.exe
OpenStudio-%OPENSTUDIO_VERSION%.%OPENSTUDIO_VERSION_SHA%-Windows.exe --script ci/appveyor/install-windows.qs
echo Downloading and Installing OpenStudio (%OPENSTUDIO_VERSION%%OPENSTUDIO_VERSION_EXT%.%OPENSTUDIO_VERSION_SHA%)
curl -SLO --insecure https://s3.amazonaws.com/openstudio-builds/%OPENSTUDIO_VERSION%/OpenStudio-%OPENSTUDIO_VERSION%%OPENSTUDIO_VERSION_EXT%.%OPENSTUDIO_VERSION_SHA%-Windows.exe
OpenStudio-%OPENSTUDIO_VERSION%%OPENSTUDIO_VERSION_EXT%.%OPENSTUDIO_VERSION_SHA%-Windows.exe --script ci/appveyor/install-windows.qs
move C:\openstudio C:\projects\openstudio
dir C:\projects\openstudio
dir C:\projects\openstudio\Ruby
Expand Down
7 changes: 4 additions & 3 deletions ci/travis/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ else
cp mongodb-osx-x86_64-3.4.18/bin/* /usr/local/bin/

# Install openstudio -- Use the install script that is in this repo now, the one on OpenStudio/develop has changed
curl -SLO --insecure https://s3.amazonaws.com/openstudio-builds/$OPENSTUDIO_VERSION/OpenStudio-$OPENSTUDIO_VERSION.$OPENSTUDIO_VERSION_SHA-Darwin.zip
unzip OpenStudio-$OPENSTUDIO_VERSION.$OPENSTUDIO_VERSION_SHA-Darwin.zip
curl -SLO --insecure https://s3.amazonaws.com/openstudio-builds/$OPENSTUDIO_VERSION/OpenStudio-$OPENSTUDIO_VERSION$OPENSTUDIO_VERSION_EXT.$OPENSTUDIO_VERSION_SHA-Darwin.zip
unzip OpenStudio-$OPENSTUDIO_VERSION$OPENSTUDIO_VERSION_EXT.$OPENSTUDIO_VERSION_SHA-Darwin.zip
sed -i -e "s|REPLACEME|$HOME/openstudio|" ci/travis/install-mac.qs
rm -rf $HOME/openstudio
# Will install into $HOME/openstudio and RUBYLIB will be $HOME/openstudio/Ruby
Expand All @@ -37,7 +37,8 @@ else
sudo apt-get update
sudo apt-get install -y pv tree
mkdir -p reports/rspec
sudo ./docker/deployment/scripts/install_openstudio.sh $OPENSTUDIO_VERSION $OPENSTUDIO_VERSION_SHA
# AP: this appears to only be used for Travis/Linux so we should move it out of the docker/deployment/scripts dir
sudo ./docker/deployment/scripts/install_openstudio.sh $OPENSTUDIO_VERSION $OPENSTUDIO_VERSION_SHA $OPENSTUDIO_VERSION_EXT
fi

ruby "${TRAVIS_BUILD_DIR}/bin/openstudio_meta" install_gems --with_test_develop --debug --verbose --use_cached_gems
Expand Down
2 changes: 1 addition & 1 deletion docker/deployment/scripts/deploy_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [ "${TRAVIS_BRANCH}" == "develop" ]; then
IMAGETAG=develop
elif [ "${TRAVIS_BRANCH}" == "nrcan-master" ]; then
# NRCAN is still using pre 2.4.1 version of Server. This will break when they upgrade.
IMAGETAG="$(ruby -e "load 'server/lib/openstudio_server/version.rb'; print OpenstudioServer::VERSION+OpenstudioServer::VERSION_EXT")-nrcan"
IMAGETAG="$(ruby -e "load 'server/lib/openstudio_server/version.rb'; print OpenstudioServer::VERSION")-nrcan"
elif [ "${TRAVIS_BRANCH}" == "master" ]; then
# Retrieve the version number from rails
IMAGETAG="$(ruby -e "load 'server/app/lib/openstudio_server/version.rb'; print OpenstudioServer::VERSION+OpenstudioServer::VERSION_EXT")"
Expand Down
9 changes: 6 additions & 3 deletions docker/deployment/scripts/install_openstudio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@

OPENSTUDIO_VERSION=$1
OPENSTUDIO_SHA=$2
OPENSTUDIO_VERSION_EXT=$3

if [ ! -z ${OPENSTUDIO_VERSION} ] && [ ! -z ${OPENSTUDIO_SHA} ]; then
echo "Installing OpenStudio ${OPENSTUDIO_VERSION}.${OPENSTUDIO_SHA}"
# OPENSTUDIO_VERSION_EXT may be empty
OPENSTUDIO_DOWNLOAD_FILENAME=OpenStudio-$OPENSTUDIO_VERSION$OPENSTUDIO_VERSION_EXT.$OPENSTUDIO_SHA-Linux.deb

echo "Installing OpenStudio ${OPENSTUDIO_DOWNLOAD_FILENAME}"

OPENSTUDIO_DOWNLOAD_BASE_URL=https://s3.amazonaws.com/openstudio-builds/$OPENSTUDIO_VERSION
OPENSTUDIO_DOWNLOAD_FILENAME=OpenStudio-$OPENSTUDIO_VERSION.$OPENSTUDIO_SHA-Linux.deb
OPENSTUDIO_DOWNLOAD_URL=$OPENSTUDIO_DOWNLOAD_BASE_URL/$OPENSTUDIO_DOWNLOAD_FILENAME

# Install gdebi, then download and install OpenStudio, then clean up.
Expand All @@ -29,6 +32,6 @@ if [ ! -z ${OPENSTUDIO_VERSION} ] && [ ! -z ${OPENSTUDIO_SHA} ]; then
&& rm -rf /usr/SketchUpPlugin \
&& rm -rf /var/lib/apt/lists/*
else
echo "Must pass in the OpenStudio version and sha to be installed (e.g. install_openstudio.sh 2.4.0 f58a3e1808)"
echo "Must pass in the OpenStudio version, and sha to be installed (e.g. install_openstudio.sh 2.4.0 f58a3e1808)"
exit 9
fi
5 changes: 3 additions & 2 deletions server/app/lib/openstudio_server/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
module OpenstudioServer
VERSION = '2.8.1'.freeze
# format should be ^.*\-{1}[a-z]+[0-9]+
# for example: -rc0, -beta6, -customusecase0
VERSION_EXT = '-rc0'.freeze # with preceding - or +
# for example: -rc1, -beta6, -customusecase0
VERSION_EXT = '-rc1'.freeze # with preceding - or +
OS_SHA = '809785b98f'
end
4 changes: 4 additions & 0 deletions server/spec/features/dj_run_simulation_data_point_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@
a = RestClient.get "http://#{host}/data_points/#{datapoint_id}.json"
a = JSON.parse(a, symbolize_names: true)
puts a

l = RestClient.get "http://#{host}/data_points/#{datapoint_id}/download_result_file?filename=#{datapoint_id}.log"
expect(l).to eq('hack to inspect oscli output')

expect(a[:data_point][:name]).to eq('Test Datapoint')
expect(a[:data_point][:status_message]).to eq('completed normal')
expect(a[:data_point][:status]).to eq('completed')
Expand Down
2 changes: 2 additions & 0 deletions spec/tests/openstudio_meta_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ class LocalRspecTest
end
end
data_points.each do |data_point|
l = RestClient.get "http://localhost:8080/data_points/#{data_point[:_id]}/download_result_file?filename=#{data_point[:_id]}.log"
expect(l).to eq('hack to view oscli output')
a = RestClient.get "http://localhost:8080/data_points/#{data_point[:_id]}.json"
a = JSON.parse(a, symbolize_names: true)
expect(a[:data_point][:status_message]).to eq('completed normal')
Expand Down

0 comments on commit 9ff2baf

Please sign in to comment.