hako 2.15.1 → 2.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c14a60c35c89be5465d9844da304c8dad15dce069edf54ccbba7f47376dc536
4
- data.tar.gz: c9714116d65bc4d3746cbc968a0bd0315cd3677d3e5042e0937e4cfd29a48620
3
+ metadata.gz: 247a60cab9d7f9bec3f63bb9858453499066c9b54d23ce9f1d8bae69c133973a
4
+ data.tar.gz: c004ff0c4aac3d742f89f4eeb455ff189acebabc0d398dc586eb835902129577
5
5
  SHA512:
6
- metadata.gz: 12f663b6e4c17872e8d117f0a5fb4049b786e4af0e76ac7ff0b0d9bcb490299da15c0bc24a86a8a16a7d286585e9b428b68eba6121ed0212d353027db049cbe9
7
- data.tar.gz: ee0bc9a4692583f332ac08060088f3e5374fd2297d6c54b9208ec529a813413ee11f3847788b32aa43f5c1d7b40814889de86b9290c4000707060ea51a68e8cb
6
+ metadata.gz: c3a12ca201d09312f3c71e18e7418941aaf9330ad99d7acccb32094f0579d3085817004cea7209691d43a4f00f3181c242fbe452cc856ae9aad723bbf05d829b
7
+ data.tar.gz: a110da777e6ab79a3af3a3ebd6d6923e2428b59947208ad0bf771577bb45fb775ccbe723d0377d32e6b3df52419914e60ff1681a574db304763f11d13c3b6bf4
@@ -3,25 +3,20 @@ name: CI
3
3
  on:
4
4
  push:
5
5
  branches:
6
- pull_request:
6
+ pull_request:
7
7
 
8
8
  jobs:
9
9
  rspec:
10
10
  name: RSpec
11
11
  runs-on: ubuntu-latest
12
- continue-on-error: ${{ matrix.experimental }}
13
12
  strategy:
14
13
  fail-fast: false
15
14
  matrix:
16
15
  ruby:
17
- - 2.5
18
- - 2.6
19
- - 2.7
20
- - 3.0
21
- experimental: [false]
22
- include:
23
- - ruby: head
24
- experimental: true
16
+ - '2.6'
17
+ - '2.7'
18
+ - '3.0'
19
+ - '3.1'
25
20
  steps:
26
21
  - uses: actions/checkout@v2
27
22
  - uses: ruby/setup-ruby@v1
@@ -37,6 +32,6 @@ jobs:
37
32
  - uses: ruby/setup-ruby@v1
38
33
  with:
39
34
  # Use the same version with .rubocop.yml
40
- ruby-version: 2.5
35
+ ruby-version: 2.6
41
36
  bundler-cache: true
42
37
  - run: bundle exec rubocop
data/.rubocop.yml CHANGED
@@ -2,7 +2,7 @@ inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
4
  DisplayCopNames: true
5
- TargetRubyVersion: 2.5
5
+ TargetRubyVersion: 2.6
6
6
  NewCops: disable
7
7
 
8
8
  Layout/FirstArgumentIndentation:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 2.16.0 (2022-05-02)
2
+ ## New features
3
+ - Support ephemeral_storage option in ECS scheduler
4
+
5
+ ## Bug fixes
6
+ - Fix keyword arguments for Ruby 3.0
7
+
8
+ ## Changes
9
+ - Drop support for Ruby 2.5 (EOL on 2021-04-05)
10
+
1
11
  # 2.15.1 (2021-08-06)
2
12
  ## Bug fixes
3
13
  - Fix keyword arguments for Ruby 3.0
@@ -7,6 +7,9 @@
7
7
  execution_role_arn: 'arn:aws:iam::012345678901:role/ecsTaskExecutionRole',
8
8
  cpu: '1024',
9
9
  memory: '2048',
10
+ ephemeral_storage: {
11
+ size_in_gi_b: '25',
12
+ },
10
13
  requires_compatibilities: ['FARGATE'],
11
14
  network_mode: 'awsvpc',
12
15
  launch_type: 'FARGATE',
@@ -51,6 +51,9 @@ local awslogs = {
51
51
  execution_role_arn: 'arn:aws:iam::012345678901:role/ecsTaskExecutionRole',
52
52
  cpu: '1024',
53
53
  memory: '2048',
54
+ ephemeral_storage: {
55
+ size_in_gi_b: '25',
56
+ },
54
57
  requires_compatibilities: ['FARGATE'],
55
58
  network_mode: 'awsvpc',
56
59
  launch_type: 'FARGATE',
data/hako.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.bindir = 'exe'
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ['lib']
22
- spec.required_ruby_version = '>= 2.5.0'
22
+ spec.required_ruby_version = '>= 2.6.0'
23
23
 
24
24
  spec.add_dependency 'aws-sdk-applicationautoscaling'
25
25
  spec.add_dependency 'aws-sdk-autoscaling'
@@ -72,6 +72,14 @@ module Hako
72
72
  @execution_role_arn = options.fetch('execution_role_arn', nil)
73
73
  @cpu = options.fetch('cpu', nil)
74
74
  @memory = options.fetch('memory', nil)
75
+ if options.key?('ephemeral_storage')
76
+ ephemeral_storage = options.fetch('ephemeral_storage')
77
+ if ephemeral_storage.key?('size_in_gi_b')
78
+ @ephemeral_storage = {
79
+ size_in_gi_b: ephemeral_storage.fetch('size_in_gi_b')
80
+ }
81
+ end
82
+ end
75
83
  @requires_compatibilities = options.fetch('requires_compatibilities', nil)
76
84
  @launch_type = options.fetch('launch_type', nil)
77
85
  if options.key?('capacity_provider_strategy')
@@ -515,6 +523,9 @@ module Hako
515
523
  if actual_definition.requires_compatibilities != @requires_compatibilities
516
524
  return true
517
525
  end
526
+ if actual_definition.ephemeral_storage != @ephemeral_storage
527
+ return true
528
+ end
518
529
 
519
530
  actual_tags_set = Set.new(actual_tags.map { |t| { key: t.key, value: t.value } })
520
531
  tags_set = Set.new(@tags)
@@ -557,6 +568,7 @@ module Hako
557
568
  requires_compatibilities: @requires_compatibilities,
558
569
  cpu: @cpu,
559
570
  memory: @memory,
571
+ ephemeral_storage: @ephemeral_storage,
560
572
  tags: @tags.empty? ? nil : @tags,
561
573
  ).task_definition
562
574
  [true, new_task_definition]
@@ -593,6 +605,7 @@ module Hako
593
605
  requires_compatibilities: @requires_compatibilities,
594
606
  cpu: @cpu,
595
607
  memory: @memory,
608
+ ephemeral_storage: @ephemeral_storage,
596
609
  tags: @tags.empty? ? nil : @tags,
597
610
  ).task_definition
598
611
  return [true, new_task_definition]
@@ -916,7 +929,7 @@ module Hako
916
929
  warn_placement_policy_change(current_service)
917
930
  warn_service_registries_change(current_service)
918
931
  if service_changed?(current_service, params)
919
- ecs_client.update_service(params).service
932
+ ecs_client.update_service(**params).service
920
933
  else
921
934
  :noop
922
935
  end
@@ -952,7 +965,7 @@ module Hako
952
965
  @service_discovery.apply
953
966
  params[:service_registries] = @service_discovery.service_registries
954
967
  end
955
- ecs_client.create_service(params).service
968
+ ecs_client.create_service(**params).service
956
969
  end
957
970
 
958
971
  # @param [Aws::ECS::Types::Service] service
@@ -1322,7 +1335,7 @@ module Hako
1322
1335
  when 'NONE'
1323
1336
  cmd << '--no-healthcheck'
1324
1337
  when 'CMD', 'CMD-SHELL'
1325
- health_check_command = definition[:health_check][:command][1..-1].join(' ')
1338
+ health_check_command = definition[:health_check][:command][1..].join(' ')
1326
1339
  cmd << '--health-cmd' << health_check_command.inspect
1327
1340
  else
1328
1341
  raise "Health check command type #{health_check_command_type} is not supported. CMD, CMD-SHELL and NONE are supported."
@@ -127,7 +127,7 @@ module Hako
127
127
  end
128
128
 
129
129
  unless listener_ports.include?(params[:port])
130
- listener = elb_client.create_listener(params).listeners[0]
130
+ listener = elb_client.create_listener(**params).listeners[0]
131
131
  Hako.logger.info("Created listener #{listener.listener_arn}")
132
132
  end
133
133
  end
@@ -134,7 +134,7 @@ module Hako
134
134
  condition: 'EQ',
135
135
  ],
136
136
  }
137
- services = service_discovery_client.list_services(params).flat_map(&:services)
137
+ services = service_discovery_client.list_services(**params).flat_map(&:services)
138
138
  services.find { |service| service.name == service_name }
139
139
  end
140
140
 
@@ -146,7 +146,7 @@ module Hako
146
146
  # @param [Hash] service
147
147
  # @return [Aws::ServiceDiscovery::Types::Service]
148
148
  def create_service(service)
149
- service_discovery_client.create_service(create_service_params(service)).service
149
+ service_discovery_client.create_service(**create_service_params(service)).service
150
150
  end
151
151
 
152
152
  # @param [Hash] service
@@ -107,7 +107,7 @@ module Hako
107
107
 
108
108
  # @return [String]
109
109
  def render
110
- ERB.new(File.read(nginx_conf_erb), nil, '-').result(binding)
110
+ ERB.new(File.read(nginx_conf_erb), trim_mode: '-').result(binding)
111
111
  end
112
112
 
113
113
  private
@@ -150,7 +150,7 @@ module Hako
150
150
  # @param [Location] location
151
151
  # @return [String]
152
152
  def render_location(listen_spec, location)
153
- ERB.new(File.read(nginx_location_conf_erb), nil, '-').result(binding).each_line.map do |line|
153
+ ERB.new(File.read(nginx_location_conf_erb), trim_mode: '-').result(binding).each_line.map do |line|
154
154
  " #{line}"
155
155
  end.join('')
156
156
  end
data/lib/hako/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hako
4
- VERSION = '2.15.1'
4
+ VERSION = '2.16.0'
5
5
  end
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: 2.15.1
4
+ version: 2.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Suzuki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-06 00:00:00.000000000 Z
11
+ date: 2022-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-applicationautoscaling
@@ -377,14 +377,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
377
377
  requirements:
378
378
  - - ">="
379
379
  - !ruby/object:Gem::Version
380
- version: 2.5.0
380
+ version: 2.6.0
381
381
  required_rubygems_version: !ruby/object:Gem::Requirement
382
382
  requirements:
383
383
  - - ">="
384
384
  - !ruby/object:Gem::Version
385
385
  version: '0'
386
386
  requirements: []
387
- rubygems_version: 3.2.21
387
+ rubygems_version: 3.0.3.1
388
388
  signing_key:
389
389
  specification_version: 4
390
390
  summary: Deploy Docker container