stemcell 0.13.0 → 0.13.1
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/.travis.yml +1 -0
- data/CHANGELOG.md +3 -0
- data/lib/stemcell/command_line.rb +1 -0
- data/lib/stemcell/launcher.rb +6 -0
- data/lib/stemcell/option_parser.rb +16 -0
- data/lib/stemcell/version.rb +1 -1
- data/spec/lib/stemcell/launcher_spec.rb +4 -2
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 9942211d9334ce09b4a56299f2bc7e3e903d57eb871a60a8a1228c549e6b1407
         | 
| 4 | 
            +
              data.tar.gz: 3e70bbdc1434124922c4be3cfb29e6842d6cda8210a1555fe3c36e4887740a11
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: c4f0a32c8fe858b23bd3ddbbb30ca752a0b23c0a2782d9fd0cf56d9cda0e344bdaa3c2361b1df9f4d5f5413ca88e15c714c868ee2efaa1b304dd74d248601fdb
         | 
| 7 | 
            +
              data.tar.gz: a9fb4751d0fe25b94f4c47785da168a9e0e909464d0354461adc8db5d01487d5ea696ebcbc79e74267b6ccd114a794a5e5d13ed90bd6b831a20c3bb5ae5b4906
         | 
    
        data/.travis.yml
    CHANGED
    
    
    
        data/CHANGELOG.md
    CHANGED
    
    
| @@ -132,6 +132,7 @@ module Stemcell | |
| 132 132 | 
             
                  # comma-separated list when presented as defaults.
         | 
| 133 133 | 
             
                  pd['security_groups'] &&= pd['security_groups'].join(',')
         | 
| 134 134 | 
             
                  pd['tags'] &&= pd['tags'].to_a.map { |p| p.join('=') }.join(',')
         | 
| 135 | 
            +
                  pd['cpu_options'] &&= pd['cpu_options'].to_a.map { |p| p.join('=') }.join(',')
         | 
| 135 136 | 
             
                  pd['chef_cookbook_attributes'] &&= pd['chef_cookbook_attributes'].join(',')
         | 
| 136 137 | 
             
                end
         | 
| 137 138 |  | 
    
        data/lib/stemcell/launcher.rb
    CHANGED
    
    | @@ -31,6 +31,7 @@ module Stemcell | |
| 31 31 | 
             
                  'chef_environment',
         | 
| 32 32 | 
             
                  'chef_data_bag_secret',
         | 
| 33 33 | 
             
                  'chef_data_bag_secret_path',
         | 
| 34 | 
            +
                  'cpu_options',
         | 
| 34 35 | 
             
                  'git_branch',
         | 
| 35 36 | 
             
                  'git_key',
         | 
| 36 37 | 
             
                  'git_origin',
         | 
| @@ -178,6 +179,11 @@ module Stemcell | |
| 178 179 | 
             
                    launch_options[:block_device_mappings] = opts['block_device_mappings']
         | 
| 179 180 | 
             
                  end
         | 
| 180 181 |  | 
| 182 | 
            +
                  # specify cpu options (optional)
         | 
| 183 | 
            +
                  if opts['cpu_options']
         | 
| 184 | 
            +
                    launch_options[:cpu_options] = opts['cpu_options']
         | 
| 185 | 
            +
                  end
         | 
| 186 | 
            +
             | 
| 181 187 | 
             
                  # specify ephemeral block device mappings (optional)
         | 
| 182 188 | 
             
                  if opts['ephemeral_devices']
         | 
| 183 189 | 
             
                    launch_options[:block_device_mappings] ||= []
         | 
| @@ -187,6 +187,12 @@ module Stemcell | |
| 187 187 | 
             
                    :type  => String,
         | 
| 188 188 | 
             
                    :env   => 'CHEF_DATA_BAG_SECRET_PATH'
         | 
| 189 189 | 
             
                  },
         | 
| 190 | 
            +
                  {
         | 
| 191 | 
            +
                    :name => 'cpu_options',
         | 
| 192 | 
            +
                    :desc => "comma-separated list of cpu option key=value pairs",
         | 
| 193 | 
            +
                    :type => String,
         | 
| 194 | 
            +
                    :env => 'CPU_OPTIONS'
         | 
| 195 | 
            +
                  },
         | 
| 190 196 | 
             
                  {
         | 
| 191 197 | 
             
                    :name => 'chef_role',
         | 
| 192 198 | 
             
                    :desc => "chef role of instance to be launched",
         | 
| @@ -345,6 +351,16 @@ module Stemcell | |
| 345 351 | 
             
                    options['tags'] = tags
         | 
| 346 352 | 
             
                  end
         | 
| 347 353 |  | 
| 354 | 
            +
                  # convert cpu_options from comma separated string to ruby hash
         | 
| 355 | 
            +
                  if options['cpu_options']
         | 
| 356 | 
            +
                    cpu_options = {}
         | 
| 357 | 
            +
                    options['cpu_options'].split(',').each do |cpu_opt|
         | 
| 358 | 
            +
                      key, value = cpu_opt.split('=')
         | 
| 359 | 
            +
                      cpu_options[key] = value
         | 
| 360 | 
            +
                    end
         | 
| 361 | 
            +
                    options['cpu_options'] = cpu_options
         | 
| 362 | 
            +
                  end
         | 
| 363 | 
            +
             | 
| 348 364 | 
             
                  # parse block_device_mappings to convert it from the standard CLI format
         | 
| 349 365 | 
             
                  # to the EC2 Ruby API format.
         | 
| 350 366 | 
             
                  # All of this is a bit hard to find so here are some docs links to
         | 
    
        data/lib/stemcell/version.rb
    CHANGED
    
    
| @@ -71,7 +71,8 @@ describe Stemcell::Launcher do | |
| 71 71 | 
             
                    'count'                   => 2,
         | 
| 72 72 | 
             
                    'security_groups'         => ['sg_name1', 'sg_name2'],
         | 
| 73 73 | 
             
                    'user'                    => 'some_user',
         | 
| 74 | 
            -
                    'wait'                    => true
         | 
| 74 | 
            +
                    'wait'                    => true,
         | 
| 75 | 
            +
                    'cpu_options'             => 'core_count=1,threads_per_core=1'
         | 
| 75 76 | 
             
                  }
         | 
| 76 77 | 
             
                }
         | 
| 77 78 |  | 
| @@ -107,7 +108,8 @@ describe Stemcell::Launcher do | |
| 107 108 | 
             
                            { :key => "stemcell",   :value => Stemcell::VERSION },
         | 
| 108 109 | 
             
                          ]},
         | 
| 109 110 | 
             
                      ],
         | 
| 110 | 
            -
                      :user_data          => Base64.encode64('template')
         | 
| 111 | 
            +
                      :user_data          => Base64.encode64('template'),
         | 
| 112 | 
            +
                      :cpu_options        => 'core_count=1,threads_per_core=1'
         | 
| 111 113 | 
             
                    )).and_return(instances)
         | 
| 112 114 | 
             
                  launched_instances = launcher.send(:launch, launch_options)
         | 
| 113 115 | 
             
                  expect(launched_instances.map(&:public_ip_address)).to all(be_truthy)
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: stemcell
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.13. | 
| 4 | 
            +
              version: 0.13.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Martin Rhoads
         | 
| @@ -11,7 +11,7 @@ authors: | |
| 11 11 | 
             
            autorequire: 
         | 
| 12 12 | 
             
            bindir: bin
         | 
| 13 13 | 
             
            cert_chain: []
         | 
| 14 | 
            -
            date:  | 
| 14 | 
            +
            date: 2022-01-05 00:00:00.000000000 Z
         | 
| 15 15 | 
             
            dependencies:
         | 
| 16 16 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 17 17 | 
             
              name: aws-eventstream
         |