ruby_aem_aws 4.0.2 → 4.0.3
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/conf/gem.yaml +1 -1
- data/lib/ruby_aem_aws/architecture/full_set_stack.rb +0 -6
- metadata +1 -2
- data/lib/ruby_aem_aws/component/chaos_monkey.rb +0 -79
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1756ce4e7ac4e7b4ce39714c8c71933c1fbbf686999e7844a547270e0563e114
|
|
4
|
+
data.tar.gz: aa5cb197ebcfd76bf6e0ca8910b18e0f475cdfc8570947cbe95c76022ec43ba6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8b0d1c7c1dc981a2233bdbe1c4bc75182027ba562d92999a7e77d14c3ac6cd92f14d081ac28ee56914ebcb3b733cea1a038b8657372762e175e255a2cf7ced98
|
|
7
|
+
data.tar.gz: 6bcfd6e7d69a8f9230ecec7c88253b04c3c88bb6545418043d42238d54cfe5b96533765180b43dbd755e7658fa8b19f1ff0bb722ab98145a7f5526682ae99756
|
data/conf/gem.yaml
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
---
|
|
2
|
-
version: 4.0.
|
|
2
|
+
version: 4.0.3
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
require_relative '../component/author_dispatcher'
|
|
16
16
|
require_relative '../component/author'
|
|
17
|
-
require_relative '../component/chaos_monkey'
|
|
18
17
|
require_relative '../component/orchestrator'
|
|
19
18
|
require_relative '../component/publish_dispatcher'
|
|
20
19
|
require_relative '../component/publish'
|
|
@@ -83,11 +82,6 @@ module RubyAemAws
|
|
|
83
82
|
RubyAemAws::Component::Author.new(@stack_prefix, @author_aws_clients)
|
|
84
83
|
end
|
|
85
84
|
|
|
86
|
-
# @return new RubyAemAws::Component::ChaosMonkey instance
|
|
87
|
-
def chaos_monkey
|
|
88
|
-
RubyAemAws::Component::ChaosMonkey.new(@stack_prefix, @aem_java_aws_clients)
|
|
89
|
-
end
|
|
90
|
-
|
|
91
85
|
# @return new RubyAemAws::Component::Orchestrator instance
|
|
92
86
|
def orchestrator
|
|
93
87
|
RubyAemAws::Component::Orchestrator.new(@stack_prefix, @aem_java_aws_clients)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_aem_aws
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.
|
|
4
|
+
version: 4.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shine Solutions
|
|
@@ -219,7 +219,6 @@ files:
|
|
|
219
219
|
- lib/ruby_aem_aws/component/author_primary.rb
|
|
220
220
|
- lib/ruby_aem_aws/component/author_publish_dispatcher.rb
|
|
221
221
|
- lib/ruby_aem_aws/component/author_standby.rb
|
|
222
|
-
- lib/ruby_aem_aws/component/chaos_monkey.rb
|
|
223
222
|
- lib/ruby_aem_aws/component/component_descriptor.rb
|
|
224
223
|
- lib/ruby_aem_aws/component/orchestrator.rb
|
|
225
224
|
- lib/ruby_aem_aws/component/preview_publish.rb
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# Copyright 2018-2021 Shine Solutions Group
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
require_relative '../abstract/grouped_component'
|
|
16
|
-
require_relative '../abstract/snapshot'
|
|
17
|
-
require_relative '../constants'
|
|
18
|
-
require_relative '../mixins/healthy_resource_verifier'
|
|
19
|
-
require_relative '../mixins/metric_verifier'
|
|
20
|
-
require_relative '../mixins/snapshot_verifier'
|
|
21
|
-
|
|
22
|
-
module RubyAemAws
|
|
23
|
-
module Component
|
|
24
|
-
# Interface to the AWS instance running the ChaosMonkey component of a full-set AEM stack.
|
|
25
|
-
class ChaosMonkey
|
|
26
|
-
attr_reader :descriptor, :ec2_resource, :asg_client, :cloud_watch_client, :cloud_watch_log_client
|
|
27
|
-
|
|
28
|
-
include AbstractGroupedComponent
|
|
29
|
-
include AbstractSnapshot
|
|
30
|
-
include HealthyResourceVerifier
|
|
31
|
-
include MetricVerifier
|
|
32
|
-
include SnapshotVerifier
|
|
33
|
-
|
|
34
|
-
EC2_COMPONENT = 'chaos-monkey'.freeze
|
|
35
|
-
EC2_NAME = 'AEM Chaos Monkey'.freeze
|
|
36
|
-
|
|
37
|
-
# @param stack_prefix AWS tag: StackPrefix
|
|
38
|
-
# @param params Array of AWS Clients and Resource connections:
|
|
39
|
-
# - AutoScalingClient: AWS AutoScalingGroup Client.
|
|
40
|
-
# - CloudWatchClient: AWS Cloudwatch Client.
|
|
41
|
-
# - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
|
|
42
|
-
# - Ec2Resource: AWS EC2 Resource connection.
|
|
43
|
-
# @return new RubyAemAws::FullSet::ChaosMonkey
|
|
44
|
-
def initialize(stack_prefix, params)
|
|
45
|
-
@descriptor = ComponentDescriptor.new(stack_prefix,
|
|
46
|
-
EC2Descriptor.new(EC2_COMPONENT, EC2_NAME))
|
|
47
|
-
@asg_client = params[:AutoScalingClient]
|
|
48
|
-
@cloud_watch_client = params[:CloudWatchClient]
|
|
49
|
-
@cloud_watch_log_client = params[:CloudWatchLogsClient]
|
|
50
|
-
@ec2_resource = params[:Ec2Resource]
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def terminate_all_instances
|
|
54
|
-
get_all_instances.each do |i|
|
|
55
|
-
next if i.nil? || i.state.code != Constants::INSTANCE_STATE_CODE_RUNNING
|
|
56
|
-
|
|
57
|
-
i.terminate
|
|
58
|
-
i.wait_until_terminated
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def terminate_random_instance
|
|
63
|
-
instance = get_random_instance
|
|
64
|
-
instance.terminate
|
|
65
|
-
instance.wait_until_terminated
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def get_tags
|
|
69
|
-
tags = []
|
|
70
|
-
get_all_instances.each do |i|
|
|
71
|
-
next if i.nil? || i.state.code != Constants::INSTANCE_STATE_CODE_RUNNING
|
|
72
|
-
|
|
73
|
-
tags.push(i.tags)
|
|
74
|
-
end
|
|
75
|
-
tags
|
|
76
|
-
end
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
end
|