Skip to content

Commit

Permalink
Merge branch 'dockerize' of github.com:NREL/OpenStudio-analysis-sprea…
Browse files Browse the repository at this point in the history
…dsheet into dockerize
  • Loading branch information
brianlball committed Feb 17, 2017
2 parents 77428cd + a335610 commit 81c902d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -6,6 +6,7 @@ gem 'git', require: false

gem 'openstudio-aws', '~> 0.4.2'
gem 'openstudio-analysis', '~> 1.0.0.rc15'

# gem 'openstudio-analysis', path: '../OpenStudio-analysis-gem'
# gem 'openstudio-analysis', github: 'nrel/openstudio-analysis-gem', branch: 'develop'

Expand Down
29 changes: 17 additions & 12 deletions Rakefile
Expand Up @@ -113,8 +113,9 @@ Or run `rake clean`".red
puts 'Starting cluster...'.cyan

# Don't use the old API (Version 1)
ami_version = options['openstudio_server_version'][0] == '2' ? 3 : 2
aws_options = {
ami_lookup_version: 2,
ami_lookup_version: ami_version,
openstudio_server_version: options['openstudio_server_version']
}
aws = OpenStudio::Aws::Aws.new(aws_options)
Expand Down Expand Up @@ -207,17 +208,21 @@ def run_analysis(analysis, run_options, target = 'aws', download = false)
options = {hostname: server_dns}
api = OpenStudio::Analysis::ServerApi.new(options)

if run_options[:batch_run_method]
analysis_id = api.run(formulation_file,
analysis_zip_file,
run_options['analysis_type'],
{ batch_run_method: run_options[:batch_run_method]}
)
else
analysis_id = api.run(formulation_file,
analysis_zip_file,
run_options['analysis_type']
)
begin
if run_options[:batch_run_method]
analysis_id = api.run(formulation_file,
analysis_zip_file,
run_options['analysis_type'],
{ batch_run_method: run_options[:batch_run_method]}
)
else
analysis_id = api.run(formulation_file,
analysis_zip_file,
run_options['analysis_type']
)
end
rescue => e
puts "Analysis submission failed with message `#{e.message}` in:\n#{e.backtrace.join("\n")}"
end


Expand Down
4 changes: 2 additions & 2 deletions cli.rb
Expand Up @@ -85,8 +85,8 @@ def lookup_target_url(target_type)
when 'lcnode1'
server_dns = 'http://10.60.7.61:8080'
else
puts "ERROR: TARGET -- Unknown 'target_type' in #{__method__}"
fail 1
puts "WARN: TARGET -- Unknown 'target_type' in #{__method__}"
server_dns = target_type.downcase
end

server_dns
Expand Down

0 comments on commit 81c902d

Please sign in to comment.