process_bot 0.1.31 → 0.1.34
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/CHANGELOG.md +1 -0
- data/Gemfile.lock +10 -10
- data/README.md +2 -1
- data/lib/process_bot/capistrano/sidekiq.rake +12 -0
- data/lib/process_bot/capistrano/sidekiq_helpers.rb +19 -4
- data/lib/process_bot/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: aa6d1ed1467a0ed8b7f59f249d4bd8223e5f4a9a3de588672bb1c288c8f9958a
|
|
4
|
+
data.tar.gz: 75e6da0f1d23bbbb54fcc0c0ad4d1feab4eeecb8ad1360bb0ab574a0ab541e0a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8937bdd16d154473da1b528c9b99ef5f0ec606201615cb4669e3b251bfa01d3d67edd835e01b91709824a4c660ebda3d54e6db8d43f58804804ccfdd807a20e4
|
|
7
|
+
data.tar.gz: 9dfad8adee572aed628f93fabb211f2e76d9372a201804e89b00e7a8ef5af92683d21ef29db7d34d231b131bb06f2629b776aac6be01e2e0c901d6980020f01d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
|
+
- Add `process_bot:sidekiq:start_current` so failed deploys restart Sidekiq from the currently published release.
|
|
2
3
|
- Drop Ruby 2.x support. Minimum Ruby is now 3.2; CI covers 3.2/3.3/3.4 and RuboCop's `TargetRubyVersion` follows. Shorthand anonymous forwarding (`*, **, &`) is applied where it replaces redundant `*args, **opts, &block` pass-throughs.
|
|
3
4
|
- Fail `start_tcp_server` when another ProcessBot with the same `--id` is already running instead of silently drifting to a new port. Port drift across unrelated services is still supported; drift for a duplicate id was the root cause of Capistrano deploys leaving a stale previous-release ProcessBot alive on a drifted port while every subsequent `stop --port X` hit the wrong instance.
|
|
4
5
|
- Treat legacy ProcessBot titles without `application_basename` as duplicates when they share the same `--id` and control port, and include the same legacy match in forced stop diagnostics.
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
process_bot (0.1.
|
|
4
|
+
process_bot (0.1.34)
|
|
5
5
|
knjrbfw (>= 0.0.116)
|
|
6
6
|
pry
|
|
7
7
|
rake
|
|
@@ -17,8 +17,8 @@ GEM
|
|
|
17
17
|
diff-lcs (1.6.2)
|
|
18
18
|
http2 (0.0.36)
|
|
19
19
|
string-cases (~> 0)
|
|
20
|
-
io-console (0.
|
|
21
|
-
json (2.
|
|
20
|
+
io-console (0.9.2)
|
|
21
|
+
json (2.21.2)
|
|
22
22
|
knjrbfw (0.0.116)
|
|
23
23
|
datet
|
|
24
24
|
http2
|
|
@@ -26,11 +26,11 @@ GEM
|
|
|
26
26
|
ruby_process
|
|
27
27
|
tsafe
|
|
28
28
|
wref (>= 0.0.8)
|
|
29
|
-
language_server-protocol (3.17.0.
|
|
29
|
+
language_server-protocol (3.17.0.6)
|
|
30
30
|
lint_roller (1.1.0)
|
|
31
31
|
method_source (1.1.0)
|
|
32
32
|
parallel (1.28.0)
|
|
33
|
-
parser (3.3.
|
|
33
|
+
parser (3.3.12.0)
|
|
34
34
|
ast (~> 2.4.1)
|
|
35
35
|
racc
|
|
36
36
|
php4r (0.0.4)
|
|
@@ -47,7 +47,7 @@ GEM
|
|
|
47
47
|
rake (13.4.2)
|
|
48
48
|
ref (2.0.0)
|
|
49
49
|
regexp_parser (2.12.0)
|
|
50
|
-
reline (0.
|
|
50
|
+
reline (0.7.0)
|
|
51
51
|
io-console (~> 0.5)
|
|
52
52
|
rspec (3.13.2)
|
|
53
53
|
rspec-core (~> 3.13.0)
|
|
@@ -62,7 +62,7 @@ GEM
|
|
|
62
62
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
63
63
|
rspec-support (~> 3.13.0)
|
|
64
64
|
rspec-support (3.13.7)
|
|
65
|
-
rubocop (1.
|
|
65
|
+
rubocop (1.89.0)
|
|
66
66
|
json (~> 2.3)
|
|
67
67
|
language_server-protocol (~> 3.17.0.2)
|
|
68
68
|
lint_roller (~> 1.1.0)
|
|
@@ -73,12 +73,12 @@ GEM
|
|
|
73
73
|
rubocop-ast (>= 1.49.0, < 2.0)
|
|
74
74
|
ruby-progressbar (~> 1.7)
|
|
75
75
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
76
|
-
rubocop-ast (1.
|
|
76
|
+
rubocop-ast (1.50.0)
|
|
77
77
|
parser (>= 3.3.7.2)
|
|
78
78
|
prism (~> 1.7)
|
|
79
|
-
rubocop-performance (1.
|
|
79
|
+
rubocop-performance (1.27.0)
|
|
80
80
|
lint_roller (~> 1.1)
|
|
81
|
-
rubocop (>= 1.
|
|
81
|
+
rubocop (>= 1.89.0, < 2.0)
|
|
82
82
|
rubocop-ast (>= 1.47.1, < 2.0)
|
|
83
83
|
rubocop-rake (0.7.1)
|
|
84
84
|
lint_roller (~> 1.1)
|
data/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Add to your `deploy.rb`:
|
|
|
26
26
|
```ruby
|
|
27
27
|
after "deploy:starting", "process_bot:sidekiq:graceful"
|
|
28
28
|
after "deploy:published", "process_bot:sidekiq:start"
|
|
29
|
-
after "deploy:failed", "process_bot:sidekiq:
|
|
29
|
+
after "deploy:failed", "process_bot:sidekiq:start_current"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## Usage
|
|
@@ -41,6 +41,7 @@ cap production process_bot:sidekiq:graceful
|
|
|
41
41
|
|
|
42
42
|
ProcessBot provides these Sidekiq tasks:
|
|
43
43
|
- `process_bot:sidekiq:start`
|
|
44
|
+
- `process_bot:sidekiq:start_current` (starts from the currently published release after a failed deploy)
|
|
44
45
|
- `process_bot:sidekiq:stop`
|
|
45
46
|
- `process_bot:sidekiq:graceful` (stops fetching new jobs and waits for running jobs by default)
|
|
46
47
|
- `process_bot:sidekiq:graceful_no_wait` (stops fetching new jobs and returns immediately)
|
|
@@ -71,6 +71,18 @@ namespace :process_bot do
|
|
|
71
71
|
end
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
+
desc "Start Sidekiq and ProcessBot from the currently published release"
|
|
75
|
+
task :start_current do
|
|
76
|
+
on roles fetch(:sidekiq_roles) do |role|
|
|
77
|
+
git_plugin.switch_user(role) do
|
|
78
|
+
fetch(:sidekiq_processes).times do |idx|
|
|
79
|
+
puts "Starting Sidekiq with ProcessBot #{idx} from the currently published release"
|
|
80
|
+
git_plugin.start_current_sidekiq(idx)
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
74
86
|
desc "Ensure the configured number of Sidekiq ProcessBots are running (starts replacements for graceful shutdowns)"
|
|
75
87
|
task :ensure_running do
|
|
76
88
|
on roles fetch(:sidekiq_roles) do |role|
|
|
@@ -140,12 +140,26 @@ module ProcessBot::Capistrano::SidekiqHelpers # rubocop:disable Metrics/ModuleLe
|
|
|
140
140
|
backend.capture(:echo, SSHKit.config.command_map[:bundle]).strip
|
|
141
141
|
end
|
|
142
142
|
|
|
143
|
-
def
|
|
143
|
+
def start_current_sidekiq(idx = 0)
|
|
144
|
+
current_release_path = backend.capture(:readlink, "-f", current_path).strip
|
|
145
|
+
|
|
146
|
+
start_sidekiq(
|
|
147
|
+
idx,
|
|
148
|
+
sidekiq_release_path: current_release_path,
|
|
149
|
+
sidekiq_release_version: File.basename(current_release_path)
|
|
150
|
+
)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def start_sidekiq( # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
|
154
|
+
idx = 0,
|
|
155
|
+
sidekiq_release_path: release_path,
|
|
156
|
+
sidekiq_release_version: nil
|
|
157
|
+
)
|
|
144
158
|
releases = backend.capture(:ls, "-x", releases_path).split
|
|
145
159
|
releases << release_timestamp.to_s if release_timestamp
|
|
146
160
|
releases.uniq
|
|
147
161
|
|
|
148
|
-
latest_release_version = releases.last
|
|
162
|
+
latest_release_version = sidekiq_release_version || releases.last
|
|
149
163
|
raise "Invalid release timestamp: #{release_timestamp}" unless latest_release_version
|
|
150
164
|
|
|
151
165
|
args = [
|
|
@@ -156,7 +170,7 @@ module ProcessBot::Capistrano::SidekiqHelpers # rubocop:disable Metrics/ModuleLe
|
|
|
156
170
|
"--bundle-prefix", SSHKit.config.command_map.prefix[:bundle].join(" "),
|
|
157
171
|
"--sidekiq-environment", fetch(:sidekiq_env),
|
|
158
172
|
"--port", idx + 7050,
|
|
159
|
-
"--release-path",
|
|
173
|
+
"--release-path", sidekiq_release_path
|
|
160
174
|
]
|
|
161
175
|
|
|
162
176
|
# Use screen for logging everything which is why this is disabled
|
|
@@ -184,7 +198,8 @@ module ProcessBot::Capistrano::SidekiqHelpers # rubocop:disable Metrics/ModuleLe
|
|
|
184
198
|
process_bot_args = args.compact.map { |arg| "\"#{arg}\"" }
|
|
185
199
|
|
|
186
200
|
command = "/usr/bin/screen #{screen_args.join(" ")} " \
|
|
187
|
-
"bash -c 'cd #{
|
|
201
|
+
"bash -c 'cd #{sidekiq_release_path} && exec " \
|
|
202
|
+
"#{SSHKit.config.command_map.prefix[:bundle].join(" ")} bundle exec process_bot #{process_bot_args.join(" ")}'"
|
|
188
203
|
|
|
189
204
|
puts "WARNING: A known bug prevents Sidekiq from starting when pty is set (which it is)" if fetch(:pty)
|
|
190
205
|
puts "ProcessBot Sidekiq command: #{command}"
|
data/lib/process_bot/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: process_bot
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.34
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kaspernj
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-08-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: knjrbfw
|