config_o_mat 0.4.1 → 0.4.4

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: df6fa2a90625e5927b75d670dce66e5e4823cdb9af32ce64f1bdae0280a3146d
4
- data.tar.gz: ac2ec11e30427a04952478b8b4293eb9be53ba6af3299ac8a7e6156f6eca14ac
3
+ metadata.gz: f6e9883d10f0ab6349aa447ef2b199692e05c02aeb8f17a95b8c1a7825ffab9b
4
+ data.tar.gz: 2486dea3da2ad9f2113e88d966efcff92616fd1baec02e1ac4dacf392df19710
5
5
  SHA512:
6
- metadata.gz: f9efe6b0f7c05308fe8acfd7e569ca95adb3c85f8952fd70a820ef82f652054c0428ce0c7e773248c1e31d8e47c01d3a70791fedf34266016eeab07fe73eb224
7
- data.tar.gz: a43d73f798e16f4388551666da9a8d573fa3e97442288a3d8b215014fa4593dbe07253c2cde4346146b79871b4daba3856342cf41588a6d43d18f7df01c40755
6
+ metadata.gz: edfc8bb95b506e73c191fba4f476e38cc18d3478a2917d159ee448e9392662c042b00991c1ad5f985b29c73f988a580c8fff1814155a71c3f120dc6dd0a117c2
7
+ data.tar.gz: 80df6494340c67f9ea7b57b558080ae3e369d0249e9505511db33c7c070fc434144c3bba096adff07176a66085b57bbc4a8013329453b57343ef0024305018e5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## 0.4.4
2
+
3
+ BUG FIXES:
4
+
5
+ * Fix MetaConfigurator with new GC parameters.
6
+
7
+ ## 0.4.3
8
+
9
+ BUG FIXES:
10
+
11
+ * Fix MetaConfigurator with new GC parameters.
12
+
13
+ ## 0.4.2
14
+
15
+ NEW FEATURES:
16
+
17
+ * gc_compact configuration variable. If set, will run `GC.compact` every given number of ticks (roughly seconds).
18
+ * gc_stat configuration variable. If set, will log `GC.stat` at the info level every given number of ticks (roughly seconds).
19
+
20
+ ENHANCEMENTS:
21
+
22
+ * Now remove ec2_metadata.iam key from Facter. This value updated every hour or so causing spurious template regeneration and did not contain actionable information.
23
+
1
24
  ## 0.4.1
2
25
 
3
26
  ENHANCEMENTS:
@@ -26,7 +26,7 @@ module ConfigOMat
26
26
  :generated_templates, :services_to_reload, :profiles_to_apply,
27
27
  :last_refresh_time, :next_state, :retry_count, :retries_left, :retry_wait,
28
28
  :region, :appconfig_client, :secretsmanager_client, :systemd_interface,
29
- :secrets_loader_memory
29
+ :secrets_loader_memory, :gc_compact, :gc_stat
30
30
 
31
31
  def initialize(
32
32
  argv: [],
@@ -58,7 +58,9 @@ module ConfigOMat
58
58
  appconfig_client: nil,
59
59
  secretsmanager_client: nil,
60
60
  systemd_interface: nil,
61
- secrets_loader_memory: nil
61
+ secrets_loader_memory: nil,
62
+ gc_compact: 0,
63
+ gc_stat: 0
62
64
  )
63
65
  super()
64
66
 
@@ -92,6 +94,8 @@ module ConfigOMat
92
94
  @secretsmanager_client = secretsmanager_client
93
95
  @systemd_interface = systemd_interface
94
96
  @secrets_loader_memory = secrets_loader_memory
97
+ @gc_compact = gc_compact
98
+ @gc_stat = gc_stat
95
99
  end
96
100
  end
97
101
  end
@@ -23,7 +23,7 @@ module ConfigOMat
23
23
  class NextTick < LifecycleVM::OpBase
24
24
  PAUSE_INTERVAL = 1
25
25
 
26
- reads :last_refresh_time, :refresh_interval, :run_count, :retry_count
26
+ reads :last_refresh_time, :refresh_interval, :run_count, :retry_count, :gc_stat, :gc_compact
27
27
  writes :next_state, :run_count, :retries_left
28
28
 
29
29
  def call
@@ -31,6 +31,16 @@ module ConfigOMat
31
31
 
32
32
  SdNotify.watchdog
33
33
 
34
+ if gc_compact > 0 && run_count % gc_compact == 0
35
+ response = GC.compact
36
+ logger&.info(:gc_compact, compact: response)
37
+ end
38
+
39
+ if gc_stat > 0 && run_count % gc_stat == 0
40
+ response = GC.stat
41
+ logger&.info(:gc_stat, stat: response)
42
+ end
43
+
34
44
  # If we got here then our retry process has succeeded.
35
45
  self.retries_left = retry_count
36
46
 
@@ -23,7 +23,7 @@ module ConfigOMat
23
23
  :systemd_directory, :logs_directory, :profile_defs,
24
24
  :template_defs, :service_defs, :dependencies, :refresh_interval,
25
25
  :client_id, :retry_count, :retries_left, :retry_wait,
26
- :region, :systemd_interface
26
+ :region, :systemd_interface, :gc_stat, :gc_compact
27
27
 
28
28
  def initialize(
29
29
  argv: [],
@@ -44,7 +44,9 @@ module ConfigOMat
44
44
  retries_left: 3,
45
45
  retry_wait: 2,
46
46
  region: nil,
47
- systemd_interface: nil
47
+ systemd_interface: nil,
48
+ gc_stat: 0,
49
+ gc_copmact: 0
48
50
  )
49
51
  super()
50
52
 
@@ -67,6 +69,8 @@ module ConfigOMat
67
69
  @retry_wait = retry_wait
68
70
  @region = region
69
71
  @systemd_interface = systemd_interface
72
+ @gc_stat = gc_stat
73
+ @gc_compact = gc_compact
70
74
  end
71
75
  end
72
76
  end
@@ -63,7 +63,7 @@ module ConfigOMat
63
63
  reads :configuration_directory, :logs_directory, :env
64
64
  writes :profile_defs, :template_defs, :service_defs, :dependencies,
65
65
  :refresh_interval, :client_id, :logger, :retry_count, :retries_left,
66
- :retry_wait, :region, :systemd_interface
66
+ :retry_wait, :region, :systemd_interface, :gc_stat, :gc_compact
67
67
 
68
68
  def call
69
69
  default_config = {
@@ -74,7 +74,9 @@ module ConfigOMat
74
74
  services: [],
75
75
  templates: [],
76
76
  profiles: [],
77
- region: nil
77
+ region: nil,
78
+ gc_compact: 0,
79
+ gc_stat: 0
78
80
  }
79
81
 
80
82
  # TODO: I would like to make this configurable. I think the trick
@@ -174,6 +176,8 @@ module ConfigOMat
174
176
  self.retries_left = retry_count
175
177
  self.retry_wait = merged_config[:retry_wait]
176
178
  self.region = merged_config[:region]
179
+ self.gc_stat = merged_config[:gc_stat]
180
+ self.gc_compact = merged_config[:gc_compact]
177
181
 
178
182
  self.dependencies = service_defs.each_with_object({}) do |(name, service), template_to_services|
179
183
  service.templates.each do |template|
@@ -195,7 +195,7 @@ module ConfigOMat
195
195
  class LoadedFacterProfile < ConfigItem
196
196
  CLEAR_FROM_FACTER = [
197
197
  "memoryfree", "memoryfree_mb", "load_averages", "uptime", "system_uptime", "uptime_seconds", "uptime_hours", "uptime_days",
198
- {"ec2_metadata" => ["identity-credentials"]},
198
+ {"ec2_metadata" => ["identity-credentials", "iam"]},
199
199
  {"memory" => [{"system" => ["capacity", "available_bytes", "used", "used_bytes", "available"] }] }
200
200
  ].freeze
201
201
 
@@ -15,5 +15,5 @@
15
15
  # limitations under the License.
16
16
 
17
17
  module ConfigOMat
18
- VERSION = "0.4.1"
18
+ VERSION = "0.4.4"
19
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_o_mat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Scarborough
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-08 00:00:00.000000000 Z
11
+ date: 2022-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-appconfig