openstudio-aws 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +14 -13
  3. data/lib/openstudio-aws.rb +9 -7
  4. data/lib/openstudio/aws/aws.rb +53 -40
  5. data/lib/openstudio/aws/config.rb +0 -1
  6. data/lib/openstudio/aws/version.rb +2 -2
  7. data/lib/openstudio/lib/ami_list.rb +79 -0
  8. data/lib/openstudio/lib/openstudio_aws_instance.rb +138 -0
  9. data/lib/openstudio/lib/openstudio_aws_logger.rb +61 -0
  10. data/lib/openstudio/lib/openstudio_aws_methods.rb +232 -0
  11. data/lib/openstudio/lib/openstudio_aws_wrapper.rb +315 -0
  12. data/lib/openstudio/lib/os-aws.rb +77 -351
  13. data/spec/aws_instances/aws_spec_api.rb +70 -0
  14. data/spec/openstudio-aws/ami_list_spec.rb +37 -0
  15. data/spec/openstudio-aws/aws_methods_spec.rb +26 -0
  16. data/spec/openstudio-aws/lib_spec.rb +48 -0
  17. data/spec/reports/SPEC-OpenStudio-Aws-Aws-create-a-new-instance.xml +43 -0
  18. data/spec/reports/SPEC-OpenStudio-Aws-Aws-workers-before-server.xml +9 -0
  19. data/spec/reports/SPEC-OpenStudio-Aws-Aws.xml +7 -0
  20. data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.0.xml +9 -0
  21. data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.xml +9 -0
  22. data/spec/reports/SPEC-OpenStudio-Aws-Config.0.xml +7 -0
  23. data/spec/reports/SPEC-OpenStudio-Aws-Config.xml +7 -0
  24. data/spec/reports/SPEC-OpenStudioAmis-version-1.0.xml +13 -0
  25. data/spec/reports/SPEC-OpenStudioAmis-version-1.xml +13 -0
  26. data/spec/reports/SPEC-OpenStudioAmis.0.xml +7 -0
  27. data/spec/reports/SPEC-OpenStudioAmis.xml +7 -0
  28. data/spec/reports/SPEC-OpenStudioAwsMethods-processors.0.xml +11 -0
  29. data/spec/reports/SPEC-OpenStudioAwsMethods-processors.xml +11 -0
  30. data/spec/reports/SPEC-OpenStudioAwsMethods.0.xml +7 -0
  31. data/spec/reports/SPEC-OpenStudioAwsMethods.xml +7 -0
  32. data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.0.xml +11 -0
  33. data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.xml +11 -0
  34. data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.0.xml +9 -0
  35. data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.xml +9 -0
  36. data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.0.xml +7 -0
  37. data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.xml +7 -0
  38. data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.0.xml +9 -0
  39. data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.xml +9 -0
  40. data/spec/reports/SPEC-OpenStudioAwsWrapper.0.xml +7 -0
  41. data/spec/reports/SPEC-OpenStudioAwsWrapper.xml +7 -0
  42. metadata +70 -10
  43. data/lib/openstudio/aws/send_data.rb +0 -42
  44. data/spec/openstudio-aws/aws_spec.rb +0 -53
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <testsuite name="OpenStudioAwsWrapper unauthenticated session" tests="1" time="1.384048" failures="0" errors="0" skipped="0">
3
+ <testcase name="OpenStudioAwsWrapper unauthenticated session should fail to authenticate" time="1.383907">
4
+ </testcase>
5
+ <system-out>
6
+ </system-out>
7
+ <system-err>
8
+ </system-err>
9
+ </testsuite>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <testsuite name="OpenStudioAwsWrapper" tests="0" time="9.0e-05" failures="0" errors="0" skipped="0">
3
+ <system-out>
4
+ </system-out>
5
+ <system-err>
6
+ </system-err>
7
+ </testsuite>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <testsuite name="OpenStudioAwsWrapper" tests="0" time="7.0e-05" failures="0" errors="0" skipped="0">
3
+ <system-out>
4
+ </system-out>
5
+ <system-err>
6
+ </system-err>
7
+ </testsuite>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Long
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-21 00:00:00.000000000 Z
11
+ date: 2014-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-scp
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.1.2
27
27
  - !ruby/object:Gem::Dependency
28
- name: aws-sdk
28
+ name: aws-sdk-core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 1.31.3
33
+ version: 2.0.0.rc3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 1.31.3
40
+ version: 2.0.0.rc3
41
41
  description: Custom classes for configuring clusters for OpenStudio & EnergyPlus analyses
42
42
  email:
43
43
  - Nicholas.Long@nrel.gov
@@ -47,17 +47,49 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - lib/openstudio/aws/aws.rb
49
49
  - lib/openstudio/aws/config.rb
50
- - lib/openstudio/aws/send_data.rb
51
50
  - lib/openstudio/aws/version.rb
51
+ - lib/openstudio/lib/ami_list.rb
52
52
  - lib/openstudio/lib/mongoid.yml.template
53
+ - lib/openstudio/lib/openstudio_aws_instance.rb
54
+ - lib/openstudio/lib/openstudio_aws_logger.rb
55
+ - lib/openstudio/lib/openstudio_aws_methods.rb
56
+ - lib/openstudio/lib/openstudio_aws_wrapper.rb
53
57
  - lib/openstudio/lib/os-aws.rb
54
58
  - lib/openstudio/lib/server_script.sh
55
59
  - lib/openstudio/lib/worker_script.sh.template
56
60
  - lib/openstudio-aws.rb
57
61
  - README.md
58
62
  - Rakefile
59
- - spec/openstudio-aws/aws_spec.rb
63
+ - spec/aws_instances/aws_spec_api.rb
64
+ - spec/openstudio-aws/ami_list_spec.rb
65
+ - spec/openstudio-aws/aws_methods_spec.rb
60
66
  - spec/openstudio-aws/config_spec.rb
67
+ - spec/openstudio-aws/lib_spec.rb
68
+ - spec/reports/SPEC-OpenStudio-Aws-Aws-create-a-new-instance.xml
69
+ - spec/reports/SPEC-OpenStudio-Aws-Aws-workers-before-server.xml
70
+ - spec/reports/SPEC-OpenStudio-Aws-Aws.xml
71
+ - spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.0.xml
72
+ - spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.xml
73
+ - spec/reports/SPEC-OpenStudio-Aws-Config.0.xml
74
+ - spec/reports/SPEC-OpenStudio-Aws-Config.xml
75
+ - spec/reports/SPEC-OpenStudioAmis-version-1.0.xml
76
+ - spec/reports/SPEC-OpenStudioAmis-version-1.xml
77
+ - spec/reports/SPEC-OpenStudioAmis.0.xml
78
+ - spec/reports/SPEC-OpenStudioAmis.xml
79
+ - spec/reports/SPEC-OpenStudioAwsMethods-processors.0.xml
80
+ - spec/reports/SPEC-OpenStudioAwsMethods-processors.xml
81
+ - spec/reports/SPEC-OpenStudioAwsMethods.0.xml
82
+ - spec/reports/SPEC-OpenStudioAwsMethods.xml
83
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.0.xml
84
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.xml
85
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.0.xml
86
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.xml
87
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.0.xml
88
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.xml
89
+ - spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.0.xml
90
+ - spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.xml
91
+ - spec/reports/SPEC-OpenStudioAwsWrapper.0.xml
92
+ - spec/reports/SPEC-OpenStudioAwsWrapper.xml
61
93
  - spec/spec_helper.rb
62
94
  homepage: http://openstudio.nrel.gov
63
95
  licenses:
@@ -71,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
71
103
  requirements:
72
104
  - - '>='
73
105
  - !ruby/object:Gem::Version
74
- version: 1.9.3
106
+ version: 1.9.1
75
107
  required_rubygems_version: !ruby/object:Gem::Requirement
76
108
  requirements:
77
109
  - - '>='
@@ -79,11 +111,39 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
111
  version: 1.3.6
80
112
  requirements: []
81
113
  rubyforge_project:
82
- rubygems_version: 2.0.2
114
+ rubygems_version: 2.0.14
83
115
  signing_key:
84
116
  specification_version: 4
85
117
  summary: Start AWS EC2 instances for running distributed OpenStudio-based analyses
86
118
  test_files:
87
- - spec/openstudio-aws/aws_spec.rb
119
+ - spec/aws_instances/aws_spec_api.rb
120
+ - spec/openstudio-aws/ami_list_spec.rb
121
+ - spec/openstudio-aws/aws_methods_spec.rb
88
122
  - spec/openstudio-aws/config_spec.rb
123
+ - spec/openstudio-aws/lib_spec.rb
124
+ - spec/reports/SPEC-OpenStudio-Aws-Aws-create-a-new-instance.xml
125
+ - spec/reports/SPEC-OpenStudio-Aws-Aws-workers-before-server.xml
126
+ - spec/reports/SPEC-OpenStudio-Aws-Aws.xml
127
+ - spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.0.xml
128
+ - spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.xml
129
+ - spec/reports/SPEC-OpenStudio-Aws-Config.0.xml
130
+ - spec/reports/SPEC-OpenStudio-Aws-Config.xml
131
+ - spec/reports/SPEC-OpenStudioAmis-version-1.0.xml
132
+ - spec/reports/SPEC-OpenStudioAmis-version-1.xml
133
+ - spec/reports/SPEC-OpenStudioAmis.0.xml
134
+ - spec/reports/SPEC-OpenStudioAmis.xml
135
+ - spec/reports/SPEC-OpenStudioAwsMethods-processors.0.xml
136
+ - spec/reports/SPEC-OpenStudioAwsMethods-processors.xml
137
+ - spec/reports/SPEC-OpenStudioAwsMethods.0.xml
138
+ - spec/reports/SPEC-OpenStudioAwsMethods.xml
139
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.0.xml
140
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.xml
141
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.0.xml
142
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.xml
143
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.0.xml
144
+ - spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.xml
145
+ - spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.0.xml
146
+ - spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.xml
147
+ - spec/reports/SPEC-OpenStudioAwsWrapper.0.xml
148
+ - spec/reports/SPEC-OpenStudioAwsWrapper.xml
89
149
  - spec/spec_helper.rb
@@ -1,42 +0,0 @@
1
- # This is taken out of the OpenStudio AWS config file to do some testing
2
- #def send_command(host, command, key)
3
- # require 'net/http'
4
- # require 'net/scp'
5
- # require 'net/ssh'
6
- #
7
- # retries = 0
8
- # begin
9
- # puts "connecting.."
10
- # output = ''
11
- # Net::SSH.start(host, 'ubuntu', :key_data => [key]) do |ssh|
12
- # response = ssh.exec!(command)
13
- # output += response if !response.nil?
14
- # end
15
- # return output
16
- # rescue Net::SSH::HostKeyMismatch => e
17
- # e.remember_host!
18
- # # key mismatch, retry
19
- # return if retries == 2
20
- # retries += 1
21
- # sleep 1
22
- # retry
23
- # rescue Net::SSH::AuthenticationFailed
24
- # error(-1, "Incorrect private key")
25
- # rescue SystemCallError, Timeout::Error => e
26
- # # port 22 might not be available immediately after the instance finishes launching
27
- # return if retries == 2
28
- # retries += 1
29
- # sleep 1
30
- # retry
31
- # rescue Exception => e
32
- # puts e.message
33
- # puts e.backtrace.inspect
34
- # end
35
- #end
36
- #
37
- #server_json = JSON.parse(File.read("server_data.json"), :symbolize_names => true)
38
- #
39
- #b = Time.now
40
- #delta = b.to_f - a.to_f
41
- #puts "startup time is #{delta}"
42
- ##puts send_command(server_json[:server_ip], 'nproc | tr -d "\n"', File.read("ec2_server_key.pem"))
@@ -1,53 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe OpenStudio::Aws::Aws do
4
- context "create a new instance" do
5
- before(:all) do
6
- @aws = OpenStudio::Aws::Aws.new
7
- end
8
-
9
- it "should create a new instance" do
10
- @aws.should_not be_nil
11
- end
12
-
13
- it "should ask the user to create a new config file" do
14
- end
15
-
16
- it "should create a server" do
17
- # use the default instance type
18
- #options = {instance_type: "t1.micro" }
19
- options = {instance_type: "m1.small" }
20
- @aws.create_server(options)
21
- @aws.server_data[:server_dns].should_not be_nil
22
- end
23
-
24
- it "should create a 1 worker" do
25
- #options = {instance_type: "t1.micro" }
26
- options = {instance_type: "m1.small" }
27
- #server_json[:instance_type] = "m2.4xlarge"
28
- #server_json[:instance_type] = "m2.2xlarge"
29
- #server_json[:instance_type] = "t1.micro"
30
- @aws.create_workers(1, options)
31
-
32
- @aws.worker_data[:workers].size.should eq(1)
33
- @aws.worker_data[:workers][0][:dns].should_not be_nil
34
- end
35
- end
36
-
37
- context "workers before server" do
38
- before(:all) do
39
- @aws = OpenStudio::Aws::Aws.new
40
- end
41
-
42
- it "should not create any workers" do
43
-
44
- expect {@aws.create_workers(5)}.to raise_error
45
- end
46
-
47
- end
48
-
49
- context "larger cluster" do
50
-
51
- end
52
-
53
- end