lib/hako/schedulers/ecs.rb in hako-2.15.1 vs lib/hako/schedulers/ecs.rb in hako-2.16.0

- old
+ new

@@ -70,10 +70,18 @@ @placement_strategy = options.fetch('placement_strategy', []) @scheduling_strategy = options.fetch('scheduling_strategy', nil) @execution_role_arn = options.fetch('execution_role_arn', nil) @cpu = options.fetch('cpu', nil) @memory = options.fetch('memory', nil) + if options.key?('ephemeral_storage') + ephemeral_storage = options.fetch('ephemeral_storage') + if ephemeral_storage.key?('size_in_gi_b') + @ephemeral_storage = { + size_in_gi_b: ephemeral_storage.fetch('size_in_gi_b') + } + end + end @requires_compatibilities = options.fetch('requires_compatibilities', nil) @launch_type = options.fetch('launch_type', nil) if options.key?('capacity_provider_strategy') @capacity_provider_strategy = options.fetch('capacity_provider_strategy').map do |strategy| { @@ -513,10 +521,13 @@ return true end if actual_definition.requires_compatibilities != @requires_compatibilities return true end + if actual_definition.ephemeral_storage != @ephemeral_storage + return true + end actual_tags_set = Set.new(actual_tags.map { |t| { key: t.key, value: t.value } }) tags_set = Set.new(@tags) if actual_tags_set != tags_set return true @@ -555,10 +566,11 @@ container_definitions: definitions, volumes: volumes_definition, requires_compatibilities: @requires_compatibilities, cpu: @cpu, memory: @memory, + ephemeral_storage: @ephemeral_storage, tags: @tags.empty? ? nil : @tags, ).task_definition [true, new_task_definition] else [false, current_task_definition] @@ -591,10 +603,11 @@ container_definitions: definitions, volumes: volumes_definition, requires_compatibilities: @requires_compatibilities, cpu: @cpu, memory: @memory, + ephemeral_storage: @ephemeral_storage, tags: @tags.empty? ? nil : @tags, ).task_definition return [true, new_task_definition] else return [false, current_task_definition] @@ -914,11 +927,11 @@ params[:force_new_deployment] = true end warn_placement_policy_change(current_service) warn_service_registries_change(current_service) if service_changed?(current_service, params) - ecs_client.update_service(params).service + ecs_client.update_service(**params).service else :noop end end @@ -950,11 +963,11 @@ end if @service_discovery @service_discovery.apply params[:service_registries] = @service_discovery.service_registries end - ecs_client.create_service(params).service + ecs_client.create_service(**params).service end # @param [Aws::ECS::Types::Service] service # @param [Hash] params # @return [Boolean] @@ -1320,10 +1333,10 @@ health_check_command_type = definition[:health_check][:command][0] case health_check_command_type when 'NONE' cmd << '--no-healthcheck' when 'CMD', 'CMD-SHELL' - health_check_command = definition[:health_check][:command][1..-1].join(' ') + health_check_command = definition[:health_check][:command][1..].join(' ') cmd << '--health-cmd' << health_check_command.inspect else raise "Health check command type #{health_check_command_type} is not supported. CMD, CMD-SHELL and NONE are supported." end end