diff --git a/.dockerignore b/.dockerignore index 3d20d3d39..2911ba7ac 100644 --- a/.dockerignore +++ b/.dockerignore @@ -9,5 +9,5 @@ vagrant /server/spec/runs.txt /server/spec/files/tmp/ /server/spec/files/test_model/tmp_run_single -/spec/unit-test +/spec /worker-nodes diff --git a/Dockerfile b/Dockerfile index 690f5c7c3..81f2d087e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,18 +3,11 @@ # TO_BUILD_AND_RUN: docker-compose up # NOTES: Currently this is one big dockerfile and non-optimal. -ARG OPENSTUDIO_VERSION=2.6.1 + +ARG OPENSTUDIO_VERSION=develop FROM nrel/openstudio:$OPENSTUDIO_VERSION as base MAINTAINER Nicholas Long nicholas.long@nrel.gov -#ARG not available after from, so we need to set this again. Maybe we should set as an ENV in the openstudio Docker container? -ARG OPENSTUDIO_VERSION=2.6.1 -# The OpenStudio Gemfile contains a fixed bundler version, so you have to install and run specific to that version -ARG OS_BUNDLER_VERSION=1.14.4 -RUN ruby -r openstudio -e "require 'openstudio'; puts OpenStudio.openStudioLongVersion" && \ - gem install bundler -v $OS_BUNDLER_VERSION && \ - bundle _${OS_BUNDLER_VERSION}_ install --gemfile=/usr/local/openstudio-${OPENSTUDIO_VERSION}/Ruby/Gemfile - # Install required libaries. # realpath - needed for wait-for-it RUN sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 && \ @@ -91,7 +84,7 @@ ENV RAILS_ENV $rails_env ADD /bin /opt/openstudio/bin ADD /server/Gemfile /opt/openstudio/server/Gemfile WORKDIR /opt/openstudio/server -RUN bundle install --jobs=3 --retry=3 $bundle_args +RUN bundle _${OS_BUNDLER_VERSION}_ install --jobs=3 --retry=3 $bundle_args # Add the app assets and precompile assets. Do it this way so that when the app changes the assets don't # have to be recompiled everytime diff --git a/docker/deployment/scripts/aws_osserver_init.sh b/docker/deployment/scripts/aws_osserver_init.sh index a03b21bd5..40e989639 100755 --- a/docker/deployment/scripts/aws_osserver_init.sh +++ b/docker/deployment/scripts/aws_osserver_init.sh @@ -78,4 +78,3 @@ echo "" sleep 1 docker volume create --name=osdata docker volume create --name=dbdata -sleep 1 \ No newline at end of file diff --git a/server/app/workers/run_simulate_data_point.rb b/server/app/workers/run_simulate_data_point.rb index b81a69824..541609f5e 100644 --- a/server/app/workers/run_simulate_data_point.rb +++ b/server/app/workers/run_simulate_data_point.rb @@ -171,8 +171,10 @@ def perform File.open(run_log_file, 'a') do |run_log| begin # use bundle option only if we have a path to openstudio gemfile. expect this to be - bundle = Rails.application.config.os_gemfile_path.present? ? "--bundle #{Rails.application.config.os_gemfile_path} ": "" - cmd = "#{@options[:openstudio_executable]} run --workflow #{osw_path} --debug #{bundle}" + bundle = Rails.application.config.os_gemfile_path.present? ? "--bundle "\ + "#{File.join Rails.application.config.os_gemfile_path, 'Gemfile'} --bundle_path "\ + "#{File.join Rails.application.config.os_gemfile_path, 'gems'} --verbose " : "" + cmd = "#{@options[:openstudio_executable]} #{bundle}run --workflow #{osw_path} --debug" @sim_logger.info "Running workflow using cmd #{cmd}" # TODO confirm that any ENV variables that we want OSS to use are set correctly, probably pass explicitly to spawn diff --git a/server/config/environments/docker-dev.rb b/server/config/environments/docker-dev.rb index 0eefa7399..8687ef8e3 100644 --- a/server/config/environments/docker-dev.rb +++ b/server/config/environments/docker-dev.rb @@ -79,5 +79,5 @@ # detect os version build path to gemfile. this is passed to cli as --bundle os_version = `openstudio openstudio_version` - config.os_gemfile_path = "/usr/local/openstudio-#{os_version.slice(0,os_version.rindex('.'))}/Ruby/Gemfile" + config.os_gemfile_path = "/var/oscli" end diff --git a/server/config/environments/docker-test.rb b/server/config/environments/docker-test.rb index 76fcd5a14..134b5b9c1 100644 --- a/server/config/environments/docker-test.rb +++ b/server/config/environments/docker-test.rb @@ -80,5 +80,5 @@ # detect os version build path to gemfile. this is passed to cli as --bundle os_version = `openstudio openstudio_version` - config.os_gemfile_path = "/usr/local/openstudio-#{os_version.slice(0,os_version.rindex('.'))}/Ruby/Gemfile" + config.os_gemfile_path = "/var/oscli" end diff --git a/server/config/environments/docker.rb b/server/config/environments/docker.rb index 60a5b5b8b..120a9165b 100644 --- a/server/config/environments/docker.rb +++ b/server/config/environments/docker.rb @@ -111,5 +111,5 @@ # detect os version build path to gemfile. this is passed to cli as --bundle os_version = `openstudio openstudio_version` - config.os_gemfile_path = "/usr/local/openstudio-#{os_version.slice(0,os_version.rindex('.'))}/Ruby/Gemfile" + config.os_gemfile_path = "/var/oscli" end