hako 1.5.1 → 1.5.2
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/CHANGELOG.md +4 -0
- data/LICENSE.txt +22 -0
- data/hako.gemspec +1 -0
- data/lib/hako/schedulers/ecs.rb +26 -12
- data/lib/hako/version.rb +1 -1
- metadata +5 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1407a0536a7ceb26b385676d75b54acbc88f01c6
         | 
| 4 | 
            +
              data.tar.gz: 5a66b42284d1e620a07217f9f5d6d6cd3313f788
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f3d0e37907893a6b21ce3440936d54c7737e3ffd2949253681a86013c338a453811ec12e467e4d833f7b34b068cc0de9f1d67d18ff56d0e15db2e4981ba4b43e
         | 
| 7 | 
            +
              data.tar.gz: a319f40f7638445fe2f8e0b95857b9262317db80a6dcc4fa9e7bdcba1b799a1075566b78d539fe1de32c41fc68c666afb966e0874c169732f675108d87474f28
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/LICENSE.txt
    ADDED
    
    | @@ -0,0 +1,22 @@ | |
| 1 | 
            +
            Copyright (c) 2015 Kohei Suzuki
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            MIT License
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            Permission is hereby granted, free of charge, to any person obtaining
         | 
| 6 | 
            +
            a copy of this software and associated documentation files (the
         | 
| 7 | 
            +
            "Software"), to deal in the Software without restriction, including
         | 
| 8 | 
            +
            without limitation the rights to use, copy, modify, merge, publish,
         | 
| 9 | 
            +
            distribute, sublicense, and/or sell copies of the Software, and to
         | 
| 10 | 
            +
            permit persons to whom the Software is furnished to do so, subject to
         | 
| 11 | 
            +
            the following conditions:
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            The above copyright notice and this permission notice shall be
         | 
| 14 | 
            +
            included in all copies or substantial portions of the Software.
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
         | 
| 17 | 
            +
            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
         | 
| 18 | 
            +
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
         | 
| 19 | 
            +
            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
         | 
| 20 | 
            +
            LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
         | 
| 21 | 
            +
            OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
         | 
| 22 | 
            +
            WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         | 
    
        data/hako.gemspec
    CHANGED
    
    | @@ -13,6 +13,7 @@ Gem::Specification.new do |spec| | |
| 13 13 | 
             
              spec.summary       = 'Deploy Docker container'
         | 
| 14 14 | 
             
              spec.description   = 'Deploy Docker container'
         | 
| 15 15 | 
             
              spec.homepage      = 'https://github.com/eagletmt/hako'
         | 
| 16 | 
            +
              spec.license       = 'MIT'
         | 
| 16 17 |  | 
| 17 18 | 
             
              spec.files         = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
         | 
| 18 19 | 
             
              spec.bindir        = 'exe'
         | 
    
        data/lib/hako/schedulers/ecs.rb
    CHANGED
    
    | @@ -435,19 +435,33 @@ module Hako | |
| 435 435 | 
             
                  # @param [Array<Hash>] definitions
         | 
| 436 436 | 
             
                  # @return [Array<Boolean, Aws::ECS::Types::TaskDefinition]
         | 
| 437 437 | 
             
                  def register_task_definition_for_oneshot(definitions)
         | 
| 438 | 
            -
                     | 
| 439 | 
            -
             | 
| 440 | 
            -
             | 
| 441 | 
            -
             | 
| 442 | 
            -
                         | 
| 443 | 
            -
             | 
| 444 | 
            -
             | 
| 445 | 
            -
             | 
| 446 | 
            -
             | 
| 447 | 
            -
             | 
| 448 | 
            -
             | 
| 449 | 
            -
             | 
| 438 | 
            +
                    10.times do |i|
         | 
| 439 | 
            +
                      begin
         | 
| 440 | 
            +
                        family = "#{@app_id}-oneshot"
         | 
| 441 | 
            +
                        current_task_definition = describe_task_definition(family)
         | 
| 442 | 
            +
                        if task_definition_changed?(definitions, current_task_definition)
         | 
| 443 | 
            +
                          new_task_definition = ecs_client.register_task_definition(
         | 
| 444 | 
            +
                            family: family,
         | 
| 445 | 
            +
                            task_role_arn: @task_role_arn,
         | 
| 446 | 
            +
                            container_definitions: definitions,
         | 
| 447 | 
            +
                            volumes: volumes_definition,
         | 
| 448 | 
            +
                          ).task_definition
         | 
| 449 | 
            +
                          return [true, new_task_definition]
         | 
| 450 | 
            +
                        else
         | 
| 451 | 
            +
                          return [false, current_task_definition]
         | 
| 452 | 
            +
                        end
         | 
| 453 | 
            +
                      rescue Aws::ECS::Errors::ClientException => e
         | 
| 454 | 
            +
                        if e.message.include?('Too many concurrent attempts to create a new revision of the specified family')
         | 
| 455 | 
            +
                          Hako.logger.error(e.message)
         | 
| 456 | 
            +
                          interval = 2**i + rand(0.0..10.0)
         | 
| 457 | 
            +
                          Hako.logger.error("Retrying register_task_definition_for_oneshot after #{interval} seconds")
         | 
| 458 | 
            +
                          sleep(interval)
         | 
| 459 | 
            +
                        else
         | 
| 460 | 
            +
                          raise e
         | 
| 461 | 
            +
                        end
         | 
| 462 | 
            +
                      end
         | 
| 450 463 | 
             
                    end
         | 
| 464 | 
            +
                    raise Error.new('Unable to register task definition for oneshot due to too many client errors')
         | 
| 451 465 | 
             
                  end
         | 
| 452 466 |  | 
| 453 467 | 
             
                  # @return [Hash]
         | 
    
        data/lib/hako/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: hako
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.5. | 
| 4 | 
            +
              version: 1.5.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Kohei Suzuki
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2017-06- | 
| 11 | 
            +
            date: 2017-06-08 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: aws-sdk
         | 
| @@ -138,6 +138,7 @@ files: | |
| 138 138 | 
             
            - ".yardopts"
         | 
| 139 139 | 
             
            - CHANGELOG.md
         | 
| 140 140 | 
             
            - Gemfile
         | 
| 141 | 
            +
            - LICENSE.txt
         | 
| 141 142 | 
             
            - README.md
         | 
| 142 143 | 
             
            - Rakefile
         | 
| 143 144 | 
             
            - bin/console
         | 
| @@ -195,7 +196,8 @@ files: | |
| 195 196 | 
             
            - lib/hako/version.rb
         | 
| 196 197 | 
             
            - lib/hako/yaml_loader.rb
         | 
| 197 198 | 
             
            homepage: https://github.com/eagletmt/hako
         | 
| 198 | 
            -
            licenses: | 
| 199 | 
            +
            licenses:
         | 
| 200 | 
            +
            - MIT
         | 
| 199 201 | 
             
            metadata: {}
         | 
| 200 202 | 
             
            post_install_message: 
         | 
| 201 203 | 
             
            rdoc_options: []
         |