resque-kubernetes 1.3.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/README.md +4 -7
- data/lib/resque/kubernetes.rb +2 -2
- data/lib/resque/kubernetes/context_factory.rb +2 -1
- data/lib/resque/kubernetes/job.rb +1 -3
- data/lib/resque/kubernetes/version.rb +1 -1
- data/resque-kubernetes.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b5eb837eae7cac78d84a9cdc246888a76b72757
|
4
|
+
data.tar.gz: fa20e71d90dd54d75f46ede6395426b8fdc5adac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7a5c03e3368267b04f3cf0027fb0e72a882cf36133b4ed2da7ca63a0528781baecfbfa4670113d196b4baaf3794b2711fa0dd30fc7e9d68ce48a8c803c1dc16
|
7
|
+
data.tar.gz: 1aec966a307c5619a07c56fd93549b18764b6fa239138af439e718a45c89b823550e68bf9f7d36e56ed2e9df77c658f2ad7b2de8484d759f0a1cc67bc438114d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,34 @@
|
|
1
|
+
# V2.0.0
|
2
|
+
**Breaking Change:**
|
3
|
+
- The `environments` configuration as been replaced by a more flexible `enabled` property.
|
4
|
+
|
5
|
+
Here's how to migrate from the `environments` property to the `enabled` property:
|
6
|
+
|
7
|
+
Before:
|
8
|
+
```ruby
|
9
|
+
# config/initializers/resque-kubernetes.rb
|
10
|
+
|
11
|
+
Resque::Kubernetes.configuration do |config|
|
12
|
+
config.environments << "staging"
|
13
|
+
config.max_workers = 10
|
14
|
+
end
|
15
|
+
```
|
16
|
+
|
17
|
+
After:
|
18
|
+
```ruby
|
19
|
+
# config/initializers/resque-kubernetes.rb
|
20
|
+
|
21
|
+
Resque::Kubernetes.configuration do |config|
|
22
|
+
config.enabled = Rails.env.production? || Rails.env.staging?
|
23
|
+
config.max_workers = 10
|
24
|
+
end
|
25
|
+
```
|
26
|
+
|
27
|
+
⚠️ By default, this gem is not enabled.
|
28
|
+
|
29
|
+
**Changes:**
|
30
|
+
- Allow resque 2.0 but retain support for 1.26 or later.
|
31
|
+
|
1
32
|
# v1.3.0
|
2
33
|
- Retry when a timeout occurs connecting to the Kubernetes API server
|
3
34
|
|
data/README.md
CHANGED
@@ -152,19 +152,16 @@ your project:
|
|
152
152
|
# config/initializers/resque-kubernetes.rb
|
153
153
|
|
154
154
|
Resque::Kubernetes.configuration do |config|
|
155
|
-
config.
|
155
|
+
config.enabled = Rails.env.production? || Rails.env.staging?
|
156
156
|
config.max_workers = 10
|
157
157
|
end
|
158
158
|
```
|
159
159
|
|
160
|
-
### `
|
160
|
+
### `enabled`
|
161
161
|
|
162
|
-
|
162
|
+
⚠️ By default, the `enabled` property is set to `false` which means that, by default, this plugin will not be launched.
|
163
163
|
|
164
|
-
|
165
|
-
`:production`. If you want to add other environments you can update this list
|
166
|
-
(`config.environments << "staging"`) or replace it (`config.environments =
|
167
|
-
["production", "development"]`).
|
164
|
+
You should not enable this Resque plugin in environments that are not run inside a Kubernetes cluster (for example, your CI env).
|
168
165
|
|
169
166
|
### `max_workers`
|
170
167
|
|
data/lib/resque/kubernetes.rb
CHANGED
@@ -19,8 +19,8 @@ module Resque
|
|
19
19
|
module Kubernetes
|
20
20
|
extend Configurable
|
21
21
|
|
22
|
-
# By default
|
23
|
-
define_setting :
|
22
|
+
# By default, this plugin is not active.
|
23
|
+
define_setting :enabled, false
|
24
24
|
|
25
25
|
# Limit the number of workers that should be spun up, default 10
|
26
26
|
define_setting :max_workers, 10
|
@@ -10,7 +10,6 @@ module Resque
|
|
10
10
|
|
11
11
|
class << self
|
12
12
|
def context
|
13
|
-
# TODO: Add ability to load this from config
|
14
13
|
[
|
15
14
|
Resque::Kubernetes::Context::WellKnown,
|
16
15
|
Resque::Kubernetes::Context::Kubectl
|
@@ -18,6 +17,8 @@ module Resque
|
|
18
17
|
context = context_type.new
|
19
18
|
return context.context if context.applicable?
|
20
19
|
end
|
20
|
+
|
21
|
+
nil
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
@@ -83,9 +83,7 @@ module Resque
|
|
83
83
|
|
84
84
|
# A before_enqueue hook that adds worker jobs to the cluster.
|
85
85
|
def before_enqueue_kubernetes_job(*_args)
|
86
|
-
|
87
|
-
return unless Resque::Kubernetes.environments.include?(Rails.env)
|
88
|
-
end
|
86
|
+
return unless Resque::Kubernetes.enabled
|
89
87
|
|
90
88
|
manager = JobsManager.new(self)
|
91
89
|
manager.reap_finished_jobs
|
data/resque-kubernetes.gemspec
CHANGED
@@ -33,6 +33,6 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_development_dependency "rubocop", "~> 0.52", ">= 0.52.1", "< 0.56.0"
|
34
34
|
|
35
35
|
spec.add_dependency "kubeclient", ">= 3.1.2", "< 5.0"
|
36
|
-
spec.add_dependency "resque", "
|
36
|
+
spec.add_dependency "resque", ">= 1.26"
|
37
37
|
spec.add_dependency "retriable", "~> 3.0"
|
38
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-kubernetes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Wadsack
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|
@@ -144,14 +144,14 @@ dependencies:
|
|
144
144
|
name: resque
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
|
-
- - "
|
147
|
+
- - ">="
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '1.26'
|
150
150
|
type: :runtime
|
151
151
|
prerelease: false
|
152
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
|
-
- - "
|
154
|
+
- - ">="
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: '1.26'
|
157
157
|
- !ruby/object:Gem::Dependency
|