openstudio-aws 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +10 -0
- data/lib/openstudio-aws.rb +1 -0
- data/lib/openstudio/aws/aws.rb +41 -34
- data/lib/openstudio/aws/version.rb +1 -1
- data/lib/openstudio/lib/openstudio_aws_instance.rb +37 -17
- data/lib/openstudio/lib/openstudio_aws_wrapper.rb +41 -28
- data/spec/aws_instances/aws_spec_api.rb +106 -19
- data/spec/openstudio-aws/ami_list_spec.rb +3 -0
- data/spec/openstudio-aws/aws_spec.rb +4 -4
- data/spec/openstudio-aws/aws_wrapper_spec.rb +1 -0
- metadata +2 -703
- data/lib/openstudio/lib/os-aws.rb +0 -295
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.0.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.1.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.10.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.11.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.12.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.13.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.14.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.2.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.3.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.4.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.5.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.6.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.7.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.8.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.9.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-ami-lists.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-create-a-new-instance.0.xml +0 -26
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-create-a-new-instance.xml +0 -35
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-create-ebs-storage.0.xml +0 -14
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-create-ebs-storage.xml +0 -14
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-custom-keys.0.xml +0 -14
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-custom-keys.1.xml +0 -21
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-custom-keys.2.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-custom-keys.3.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-custom-keys.4.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-custom-keys.5.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-custom-keys.6.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-custom-keys.7.xml +0 -11
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-custom-keys.xml +0 -16
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.0.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.1.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.10.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.11.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.12.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.13.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.14.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.2.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.3.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.4.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.5.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.6.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.7.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.8.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.9.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-proxy-configuration.xml +0 -13
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.0.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.1.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.10.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.11.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.12.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.13.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.14.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.2.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.3.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.4.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.5.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.6.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.7.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.8.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.9.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-should-error.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.0.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.1.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.10.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.11.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.12.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.13.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.14.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.2.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.3.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.4.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.5.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.6.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.7.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.8.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.9.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-version-testing.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-workers-before-server.0.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws-workers-before-server.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.0.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.1.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.10.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.11.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.12.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.13.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.14.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.15.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.16.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.2.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.3.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.4.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.5.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.6.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.7.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.8.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.9.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Aws.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.0.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.1.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.10.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.11.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.12.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.13.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.2.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.3.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.4.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.5.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.6.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.7.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.8.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.9.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config-create-a-new-config.xml +0 -9
- data/spec/reports/SPEC-OpenStudio-Aws-Config.0.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.1.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.10.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.11.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.12.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.13.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.2.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.3.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.4.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.5.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.6.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.7.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.8.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.9.xml +0 -7
- data/spec/reports/SPEC-OpenStudio-Aws-Config.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis-version-1.0.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.1.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.10.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.11.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.12.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.13.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.14.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.2.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.3.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.4.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.5.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.6.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.7.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.8.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.9.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-1.xml +0 -13
- data/spec/reports/SPEC-OpenStudioAmis-version-2.0.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.1.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.10.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.11.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.12.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.13.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.14.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.2.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.3.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.4.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.5.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.6.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.7.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.8.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.9.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis-version-2.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAmis.0.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.1.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.10.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.11.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.12.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.13.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.14.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.2.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.3.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.4.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.5.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.6.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.7.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.8.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.9.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAmis.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.0.xml +0 -21
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.1.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.10.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.11.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.12.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.2.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.3.xml +0 -25
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.4.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.5.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.6.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.7.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.8.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.9.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsInstance-processors.xml +0 -25
- data/spec/reports/SPEC-OpenStudioAwsInstance.0.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.1.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.10.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.11.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.12.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.2.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.3.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.4.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.5.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.6.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.7.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.8.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.9.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsInstance.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsMethods-processors.0.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsMethods-processors.1.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsMethods-processors.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsMethods.0.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsMethods.1.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsMethods.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.0.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.1.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.10.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.11.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.12.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.13.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.2.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.3.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.4.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.5.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.6.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.7.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.8.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.9.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-ami-list.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.0.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.1.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.10.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.11.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.12.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.13.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.14.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.2.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.3.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.4.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.5.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.6.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.7.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.8.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.9.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-availability.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.0.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.1.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.10.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.11.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.12.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.13.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.14.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.2.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.3.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.4.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.5.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.6.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.7.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.8.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.9.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-create-new-ami-json.xml +0 -11
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.0.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.1.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.10.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.11.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.12.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.13.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.14.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.2.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.3.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.4.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.5.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.6.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.7.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.8.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.9.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-new-instance.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.0.xml +0 -103
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.1.xml +0 -103
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.10.xml +0 -107
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.11.xml +0 -107
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.12.xml +0 -107
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.13.xml +0 -108
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.2.xml +0 -103
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.3.xml +0 -103
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.4.xml +0 -107
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.5.xml +0 -107
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.6.xml +0 -107
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.7.xml +0 -107
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.8.xml +0 -107
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.9.xml +0 -107
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-1.xml +0 -103
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.0.xml +0 -1111
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.1.xml +0 -1111
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.10.xml +0 -1113
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.11.xml +0 -1113
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.12.xml +0 -1133
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.13.xml +0 -1263
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.2.xml +0 -1111
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.3.xml +0 -1111
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.4.xml +0 -1113
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.5.xml +0 -1113
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.6.xml +0 -1113
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.7.xml +0 -1113
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.8.xml +0 -1113
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.9.xml +0 -1113
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session-version-2.xml +0 -1111
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.0.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.1.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.10.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.11.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.12.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.13.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.14.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.2.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.3.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.4.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.5.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.6.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.7.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.8.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.9.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-authenticated-session.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.0.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.1.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.10.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.11.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.12.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.13.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.14.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.2.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.3.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.4.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.5.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.6.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.7.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.8.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.9.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper-unauthenticated-session.xml +0 -9
- data/spec/reports/SPEC-OpenStudioAwsWrapper.0.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.1.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.10.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.11.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.12.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.13.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.14.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.2.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.3.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.4.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.5.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.6.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.7.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.8.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.9.xml +0 -7
- data/spec/reports/SPEC-OpenStudioAwsWrapper.xml +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60c7a1fc72d71ce4c4dbc7d0ebfebdc54facedfc
|
|
4
|
+
data.tar.gz: 05a41b5ad8f6d1227f8ee7451ec933f1802a9941
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 51d1d6994dc81b161de452642efadbf30ca114af68d6073b9ee2baf1ca324d64e064de1944f4c9ccb87109f4824f718bd23fb8718b360933566646218061c364
|
|
7
|
+
data.tar.gz: aac1a5ddb1db0242725637c44889e48cb69e6e620a7287e0f95e461a06a7213a4edd3d03a19e79cae0c4b3c3dbc5f064fadf03ae8917480fec1d3a327e95a646
|
data/Rakefile
CHANGED
|
@@ -73,3 +73,13 @@ end
|
|
|
73
73
|
|
|
74
74
|
desc 'reinstall the gem (uninstall, build, and reinstall'
|
|
75
75
|
task reinstall: [:uninstall, :install]
|
|
76
|
+
|
|
77
|
+
require 'rubocop/rake_task'
|
|
78
|
+
desc 'Run RuboCop on the lib directory'
|
|
79
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
|
80
|
+
task.options = ['--no-color', '--out=rubocop-results.xml']
|
|
81
|
+
task.formatters = ['RuboCop::Formatter::CheckstyleFormatter']
|
|
82
|
+
task.requires = ['rubocop/formatter/checkstyle_formatter']
|
|
83
|
+
# don't abort rake on failure
|
|
84
|
+
task.fail_on_error = false
|
|
85
|
+
end
|
data/lib/openstudio-aws.rb
CHANGED
data/lib/openstudio/aws/aws.rb
CHANGED
|
@@ -27,7 +27,7 @@ module OpenStudio
|
|
|
27
27
|
region: 'us-east-1',
|
|
28
28
|
ssl_verify_peer: false,
|
|
29
29
|
host: 'developer.nrel.gov',
|
|
30
|
-
url: '/downloads/buildings/openstudio/api'
|
|
30
|
+
url: '/downloads/buildings/openstudio/api'
|
|
31
31
|
}
|
|
32
32
|
options = defaults.merge(options)
|
|
33
33
|
|
|
@@ -98,6 +98,7 @@ module OpenStudio
|
|
|
98
98
|
ebs_volume_id: nil,
|
|
99
99
|
aws_key_pair_name: nil,
|
|
100
100
|
private_key_file_name: nil, # required if using an existing "aws_key_pair_name"
|
|
101
|
+
tags: []
|
|
101
102
|
}
|
|
102
103
|
options = defaults.merge(options)
|
|
103
104
|
|
|
@@ -118,7 +119,7 @@ module OpenStudio
|
|
|
118
119
|
@os_aws.save_private_key('ec2_server_key.pem')
|
|
119
120
|
end
|
|
120
121
|
|
|
121
|
-
server_options = { user_id: options[:user_id] }
|
|
122
|
+
server_options = { user_id: options[:user_id], tags: options[:tags] }
|
|
122
123
|
# if instance_data[:ebs_volume_id]
|
|
123
124
|
# server_options[:ebs_volume_id] = instance_data[:ebs_volume_id]
|
|
124
125
|
# end
|
|
@@ -135,17 +136,18 @@ module OpenStudio
|
|
|
135
136
|
puts "ssh -i #{@os_aws.private_key_file_name} ubuntu@#{@os_aws.server.data[:dns]}"
|
|
136
137
|
end
|
|
137
138
|
|
|
138
|
-
def create_workers(number_of_instances, options = {},
|
|
139
|
+
def create_workers(number_of_instances, options = {}, user_id = 'unknown_user')
|
|
139
140
|
defaults = {
|
|
140
141
|
instance_type: 'm2.4xlarge',
|
|
141
142
|
security_group: 'openstudio-server-sg-v1',
|
|
142
143
|
image_id: @default_amis[:server],
|
|
143
|
-
user_id:
|
|
144
|
+
user_id: user_id,
|
|
144
145
|
|
|
145
146
|
# optional -- will default later
|
|
146
147
|
ebs_volume_id: nil,
|
|
147
148
|
aws_key_pair_name: nil,
|
|
148
|
-
private_key_file_name: nil, # required if using an existing "aws_key_pair_name"
|
|
149
|
+
private_key_file_name: nil, # required if using an existing "aws_key_pair_name",
|
|
150
|
+
tags: []
|
|
149
151
|
}
|
|
150
152
|
options = defaults.merge(options)
|
|
151
153
|
|
|
@@ -160,34 +162,39 @@ module OpenStudio
|
|
|
160
162
|
|
|
161
163
|
fail "Can't create workers without a server instance running" if @os_aws.server.nil?
|
|
162
164
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
165
|
+
if number_of_instances == 0
|
|
166
|
+
puts ''
|
|
167
|
+
puts 'No workers requested'
|
|
168
|
+
else
|
|
169
|
+
worker_options = { user_id: options[:user_id], tags: options[:tags] }
|
|
170
|
+
# if options[:ebs_volume_size]
|
|
171
|
+
# worker_options[:ebs_volume_size] = options[:ebs_volume_size]
|
|
172
|
+
# end
|
|
173
|
+
|
|
174
|
+
@os_aws.launch_workers(options[:image_id], options[:instance_type], number_of_instances, worker_options)
|
|
175
|
+
|
|
176
|
+
## append the information to the server_data hash that already exists
|
|
177
|
+
# @server_data[:instance_type] = instance_data[:instance_type]
|
|
178
|
+
# @server_data[:num] = number_of_instances
|
|
179
|
+
# server_string = @server_data.to_json.gsub("\"", "\\\\\"")
|
|
180
|
+
#
|
|
181
|
+
# start_string = "ruby #{os_aws_file_location} #{@config.access_key} #{@config.secret_key} us-east-1 EC2 launch_workers \"#{server_string}\""
|
|
182
|
+
# puts "Worker Command: #{start_string}"
|
|
183
|
+
# worker_data_string = `#{start_string}`
|
|
184
|
+
# @worker_data = JSON.parse(worker_data_string, :symbolize_names => true)
|
|
185
|
+
# File.open("worker_data.json", "w") { |f| f << JSON.pretty_generate(worker_data) }
|
|
186
|
+
#
|
|
187
|
+
## Print out some debugging commands (probably work on mac/linux only)
|
|
188
|
+
# Add the worker data to the JSON
|
|
189
|
+
h = JSON.parse(File.read(@instances_json))
|
|
190
|
+
h[:workers] = @os_aws.to_os_worker_hash[:workers]
|
|
191
|
+
File.open(@instances_json, 'w') { |f| f << JSON.pretty_generate(h) }
|
|
192
|
+
|
|
193
|
+
puts ''
|
|
194
|
+
puts 'Worker SSH Command:'
|
|
195
|
+
@os_aws.workers.each do |worker|
|
|
196
|
+
puts "ssh -i #{@os_aws.private_key_file_name} ubuntu@#{worker.data[:dns]}"
|
|
197
|
+
end
|
|
191
198
|
end
|
|
192
199
|
|
|
193
200
|
puts ''
|
|
@@ -206,7 +213,7 @@ module OpenStudio
|
|
|
206
213
|
resp
|
|
207
214
|
end
|
|
208
215
|
|
|
209
|
-
# @params(ids): array of
|
|
216
|
+
# @params(ids): array of instance ids
|
|
210
217
|
def terminate_instances(ids)
|
|
211
218
|
puts "Terminating the following instances #{ids}"
|
|
212
219
|
resp = []
|
|
@@ -26,7 +26,8 @@ class OpenStudioAwsInstance
|
|
|
26
26
|
attr_reader :private_key_file_name
|
|
27
27
|
attr_reader :group_uuid
|
|
28
28
|
|
|
29
|
-
def initialize(aws_session, openstudio_instance_type, key_pair_name, security_group_name, group_uuid, private_key,
|
|
29
|
+
def initialize(aws_session, openstudio_instance_type, key_pair_name, security_group_name, group_uuid, private_key,
|
|
30
|
+
private_key_file_name, proxy = nil)
|
|
30
31
|
@data = nil # stored information about the instance
|
|
31
32
|
@aws = aws_session
|
|
32
33
|
@openstudio_instance_type = openstudio_instance_type # :server, :worker
|
|
@@ -56,9 +57,8 @@ class OpenStudioAwsInstance
|
|
|
56
57
|
|
|
57
58
|
# get the instance information
|
|
58
59
|
test_result = @aws.describe_volumes(volume_ids: [resp[:volume_id]])
|
|
59
|
-
puts test_result
|
|
60
60
|
begin
|
|
61
|
-
Timeout.timeout(600)
|
|
61
|
+
Timeout.timeout(600) do # 10 minutes
|
|
62
62
|
while test_result.nil? || test_result.instance_state.name != 'available'
|
|
63
63
|
# refresh the server instance information
|
|
64
64
|
|
|
@@ -66,7 +66,7 @@ class OpenStudioAwsInstance
|
|
|
66
66
|
test_result = @aws.describe_volumes(volume_ids: [resp[:volume_id]])
|
|
67
67
|
logger.info '... waiting for EBS volume to be available ...'
|
|
68
68
|
end
|
|
69
|
-
|
|
69
|
+
end
|
|
70
70
|
rescue TimeoutError
|
|
71
71
|
raise "EBS volume was unable to be created due to timeout #{instance_id}"
|
|
72
72
|
end
|
|
@@ -87,7 +87,7 @@ class OpenStudioAwsInstance
|
|
|
87
87
|
# true?
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
-
def launch_instance(image_id, instance_type, user_data, user_id,
|
|
90
|
+
def launch_instance(image_id, instance_type, user_data, user_id, options = {})
|
|
91
91
|
# logger.info("user_data #{user_data.inspect}")
|
|
92
92
|
instance = {
|
|
93
93
|
image_id: image_id,
|
|
@@ -106,23 +106,43 @@ class OpenStudioAwsInstance
|
|
|
106
106
|
# determine how many processors are suppose to be in this image (lookup for now?)
|
|
107
107
|
processors = find_processors(instance_type)
|
|
108
108
|
|
|
109
|
+
# create the tag structure
|
|
110
|
+
aws_tags = [
|
|
111
|
+
{ key: 'Name', value: "OpenStudio-#{@openstudio_instance_type.capitalize}" },
|
|
112
|
+
{ key: 'GroupUUID', value: @group_uuid },
|
|
113
|
+
{ key: 'NumberOfProcessors', value: processors.to_s },
|
|
114
|
+
{ key: 'Purpose', value: "OpenStudio#{@openstudio_instance_type.capitalize}" },
|
|
115
|
+
{ key: 'UserID', value: user_id }
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
# add in any manual tags
|
|
119
|
+
options[:tags].each do |tag|
|
|
120
|
+
t = tag.split('=')
|
|
121
|
+
if t.size != 2
|
|
122
|
+
logger.error "Tag '#{t}' not defined or does not have an equal sign"
|
|
123
|
+
puts "Tag '#{t}' not defined or does not have an equal sign"
|
|
124
|
+
next
|
|
125
|
+
end
|
|
126
|
+
if %w(Name GroupUUID NumberOfProcessors Purpose UserID).include? t[0]
|
|
127
|
+
logger.error "Tag name '#{t[0]}' is a reserved tag"
|
|
128
|
+
puts "Tag name '#{t[0]}' is a reserved tag"
|
|
129
|
+
next
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
aws_tags << { key: t[0].strip, value: t[1].strip }
|
|
133
|
+
end
|
|
134
|
+
|
|
109
135
|
# only asked for 1 instance, so therefore it should be the first
|
|
110
136
|
aws_instance = result.data.instances.first
|
|
111
137
|
@aws.create_tags(
|
|
112
138
|
resources: [aws_instance.instance_id],
|
|
113
|
-
tags:
|
|
114
|
-
{ key: 'Name', value: "OpenStudio-#{@openstudio_instance_type.capitalize}" }, # todo: abstract out the server and version
|
|
115
|
-
{ key: 'GroupUUID', value: @group_uuid },
|
|
116
|
-
{ key: 'NumberOfProcessors', value: processors.to_s },
|
|
117
|
-
{ key: 'Purpose', value: "OpenStudio#{@openstudio_instance_type.capitalize}" },
|
|
118
|
-
{ key: 'UserID', value: user_id }
|
|
119
|
-
]
|
|
139
|
+
tags: aws_tags
|
|
120
140
|
)
|
|
121
141
|
|
|
122
142
|
# get the instance information
|
|
123
143
|
test_result = @aws.describe_instance_status(instance_ids: [aws_instance.instance_id]).data.instance_statuses.first
|
|
124
144
|
begin
|
|
125
|
-
Timeout.timeout(600)
|
|
145
|
+
Timeout.timeout(600) do # 10 minutes
|
|
126
146
|
while test_result.nil? || test_result.instance_state.name != 'running'
|
|
127
147
|
# refresh the server instance information
|
|
128
148
|
|
|
@@ -130,13 +150,13 @@ class OpenStudioAwsInstance
|
|
|
130
150
|
test_result = @aws.describe_instance_status(instance_ids: [aws_instance.instance_id]).data.instance_statuses.first
|
|
131
151
|
logger.info '... waiting for instance to be running ...'
|
|
132
152
|
end
|
|
133
|
-
|
|
153
|
+
end
|
|
134
154
|
rescue TimeoutError
|
|
135
155
|
raise "Instance was unable to launch due to timeout #{aws_instance.instance_id}"
|
|
136
156
|
end
|
|
137
157
|
|
|
138
|
-
if ebs_volume_size
|
|
139
|
-
create_and_attach_volume(ebs_volume_size, aws_instance.instance_id, aws_instance.placement.availability_zone)
|
|
158
|
+
if options[:ebs_volume_size]
|
|
159
|
+
create_and_attach_volume(options[:ebs_volume_size], aws_instance.instance_id, aws_instance.placement.availability_zone)
|
|
140
160
|
end
|
|
141
161
|
|
|
142
162
|
# now grab information about the instance
|
|
@@ -201,7 +221,7 @@ class OpenStudioAwsInstance
|
|
|
201
221
|
't1.micro' => 1,
|
|
202
222
|
'm1.small' => 1,
|
|
203
223
|
'm2.2xlarge' => 4,
|
|
204
|
-
'm2.4xlarge' => 8
|
|
224
|
+
'm2.4xlarge' => 8
|
|
205
225
|
}
|
|
206
226
|
|
|
207
227
|
processors = 1
|
|
@@ -149,11 +149,11 @@ class OpenStudioAwsWrapper
|
|
|
149
149
|
if group_uuid && openstudio_instance_type
|
|
150
150
|
# {:key=>"Purpose", :value=>"OpenStudioWorker"}
|
|
151
151
|
if i_h[:tags].any? { |h| (h[:key] == 'Purpose') && (h[:value] == "OpenStudio#{openstudio_instance_type.capitalize}") } &&
|
|
152
|
-
|
|
152
|
+
i_h[:tags].any? { |h| (h[:key] == 'GroupUUID') && (h[:value] == group_uuid.to_s) }
|
|
153
153
|
instance_data << i_h
|
|
154
154
|
end
|
|
155
155
|
elsif group_uuid
|
|
156
|
-
if i_h[:tags].any? { |h|(h[:key] == 'GroupUUID') && (h[:value] == group_uuid.to_s) }
|
|
156
|
+
if i_h[:tags].any? { |h| (h[:key] == 'GroupUUID') && (h[:value] == group_uuid.to_s) }
|
|
157
157
|
instance_data << i_h
|
|
158
158
|
end
|
|
159
159
|
elsif openstudio_instance_type
|
|
@@ -218,13 +218,13 @@ class OpenStudioAwsWrapper
|
|
|
218
218
|
def terminate_instances(ids)
|
|
219
219
|
begin
|
|
220
220
|
resp = @aws.terminate_instances(
|
|
221
|
-
instance_ids: ids
|
|
221
|
+
instance_ids: ids
|
|
222
222
|
)
|
|
223
223
|
rescue Aws::EC2::Errors::InvalidInstanceIDNotFound
|
|
224
224
|
# Log that the instances couldn't be found?
|
|
225
|
-
return resp = {error: 'instances could not be found'}
|
|
225
|
+
return resp = { error: 'instances could not be found' }
|
|
226
226
|
end
|
|
227
|
-
|
|
227
|
+
|
|
228
228
|
resp
|
|
229
229
|
end
|
|
230
230
|
|
|
@@ -275,23 +275,24 @@ class OpenStudioAwsWrapper
|
|
|
275
275
|
end
|
|
276
276
|
end
|
|
277
277
|
|
|
278
|
-
def launch_server(image_id, instance_type,
|
|
279
|
-
defaults = { user_id: 'unknown_user' }
|
|
280
|
-
|
|
278
|
+
def launch_server(image_id, instance_type, launch_options = {})
|
|
279
|
+
defaults = { user_id: 'unknown_user', tags: [], ebs_volume_size: nil }
|
|
280
|
+
launch_options = defaults.merge(launch_options)
|
|
281
281
|
|
|
282
282
|
user_data = File.read(File.expand_path(File.dirname(__FILE__)) + '/server_script.sh')
|
|
283
|
-
@server = OpenStudioAwsInstance.new(@aws, :server, @key_pair_name, @security_group_name, @group_uuid, @private_key,
|
|
283
|
+
@server = OpenStudioAwsInstance.new(@aws, :server, @key_pair_name, @security_group_name, @group_uuid, @private_key,
|
|
284
|
+
@private_key_file_name, @proxy)
|
|
284
285
|
|
|
285
286
|
# create the EBS volumes instead of the ephemeral storage - needed especially for the m3 instances (SSD)
|
|
286
287
|
|
|
287
288
|
fail 'image_id is nil' unless image_id
|
|
288
289
|
fail 'instance type is nil' unless instance_type
|
|
289
|
-
@server.launch_instance(image_id, instance_type, user_data,
|
|
290
|
+
@server.launch_instance(image_id, instance_type, user_data, launch_options[:user_id], launch_options)
|
|
290
291
|
end
|
|
291
292
|
|
|
292
|
-
def launch_workers(image_id, instance_type, num,
|
|
293
|
-
defaults = { user_id: 'unknown_user' }
|
|
294
|
-
|
|
293
|
+
def launch_workers(image_id, instance_type, num, launch_options = {})
|
|
294
|
+
defaults = { user_id: 'unknown_user', tags: [], ebs_volume_size: nil }
|
|
295
|
+
launch_options = defaults.merge(launch_options)
|
|
295
296
|
|
|
296
297
|
user_data = File.read(File.expand_path(File.dirname(__FILE__)) + '/worker_script.sh.template')
|
|
297
298
|
user_data.gsub!(/SERVER_IP/, @server.data.ip)
|
|
@@ -302,17 +303,18 @@ class OpenStudioAwsWrapper
|
|
|
302
303
|
# thread the launching of the workers
|
|
303
304
|
|
|
304
305
|
num.times do
|
|
305
|
-
@workers << OpenStudioAwsInstance.new(@aws, :worker, @key_pair_name, @security_group_name, @group_uuid,
|
|
306
|
+
@workers << OpenStudioAwsInstance.new(@aws, :worker, @key_pair_name, @security_group_name, @group_uuid,
|
|
307
|
+
@private_key, @private_key_file_name, @proxy)
|
|
306
308
|
end
|
|
307
309
|
|
|
308
310
|
threads = []
|
|
309
311
|
@workers.each do |worker|
|
|
310
312
|
threads << Thread.new do
|
|
311
313
|
# create the EBS volumes instead of the ephemeral storage - needed especially for the m3 instances (SSD)
|
|
312
|
-
worker.launch_instance(image_id, instance_type, user_data,
|
|
314
|
+
worker.launch_instance(image_id, instance_type, user_data, launch_options[:user_id], launch_options)
|
|
313
315
|
end
|
|
314
316
|
end
|
|
315
|
-
threads.each
|
|
317
|
+
threads.each(&:join)
|
|
316
318
|
|
|
317
319
|
# todo: do we need to have a flag if the worker node is successful?
|
|
318
320
|
# todo: do we need to check the current list of running workers?
|
|
@@ -350,7 +352,8 @@ class OpenStudioAwsWrapper
|
|
|
350
352
|
@server.shell_command('chmod 664 /mnt/openstudio/rails-models/mongoid.yml')
|
|
351
353
|
@workers.each { |worker| worker.shell_command('chmod 664 /mnt/openstudio/rails-models/mongoid.yml') }
|
|
352
354
|
|
|
353
|
-
|
|
355
|
+
# I'm removing this as of 10/6/14. This should have been resolved by now.
|
|
356
|
+
# sleep 60 # wait 60 more seconds for everything -- this is cheesy
|
|
354
357
|
true
|
|
355
358
|
end
|
|
356
359
|
|
|
@@ -499,16 +502,26 @@ class OpenStudioAwsWrapper
|
|
|
499
502
|
a[:tested] = false
|
|
500
503
|
end
|
|
501
504
|
|
|
502
|
-
|
|
503
|
-
|
|
505
|
+
# TODO: in 1.6.0 just stop putting in the cc2workers.
|
|
506
|
+
if ami[:tags_hash][:openstudio_version].to_version >= '1.5.0'
|
|
507
|
+
if ami[:name] =~ /Server/
|
|
508
|
+
a[:amis][:server] = ami[:image_id]
|
|
509
|
+
elsif ami[:name] =~ /Worker/
|
|
504
510
|
a[:amis][:worker] = ami[:image_id]
|
|
505
|
-
elsif ami[:virtualization_type] == 'hvm'
|
|
506
511
|
a[:amis][:cc2worker] = ami[:image_id]
|
|
507
|
-
else
|
|
508
|
-
fail "unknown virtualization_type in #{ami[:name]}"
|
|
509
512
|
end
|
|
510
|
-
|
|
511
|
-
|
|
513
|
+
else
|
|
514
|
+
if ami[:name] =~ /Worker|Cluster/
|
|
515
|
+
if ami[:virtualization_type] == 'paravirtual'
|
|
516
|
+
a[:amis][:worker] = ami[:image_id]
|
|
517
|
+
elsif ami[:virtualization_type] == 'hvm'
|
|
518
|
+
a[:amis][:cc2worker] = ami[:image_id]
|
|
519
|
+
else
|
|
520
|
+
fail "unknown virtualization_type in #{ami[:name]}"
|
|
521
|
+
end
|
|
522
|
+
elsif ami[:name] =~ /Server/
|
|
523
|
+
a[:amis][:server] = ami[:image_id]
|
|
524
|
+
end
|
|
512
525
|
end
|
|
513
526
|
end
|
|
514
527
|
# puts "Current AMIs: #{JSON.pretty_generate(amis)}"
|
|
@@ -522,7 +535,7 @@ class OpenStudioAwsWrapper
|
|
|
522
535
|
next_version = get_next_version('0.0.1', list_of_svs)
|
|
523
536
|
list_of_svs << next_version
|
|
524
537
|
|
|
525
|
-
amis[:openstudio_server][next_version.to_sym]
|
|
538
|
+
amis[:openstudio_server][next_version.to_sym] ||= {}
|
|
526
539
|
a = amis[:openstudio_server][next_version.to_sym]
|
|
527
540
|
a[:amis] = {} unless a[:amis]
|
|
528
541
|
|
|
@@ -541,10 +554,10 @@ class OpenStudioAwsWrapper
|
|
|
541
554
|
a = amis[:openstudio_server][key]
|
|
542
555
|
ov = a[:openstudio_version]
|
|
543
556
|
|
|
544
|
-
amis[:openstudio][ov]
|
|
557
|
+
amis[:openstudio][ov] ||= {}
|
|
545
558
|
osv = key
|
|
546
|
-
amis[:openstudio][ov][osv]
|
|
547
|
-
amis[:openstudio][ov][osv][:amis]
|
|
559
|
+
amis[:openstudio][ov][osv] ||= {}
|
|
560
|
+
amis[:openstudio][ov][osv][:amis] ||= {}
|
|
548
561
|
amis[:openstudio][ov][osv][:amis][:server] = a[:amis][:server]
|
|
549
562
|
amis[:openstudio][ov][osv][:amis][:worker] = a[:amis][:worker]
|
|
550
563
|
amis[:openstudio][ov][osv][:amis][:cc2worker] = a[:amis][:cc2worker]
|
|
@@ -10,11 +10,11 @@ describe OpenStudio::Aws::Aws do
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
it 'should create a new instance' do
|
|
13
|
-
@aws.
|
|
13
|
+
expect(@aws).to be_nil
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
it 'should create a server' do
|
|
17
|
-
options = { instance_type: '
|
|
17
|
+
options = { instance_type: 'm3.medium', image_id: 'ami-3c0fbf54' }
|
|
18
18
|
|
|
19
19
|
test_pem_file = 'ec2_server_key.pem'
|
|
20
20
|
FileUtils.rm_f test_pem_file if File.exist? test_pem_file
|
|
@@ -26,32 +26,31 @@ describe OpenStudio::Aws::Aws do
|
|
|
26
26
|
expect(File.exist?('server_data.json')).to be true
|
|
27
27
|
expect(@aws.os_aws.server).not_to be_nil
|
|
28
28
|
|
|
29
|
-
h = @os_aws.server.to_os_hash
|
|
29
|
+
h = @aws.os_aws.server.to_os_hash
|
|
30
30
|
expect(h[:group_id]).to be_a String
|
|
31
|
-
expect(h[:group_id]).to match
|
|
32
|
-
expect(h[:location]).to
|
|
31
|
+
expect(h[:group_id]).to match /^[\d\S]{32}$/
|
|
32
|
+
expect(h[:location]).to eq 'AWS'
|
|
33
33
|
|
|
34
34
|
@group_id = h[:group_id]
|
|
35
|
-
|
|
36
35
|
end
|
|
37
36
|
|
|
38
37
|
it 'should create a 1 worker' do
|
|
39
|
-
options = { instance_type: '
|
|
38
|
+
options = { instance_type: 'm3.medium', image_id: 'ami-040ebe6c' }
|
|
40
39
|
|
|
41
40
|
@aws.create_workers(1, options)
|
|
42
41
|
|
|
43
|
-
expect(@aws.os_aws.workers).to
|
|
42
|
+
expect(@aws.os_aws.workers.size).to eq 1
|
|
44
43
|
expect(@aws.os_aws.workers[0].data[:dns]).not_to be_nil
|
|
45
44
|
end
|
|
46
45
|
|
|
47
46
|
it 'should be able to connect a worker to an existing server' do
|
|
48
|
-
options = { instance_type: '
|
|
47
|
+
options = { instance_type: 'm3.medium', image_id: 'ami-3c0fbf54' }
|
|
49
48
|
|
|
50
49
|
# will require a new @aws class--but attached to same group_uuid
|
|
51
50
|
@config = OpenStudio::Aws::Config.new
|
|
52
51
|
@aws_2 = OpenStudio::Aws::Aws.new
|
|
53
52
|
|
|
54
|
-
@aws_2.os_aws.find_server(@aws.os_aws.
|
|
53
|
+
@aws_2.os_aws.find_server(@aws.os_aws.server.to_os_hash)
|
|
55
54
|
|
|
56
55
|
expect(@aws.os_aws.server).not_to be_nil
|
|
57
56
|
end
|
|
@@ -70,7 +69,7 @@ describe OpenStudio::Aws::Aws do
|
|
|
70
69
|
config = OpenStudio::Aws::Config.new
|
|
71
70
|
aws = OpenStudio::Aws::Aws.new
|
|
72
71
|
|
|
73
|
-
options = { instance_type: '
|
|
72
|
+
options = { instance_type: 'm3.medium', image_id: 'ami-3c0fbf54' }
|
|
74
73
|
|
|
75
74
|
aws.create_server(options)
|
|
76
75
|
end
|
|
@@ -81,26 +80,26 @@ describe OpenStudio::Aws::Aws do
|
|
|
81
80
|
j = JSON.parse(File.read('server_data.json'), symbolize_names: true)
|
|
82
81
|
|
|
83
82
|
config = OpenStudio::Aws::Config.new
|
|
84
|
-
|
|
83
|
+
aws2 = OpenStudio::Aws::Aws.new
|
|
85
84
|
|
|
86
|
-
|
|
85
|
+
aws2.load_instance_info_from_file('server_data.json')
|
|
87
86
|
|
|
88
|
-
expect(
|
|
89
|
-
puts
|
|
87
|
+
expect(aws2.os_aws.server.group_uuid).to eq j[:group_id]
|
|
88
|
+
puts aws2.os_aws.server.inspect
|
|
90
89
|
|
|
91
90
|
local_file = File.expand_path('spec/resources/upload_me.sh')
|
|
92
91
|
remote_file = '/home/ubuntu/i_uploaded_this_file.sh'
|
|
93
92
|
|
|
94
|
-
|
|
93
|
+
aws2.upload_file(:server, local_file, remote_file)
|
|
95
94
|
|
|
96
|
-
|
|
95
|
+
aws2.shell_command(:server, "source #{remote_file}")
|
|
97
96
|
|
|
98
97
|
FileUtils.rm_f 'success.receipt' if File.exist? 'success.receipt'
|
|
99
|
-
|
|
98
|
+
aws2.download_remote_file(:server, '/home/ubuntu/success.receipt', 'success.receipt')
|
|
100
99
|
expect(File.exist?('success.receipt')).to be true
|
|
101
100
|
|
|
102
101
|
FileUtils.rm_f 'gemlist.receipt' if File.exist? 'gemlist.receipt'
|
|
103
|
-
|
|
102
|
+
aws2.download_remote_file(:server, '/home/ubuntu/gemlist.receipt', 'gemlist.receipt')
|
|
104
103
|
expect(File.exist?('gemlist.receipt')).to be true
|
|
105
104
|
gemlist = File.read('gemlist.receipt')
|
|
106
105
|
expect(gemlist).to match /^s3 \(.*\)$/
|
|
@@ -121,6 +120,94 @@ describe OpenStudio::Aws::Aws do
|
|
|
121
120
|
end
|
|
122
121
|
end
|
|
123
122
|
|
|
123
|
+
context 'create aws tags' do
|
|
124
|
+
before(:all) do
|
|
125
|
+
@config = OpenStudio::Aws::Config.new
|
|
126
|
+
@aws = OpenStudio::Aws::Aws.new
|
|
127
|
+
|
|
128
|
+
@group_id = nil
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
it 'should create a server with tags' do
|
|
132
|
+
begin
|
|
133
|
+
options = {
|
|
134
|
+
instance_type: 'm3.medium',
|
|
135
|
+
image_id: 'ami-3c0fbf54',
|
|
136
|
+
tags: [
|
|
137
|
+
'ci_tests=true',
|
|
138
|
+
'nothing=else',
|
|
139
|
+
'this=is the end ',
|
|
140
|
+
'this= is the beginning '
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
test_pem_file = 'ec2_server_key.pem'
|
|
145
|
+
FileUtils.rm_f test_pem_file if File.exist? test_pem_file
|
|
146
|
+
FileUtils.rm_f 'server_data.json' if File.exist? 'server_data.json'
|
|
147
|
+
|
|
148
|
+
@aws.create_server(options)
|
|
149
|
+
|
|
150
|
+
expect(File.exist?('ec2_server_key.pem')).to be true
|
|
151
|
+
expect(File.exist?('server_data.json')).to be true
|
|
152
|
+
expect(@aws.os_aws.server).not_to be_nil
|
|
153
|
+
|
|
154
|
+
h = @aws.os_aws.server.to_os_hash
|
|
155
|
+
expect(h[:group_id]).to be_a String
|
|
156
|
+
expect(h[:group_id]).to match /^[\d\S]{32}$/
|
|
157
|
+
expect(h[:location]).to eq 'AWS'
|
|
158
|
+
|
|
159
|
+
puts h.inspect
|
|
160
|
+
|
|
161
|
+
@group_id = h[:group_id]
|
|
162
|
+
ensure
|
|
163
|
+
@aws.terminate_instances_by_group_id(h[:group_id], :server)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
context 'server only' do
|
|
170
|
+
before(:all) do
|
|
171
|
+
@config = OpenStudio::Aws::Config.new
|
|
172
|
+
@aws = OpenStudio::Aws::Aws.new
|
|
173
|
+
|
|
174
|
+
@group_id = nil
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
it 'should create allow a zero length worker' do
|
|
178
|
+
begin
|
|
179
|
+
begin
|
|
180
|
+
options = {
|
|
181
|
+
instance_type: 'm3.medium',
|
|
182
|
+
image_id: 'ami-3c0fbf54', # server AMI
|
|
183
|
+
tags: [
|
|
184
|
+
'ci_tests=true',
|
|
185
|
+
'ServerOnly=true'
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
expect { @aws.create_workers(0) }.to raise_error "Can't create workers without a server instance running"
|
|
190
|
+
|
|
191
|
+
test_pem_file = 'ec2_server_key.pem'
|
|
192
|
+
FileUtils.rm_f test_pem_file if File.exist? test_pem_file
|
|
193
|
+
FileUtils.rm_f 'server_data.json' if File.exist? 'server_data.json'
|
|
194
|
+
|
|
195
|
+
@aws.create_server(options)
|
|
196
|
+
|
|
197
|
+
# Still have to call "create workers" or the configuration won't happen.
|
|
198
|
+
@aws.create_workers(0, options)
|
|
199
|
+
|
|
200
|
+
h = @aws.os_aws.server.to_os_hash
|
|
201
|
+
expect(h[:group_id]).to be_a String
|
|
202
|
+
expect(h[:group_id]).to match /^[\d\S]{32}$/
|
|
203
|
+
expect(h[:location]).to eq 'AWS'
|
|
204
|
+
ensure
|
|
205
|
+
@aws.terminate_instances_by_group_id(h[:group_id], :server)
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
124
211
|
# context 'create ebs storage' do
|
|
125
212
|
# before(:all) do
|
|
126
213
|
# @aws = OpenStudio::Aws::Aws.new
|