sidekiq_alive 0.1.0
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 +7 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +49 -0
- data/LICENSE.txt +21 -0
- data/README.md +141 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/sidekiq_alive.rb +68 -0
- data/lib/sidekiq_alive/server.rb +46 -0
- data/lib/sidekiq_alive/version.rb +3 -0
- data/lib/sidekiq_alive/worker.rb +18 -0
- data/sidekiq_alive.gemspec +38 -0
- metadata +140 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0a44c1e18d7a26b469ed2eb4a99d6c5d9feeca58
|
4
|
+
data.tar.gz: 870314a23499da71ff34ad9a5c5fa3124dc16b93
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a434f4c9fbcb140ca1d070ac7b83aae54531c955b0ce4bfb673f705a4988adb91177bc5a6beb491be0985fcbce88024125869d230f7428727f954ec796b1d915
|
7
|
+
data.tar.gz: b35a6b390fc8d615d1f6bcd4ef97b07d8bac87968872358a451a806e26dd32dc5df53d3f2afc7308947a29dfd5478a6da4f60440a98e1974a35c8621297e37ad
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at arturictus@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sidekiq_alive (0.1.0)
|
5
|
+
sidekiq
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
concurrent-ruby (1.0.5)
|
11
|
+
connection_pool (2.2.1)
|
12
|
+
diff-lcs (1.3)
|
13
|
+
mock_redis (0.18.0)
|
14
|
+
rack (1.6.8)
|
15
|
+
rack-protection (1.5.3)
|
16
|
+
rack
|
17
|
+
rake (10.5.0)
|
18
|
+
redis (3.3.5)
|
19
|
+
rspec (3.7.0)
|
20
|
+
rspec-core (~> 3.7.0)
|
21
|
+
rspec-expectations (~> 3.7.0)
|
22
|
+
rspec-mocks (~> 3.7.0)
|
23
|
+
rspec-core (3.7.1)
|
24
|
+
rspec-support (~> 3.7.0)
|
25
|
+
rspec-expectations (3.7.0)
|
26
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
+
rspec-support (~> 3.7.0)
|
28
|
+
rspec-mocks (3.7.0)
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
+
rspec-support (~> 3.7.0)
|
31
|
+
rspec-support (3.7.1)
|
32
|
+
sidekiq (4.2.10)
|
33
|
+
concurrent-ruby (~> 1.0)
|
34
|
+
connection_pool (~> 2.2, >= 2.2.0)
|
35
|
+
rack-protection (>= 1.5.0)
|
36
|
+
redis (~> 3.2, >= 3.2.1)
|
37
|
+
|
38
|
+
PLATFORMS
|
39
|
+
ruby
|
40
|
+
|
41
|
+
DEPENDENCIES
|
42
|
+
bundler (~> 1.16)
|
43
|
+
mock_redis
|
44
|
+
rake (~> 10.0)
|
45
|
+
rspec (~> 3.0)
|
46
|
+
sidekiq_alive!
|
47
|
+
|
48
|
+
BUNDLED WITH
|
49
|
+
1.16.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Artur Pañach
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
# SidekiqAlive
|
2
|
+
|
3
|
+
SidekiqAlive offers a solution to add liveness probe for a Sidekiq instance deployed in Kubernetes.
|
4
|
+
|
5
|
+
__How?__
|
6
|
+
|
7
|
+
A http server is started and on each requests validates that a liveness key is stored in Redis. If it is there means is working.
|
8
|
+
|
9
|
+
A Sidekiq job is the responsable to storing this key. If Sidekiq stops processing jobs
|
10
|
+
this key gets expired by Redis an consequently the http server will return a 500 error.
|
11
|
+
|
12
|
+
This Job is responsible to requeue itself for the next liveness probe.
|
13
|
+
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
Add this line to your application's Gemfile:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem 'sidekiq_alive'
|
21
|
+
```
|
22
|
+
|
23
|
+
And then execute:
|
24
|
+
|
25
|
+
$ bundle
|
26
|
+
|
27
|
+
Or install it yourself as:
|
28
|
+
|
29
|
+
$ gem install sidekiq_alive
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
33
|
+
### start the server
|
34
|
+
|
35
|
+
rails example:
|
36
|
+
|
37
|
+
`config/initializers/sidekiq.rb`
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
SidekiqAlive..start
|
41
|
+
```
|
42
|
+
|
43
|
+
### Run the job for first time
|
44
|
+
|
45
|
+
It should only be run on the first time you deploy the app.
|
46
|
+
It would reschedule itself.
|
47
|
+
|
48
|
+
rails example:
|
49
|
+
```
|
50
|
+
$ bundle exec rails console
|
51
|
+
|
52
|
+
#=> SidekiqAlive.perform_now
|
53
|
+
```
|
54
|
+
|
55
|
+
### Kubernetes setup
|
56
|
+
|
57
|
+
Set `livenessProbe` in your Kubernetes deployment
|
58
|
+
|
59
|
+
example with recommended setup:
|
60
|
+
|
61
|
+
```yaml
|
62
|
+
spec:
|
63
|
+
containers:
|
64
|
+
- name: my_app
|
65
|
+
image: my_app:latest
|
66
|
+
env:
|
67
|
+
- name: RAILS_ENV
|
68
|
+
value: production
|
69
|
+
command:
|
70
|
+
- bundle
|
71
|
+
- exec
|
72
|
+
- sidekiq
|
73
|
+
ports:
|
74
|
+
- containerPort: 7433
|
75
|
+
livenessProbe:
|
76
|
+
httpGet:
|
77
|
+
path: /
|
78
|
+
port: 7433
|
79
|
+
initialDelaySeconds: 80 # app specific. Time your sidekiq takes to start processing.
|
80
|
+
timeoutSeconds: 5 # can be much less
|
81
|
+
readinessProbe:
|
82
|
+
httpGet:
|
83
|
+
path: /
|
84
|
+
port: 7433
|
85
|
+
initialDelaySeconds: 80 # app specific
|
86
|
+
timeoutSeconds: 5 # can be much less
|
87
|
+
lifecycle:
|
88
|
+
preStop:
|
89
|
+
exec:
|
90
|
+
# SIGTERM triggers a quick exit; gracefully terminate instead
|
91
|
+
command: ["bundle", "exec", "sidekiqctl", "quiet"]
|
92
|
+
terminationGracePeriodSeconds: 60 # put your longest Job time here plus security time.
|
93
|
+
```
|
94
|
+
|
95
|
+
## Options
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
SidekiqAlive.setup do |config|
|
99
|
+
# ==> Server port
|
100
|
+
# port to bind the server
|
101
|
+
# default: 7433
|
102
|
+
#
|
103
|
+
# config.port = 7433
|
104
|
+
|
105
|
+
# ==> Liveness key
|
106
|
+
# Key to be stored in Redis as probe of liveness
|
107
|
+
# default: "SIDEKIQ::LIVENESS_PROBE_TIMESTAMP"
|
108
|
+
#
|
109
|
+
# config.liveness_key = "SIDEKIQ::LIVENESS_PROBE_TIMESTAMP"
|
110
|
+
|
111
|
+
# ==> Time to live
|
112
|
+
# Time for the key to be kept by Redis.
|
113
|
+
# Here is where you can set de periodicity that the Sidekiq has to probe it is working
|
114
|
+
# Time unit: seconds
|
115
|
+
# default: 10 * 60 # 10 minutes
|
116
|
+
#
|
117
|
+
# config.time_to_live = 10 * 60
|
118
|
+
|
119
|
+
# ==> Callback
|
120
|
+
# After the key is stored in redis you can perform anything.
|
121
|
+
# For example a webhook or email to notify the team
|
122
|
+
# default: proc {}
|
123
|
+
#
|
124
|
+
# require 'net/http'
|
125
|
+
# config.callback = proc { Net::HTTP.get("https://status.com/ping") }
|
126
|
+
end
|
127
|
+
```
|
128
|
+
|
129
|
+
## Development
|
130
|
+
|
131
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
132
|
+
|
133
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
134
|
+
|
135
|
+
## Contributing
|
136
|
+
|
137
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/arturictus/sidekiq_alive. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
138
|
+
|
139
|
+
## License
|
140
|
+
|
141
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "sidekiq_alive"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
require "sidekiq_alive/version"
|
2
|
+
require 'sidekiq'
|
3
|
+
|
4
|
+
module SidekiqAlive
|
5
|
+
def self.start
|
6
|
+
Sidekiq.configure_server do |config|
|
7
|
+
config.on(:startup) do
|
8
|
+
SidekiqAlive::Server.start
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.store_alive_key
|
14
|
+
redis.set(liveness_key,
|
15
|
+
Time.now.to_i,
|
16
|
+
{ ex: time_to_live.to_i })
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.redis
|
20
|
+
Sidekiq.redis { |r| r }
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.alive?
|
24
|
+
redis.ttl(liveness_key) == -2 ? false : true
|
25
|
+
end
|
26
|
+
|
27
|
+
# CONFIG ---------------------------------------
|
28
|
+
|
29
|
+
def self.setup
|
30
|
+
yield(self)
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.port=(port)
|
34
|
+
@port = port
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.port
|
38
|
+
@port || 7433
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.liveness_key=(key)
|
42
|
+
@liveness_key = key
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.liveness_key
|
46
|
+
@liveness_key || "SIDEKIQ::LIVENESS_PROBE_TIMESTAMP"
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.time_to_live=(time)
|
50
|
+
@time_to_live = time
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.time_to_live
|
54
|
+
@time_to_live || 10 * 60
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.callback=(block)
|
58
|
+
@after_storing_key = block
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.callback
|
62
|
+
@after_storing_key || proc {} # do nothing
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
require 'sidekiq_alive/server'
|
68
|
+
require 'sidekiq_alive/worker'
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module SidekiqAlive
|
2
|
+
module Server
|
3
|
+
def self.start
|
4
|
+
require 'socket'
|
5
|
+
Sidekiq::Logging.logger.info "Starting liveness server on #{config.port}"
|
6
|
+
store_alive_key # initial livenessProbe to avoid to kill the instance before it triggers the first liveness
|
7
|
+
|
8
|
+
# Start Server
|
9
|
+
Thread.start do
|
10
|
+
server = TCPServer.new('0.0.0.0', config.port)
|
11
|
+
loop do
|
12
|
+
Thread.start(server.accept) do |socket|
|
13
|
+
request = socket.gets # Read the first line of the request (the Request-Line)
|
14
|
+
if config.alive?
|
15
|
+
status = "200 OK"
|
16
|
+
response = "Alive!\n"
|
17
|
+
else
|
18
|
+
status = "500 ERROR"
|
19
|
+
response = "Looks like sidekiq is not working\n"
|
20
|
+
Sidekiq::Logging.logger.error response
|
21
|
+
end
|
22
|
+
socket.print "HTTP/1.1 #{status}\r\n" +
|
23
|
+
"Content-Type: text/plain\r\n" +
|
24
|
+
"Content-Length: #{response.bytesize}\r\n" +
|
25
|
+
"Connection: close\r\n"
|
26
|
+
socket.print "\r\n" # blank line separates the header from the body, as required by the protocol
|
27
|
+
socket.print response
|
28
|
+
socket.close
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.config
|
35
|
+
SidekiqAlive
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.store_alive_key
|
39
|
+
Sidekiq::Logging.logger.info "Writing Startup alive key in redis: #{config.liveness_key}"
|
40
|
+
# TODO run worker unless one already enqueued
|
41
|
+
config.store_alive_key
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module SidekiqAlive
|
2
|
+
class Worker
|
3
|
+
include Sidekiq::Worker
|
4
|
+
sidekiq_options retry: false
|
5
|
+
|
6
|
+
def perform
|
7
|
+
write_living_probe
|
8
|
+
self.class.perform_in(SidekiqAlive.time_to_live / 2)
|
9
|
+
end
|
10
|
+
|
11
|
+
def write_living_probe
|
12
|
+
# Write liveness probe
|
13
|
+
SidekiqAlive.store_alive_key
|
14
|
+
# after callbacks
|
15
|
+
SidekiqAlive.callback.call()
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "sidekiq_alive/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "sidekiq_alive"
|
8
|
+
spec.version = SidekiqAlive::VERSION
|
9
|
+
spec.authors = ["Artur Pañach"]
|
10
|
+
spec.email = ["arturictus@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Liveness probe for sidekiq on Kubernetes deployments.}
|
13
|
+
spec.description = %q{SidekiqAlive offers a solution to add liveness probe of a Sidekiq instance.
|
14
|
+
|
15
|
+
How?
|
16
|
+
|
17
|
+
A http server is started and on each requests validates that a liveness key is stored in Redis. If it is there means is working.
|
18
|
+
|
19
|
+
A Sidekiq job is the responsable to storing this key. If Sidekiq stops processing jobs
|
20
|
+
this key gets expired by Redis an consequently the http server will return a 500 error.
|
21
|
+
|
22
|
+
This Job is responsible to requeue itself for the next liveness probe.}
|
23
|
+
spec.homepage = "https://github.com/arturictus/sidekiq_alive"
|
24
|
+
spec.license = "MIT"
|
25
|
+
|
26
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
f.match(%r{^(test|spec|features)/})
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
35
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
36
|
+
spec.add_development_dependency "mock_redis"
|
37
|
+
spec.add_dependency "sidekiq"
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sidekiq_alive
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Artur Pañach
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-05-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mock_redis
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sidekiq
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: |-
|
84
|
+
SidekiqAlive offers a solution to add liveness probe of a Sidekiq instance.
|
85
|
+
|
86
|
+
How?
|
87
|
+
|
88
|
+
A http server is started and on each requests validates that a liveness key is stored in Redis. If it is there means is working.
|
89
|
+
|
90
|
+
A Sidekiq job is the responsable to storing this key. If Sidekiq stops processing jobs
|
91
|
+
this key gets expired by Redis an consequently the http server will return a 500 error.
|
92
|
+
|
93
|
+
This Job is responsible to requeue itself for the next liveness probe.
|
94
|
+
email:
|
95
|
+
- arturictus@gmail.com
|
96
|
+
executables: []
|
97
|
+
extensions: []
|
98
|
+
extra_rdoc_files: []
|
99
|
+
files:
|
100
|
+
- ".gitignore"
|
101
|
+
- ".rspec"
|
102
|
+
- ".travis.yml"
|
103
|
+
- CODE_OF_CONDUCT.md
|
104
|
+
- Gemfile
|
105
|
+
- Gemfile.lock
|
106
|
+
- LICENSE.txt
|
107
|
+
- README.md
|
108
|
+
- Rakefile
|
109
|
+
- bin/console
|
110
|
+
- bin/setup
|
111
|
+
- lib/sidekiq_alive.rb
|
112
|
+
- lib/sidekiq_alive/server.rb
|
113
|
+
- lib/sidekiq_alive/version.rb
|
114
|
+
- lib/sidekiq_alive/worker.rb
|
115
|
+
- sidekiq_alive.gemspec
|
116
|
+
homepage: https://github.com/arturictus/sidekiq_alive
|
117
|
+
licenses:
|
118
|
+
- MIT
|
119
|
+
metadata: {}
|
120
|
+
post_install_message:
|
121
|
+
rdoc_options: []
|
122
|
+
require_paths:
|
123
|
+
- lib
|
124
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
requirements: []
|
135
|
+
rubyforge_project:
|
136
|
+
rubygems_version: 2.5.2
|
137
|
+
signing_key:
|
138
|
+
specification_version: 4
|
139
|
+
summary: Liveness probe for sidekiq on Kubernetes deployments.
|
140
|
+
test_files: []
|