Skip to content

Commit

Permalink
Fixing AWS workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
axelstudios committed Jul 24, 2015
1 parent fcf66c0 commit b039735
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dependencies/ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ gem 'rdoc', '= 4.0.0'
gem 'test-unit', '= 2.0.0.0'

# OpenStudio
gem 'openstudio-aws', '~> 0.4.0.alpha2'
gem 'openstudio-aws', '~> 0.4.0.pre1'
4 changes: 2 additions & 2 deletions dependencies/ruby/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GEM
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
openstudio-aws (0.4.0.alpha2)
openstudio-aws (0.4.0.pre1)
aws-sdk-core (~> 2.0)
net-scp (~> 1.1)
semantic (~> 1.4)
Expand All @@ -29,7 +29,7 @@ PLATFORMS
x86-mingw32

DEPENDENCIES
openstudio-aws (~> 0.4.0.alpha2)
openstudio-aws (~> 0.4.0.pre1)
rake (= 0.9.6)
rdoc (= 4.0.0)
test-unit (= 2.0.0.0)
Expand Down
12 changes: 2 additions & 10 deletions openstudiocore/ruby/cloud/aws.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,8 @@ begin
image_id: @server_image_id
}

# Create the server & worker
# Create the server
@aws.create_server server_options
worker_options = {
instance_type: @params['worker_instance_type'],
image_id: @worker_image_id
}
@aws.create_workers @params['num'], worker_options

@aws.save_cluster_info 'state.json'

Expand All @@ -218,7 +213,6 @@ begin
unless @params.key? 'num'
error(-1, 'Number of worker nodes not specified. Must be greater than or equal to 0')
end
=begin
worker_options = {
instance_type: @params['instance_type'],
image_id: @worker_image_id
Expand All @@ -233,9 +227,7 @@ begin
@aws.save_cluster_info 'state.json'

puts @aws.cluster_info.to_json
=end
puts JSON.parse(File.read('state.json')).to_json
#@logger.info("launch_workers: #{@aws.cluster_info}")
@logger.info("launch_workers: #{@aws.cluster_info}")
when 'terminate_session'
@aws.load_instance_info_from_file 'state.json'
@aws.terminate
Expand Down
2 changes: 1 addition & 1 deletion openstudiocore/src/pat_app/CloudMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ void StartCloudWorker::startWorking()

if( provider->requestStartServer() )
{
m_error = ! provider->waitForServer(900000);
m_error = ! provider->waitForServer();
}
}

Expand Down
3 changes: 1 addition & 2 deletions openstudiocore/src/utilities/cloud/AWSProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1523,8 +1523,6 @@ namespace openstudio{

QJsonObject options;
options["instance_type"] = QJsonValue(toQString(m_awsSettings.serverInstanceType()));
options["worker_instance_type"] = QJsonValue(toQString(m_awsSettings.workerInstanceType()));
options["num"] = QJsonValue(static_cast<int>(m_awsSettings.numWorkers()));
options["openstudio_version"] = QJsonValue(toQString(openStudioVersion()));
args << QString(QJsonDocument(options).toJson(QJsonDocument::Compact));

Expand Down Expand Up @@ -2079,6 +2077,7 @@ namespace openstudio{
auto jsonObject = json.object();
auto serverObject = jsonObject["server"].toObject();
serverObject["private_key_file_name"] = m_workingDir.path() + "/ec2_server_key.pem";
serverObject["worker_private_key_file_name"] = m_workingDir.path() + "/ec2_worker_key.pem";
jsonObject["server"] = serverObject;
auto workers = jsonObject["workers"].toArray();
for (auto i = 0; i < workers.size(); ++i) {
Expand Down

6 comments on commit b039735

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (axelstudios) - x86_64-MacOS-10.9-clang: Tests Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (axelstudios) - i386-Windows-7-VisualStudio-12: OK (2211 of 2231 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (axelstudios) - x86_64-Linux-Ubuntu-14.04-clang-3.5: OK (2176 of 2231 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (axelstudios) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (axelstudios) - Win64-Windows-7-VisualStudio-12: OK (2213 of 2231 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

iteration (axelstudios) - x86_64-MacOS-10.9-clang: Tests Failed

Build Badge Test Badge

Please sign in to comment.