web47core 3.2.3.35 → 3.2.3.41
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/app/controllers/status_controller.rb +23 -9
- data/lib/app/models/concerns/aws_configuration.rb +27 -28
- data/lib/web47core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5167f51146e44ae39a5cb3411634be0fcef03e696859bb7eabf9fe7222ad65a0
|
|
4
|
+
data.tar.gz: 4a7c22205a6b2033c41cccce824db4cf6be86e11fec06578165fab0c367aff20
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc25f298a11e9bb9d70feba03cdc92f4bf61918f740e7f40d6eb1fce5bb0d0613933c18e248877bf0fdc3b10cc58711fff64e501eba95c7435830906639e9a1e
|
|
7
|
+
data.tar.gz: 9602c563c2118543ab4cc6858ba668854f599f85342cbf08a08f639d7e2e95093203fafc6e57760c8e93e32e08043c340744e684dd89cfceede3f4a64c5e625f
|
|
@@ -13,7 +13,8 @@ class StatusController < ActionController::Base
|
|
|
13
13
|
redis: redis_status,
|
|
14
14
|
jobs: delayed_jobs_status,
|
|
15
15
|
cron_job_servers: cron_job_servers_status,
|
|
16
|
-
workers: workers_status
|
|
16
|
+
workers: workers_status,
|
|
17
|
+
version: version_status }
|
|
17
18
|
|
|
18
19
|
respond_to do |format|
|
|
19
20
|
format.html { render :index, locals: { components: ui_decorators(components) }, layout: false }
|
|
@@ -105,18 +106,13 @@ class StatusController < ActionController::Base
|
|
|
105
106
|
end
|
|
106
107
|
|
|
107
108
|
#
|
|
108
|
-
# Cron job primary status
|
|
109
|
+
# Cron job primary status. Up or down only. Host, pid, and check-in time stay on the admin page.
|
|
109
110
|
#
|
|
110
111
|
def cron_job_servers_status
|
|
111
112
|
server = cron_job_server
|
|
112
|
-
raise '
|
|
113
|
+
raise 'Down' if server.blank? || server.dead?
|
|
113
114
|
|
|
114
|
-
|
|
115
|
-
raise "Primary Server is DEAD: #{server_info}" if server.dead?
|
|
116
|
-
|
|
117
|
-
report_success "Primary Server is alive: #{server_info}",
|
|
118
|
-
primary_count: 1,
|
|
119
|
-
total_count: Cron::Server.count
|
|
115
|
+
report_success 'Up', primary_count: 1, total_count: Cron::Server.count
|
|
120
116
|
rescue StandardError => error
|
|
121
117
|
report_error(error, primary_count: 0, total_count: Cron::Server.count)
|
|
122
118
|
end
|
|
@@ -138,4 +134,22 @@ class StatusController < ActionController::Base
|
|
|
138
134
|
def cron_job_server
|
|
139
135
|
@cron_job_server ||= Cron::Server.primary_server
|
|
140
136
|
end
|
|
137
|
+
|
|
138
|
+
#
|
|
139
|
+
# Deployed image identity. GIT_SHA and BUILT_AT are injected at image build time.
|
|
140
|
+
# Missing values stay successful so an older task does not fail the health check.
|
|
141
|
+
#
|
|
142
|
+
def version_status
|
|
143
|
+
built_at = ENV['BUILT_AT'].presence
|
|
144
|
+
git_sha = ENV['GIT_SHA'].presence
|
|
145
|
+
report_success(version_message(built_at, git_sha), built_at: built_at, git_sha: git_sha)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def version_message(built_at, git_sha)
|
|
149
|
+
return 'Version not set' if built_at.blank? && git_sha.blank?
|
|
150
|
+
return built_at if git_sha.blank?
|
|
151
|
+
return git_sha if built_at.blank?
|
|
152
|
+
|
|
153
|
+
"#{built_at} #{git_sha}"
|
|
154
|
+
end
|
|
141
155
|
end
|
|
@@ -12,29 +12,32 @@ module AwsConfiguration
|
|
|
12
12
|
# Fields
|
|
13
13
|
#
|
|
14
14
|
field :aws_region, type: String
|
|
15
|
-
field :aws_access_key_id, type: String
|
|
16
|
-
field :aws_secret_access_key, type: String
|
|
17
15
|
field :aws_bucket_name, type: String
|
|
18
16
|
field :aws_min_worker_job_count, type: Integer, default: 1
|
|
19
|
-
field :aws_ecs_cluster_worker_name, type: String
|
|
20
|
-
field :aws_ecs_service_worker_name, type: String
|
|
21
17
|
|
|
22
18
|
validates :aws_min_worker_job_count, numericality: { only_integer: true, greater_than: 0 }
|
|
23
19
|
end
|
|
24
20
|
end
|
|
25
21
|
|
|
26
22
|
#
|
|
27
|
-
#
|
|
23
|
+
# ECS cluster the worker service runs in. Set on the task as ECS_CLUSTER_WORKER_NAME.
|
|
28
24
|
#
|
|
29
|
-
def
|
|
30
|
-
|
|
25
|
+
def aws_ecs_cluster_worker_name
|
|
26
|
+
ENV['ECS_CLUSTER_WORKER_NAME'].presence
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
#
|
|
30
|
+
# ECS service that runs the workers. Set on the task as ECS_SERVICE_WORKER_NAME.
|
|
31
|
+
#
|
|
32
|
+
def aws_ecs_service_worker_name
|
|
33
|
+
ENV['ECS_SERVICE_WORKER_NAME'].presence
|
|
31
34
|
end
|
|
32
35
|
|
|
33
36
|
#
|
|
34
37
|
# Determine if AWS is configured
|
|
35
38
|
#
|
|
36
39
|
def aws_configured?
|
|
37
|
-
|
|
40
|
+
aws_region.present?
|
|
38
41
|
end
|
|
39
42
|
|
|
40
43
|
#
|
|
@@ -45,42 +48,38 @@ module AwsConfiguration
|
|
|
45
48
|
end
|
|
46
49
|
|
|
47
50
|
# @abstract EC2 Client
|
|
48
|
-
# @
|
|
49
|
-
|
|
51
|
+
# @param desired_region [String, nil] region to connect to; defaults to the configured aws_region
|
|
52
|
+
# @return [Aws::EC2::Client, nil]
|
|
53
|
+
def aws_ec2_client(desired_region: nil)
|
|
50
54
|
return nil unless aws_configured?
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
credentials: Aws::Credentials.new(aws_access_key_id,
|
|
54
|
-
aws_secret_access_key))
|
|
56
|
+
Aws::EC2::Client.new(region: desired_region.presence || aws_region)
|
|
55
57
|
end
|
|
56
58
|
|
|
57
59
|
# @abstract S3 Client
|
|
58
|
-
# @
|
|
59
|
-
|
|
60
|
+
# @param desired_region [String, nil] region to connect to; defaults to the configured aws_region
|
|
61
|
+
# @return [Aws::S3::Client, nil]
|
|
62
|
+
def aws_s3_client(desired_region: nil)
|
|
60
63
|
return nil unless aws_configured?
|
|
61
64
|
|
|
62
|
-
|
|
63
|
-
access_key_id: aws_access_key_id,
|
|
64
|
-
secret_access_key: aws_secret_access_key)
|
|
65
|
+
Aws::S3::Client.new(region: desired_region.presence || aws_region)
|
|
65
66
|
end
|
|
66
67
|
|
|
67
68
|
# @abstract ECS Client
|
|
68
|
-
# @
|
|
69
|
-
|
|
69
|
+
# @param desired_region [String, nil] region to connect to; defaults to the configured aws_region
|
|
70
|
+
# @return [Aws::ECS::Client, nil]
|
|
71
|
+
def aws_ecs_client(desired_region: nil)
|
|
70
72
|
return nil unless aws_configured?
|
|
71
73
|
|
|
72
|
-
|
|
73
|
-
access_key_id: aws_access_key_id,
|
|
74
|
-
secret_access_key: aws_secret_access_key)
|
|
74
|
+
Aws::ECS::Client.new(region: desired_region.presence || aws_region)
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
# @abstract AutoScaling Client
|
|
78
|
-
# @
|
|
79
|
-
|
|
78
|
+
# @param desired_region [String, nil] region to connect to; defaults to the configured aws_region
|
|
79
|
+
# @return [Aws::AutoScaling::Client, nil]
|
|
80
|
+
def aws_auto_scale_client(desired_region: nil)
|
|
80
81
|
return nil unless aws_configured?
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
secret_access_key: aws_secret_access_key,
|
|
84
|
-
region: aws_region)
|
|
83
|
+
Aws::AutoScaling::Client.new(region: desired_region.presence || aws_region)
|
|
85
84
|
end
|
|
86
85
|
end
|
data/lib/web47core/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: web47core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.2.3.
|
|
4
|
+
version: 3.2.3.41
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Schroeder
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|