resque-kubernetes 1.2.0 → 1.3.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 +3 -0
- data/lib/resque/kubernetes.rb +3 -0
- data/lib/resque/kubernetes/jobs_manager.rb +5 -1
- data/lib/resque/kubernetes/manifest_conformance.rb +1 -1
- data/lib/resque/kubernetes/retriable_client.rb +28 -0
- data/lib/resque/kubernetes/version.rb +1 -1
- data/resque-kubernetes.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c90637618ea819269c20b91f9cc752e28b435da0
|
4
|
+
data.tar.gz: 94391752da8c4a799442d22e31f5cfdf3ac8cc21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c3dcccddc78c704a909c2abba2b0acd7236ba8df30026dbaf4a0ce11958e4823064c25dfb8bdfaf3b923510fe3468088ad70d26ec799c6ca0fe037711db2f89
|
7
|
+
data.tar.gz: f9257d78372f47e6a94be98d022095d05d3af32f960b402c126a760cf247060e28fd7dca34c402898e8db6d591fb79e63f6162042da130b77f4767da3c16ca02
|
data/CHANGELOG.md
CHANGED
data/lib/resque/kubernetes.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "retriable"
|
4
|
+
|
3
5
|
require "resque/kubernetes/configurable"
|
4
6
|
require "resque/kubernetes/context/kubectl"
|
5
7
|
require "resque/kubernetes/context/well_known"
|
@@ -9,6 +11,7 @@ require "resque/kubernetes/dns_safe_random"
|
|
9
11
|
require "resque/kubernetes/job"
|
10
12
|
require "resque/kubernetes/jobs_manager"
|
11
13
|
require "resque/kubernetes/manifest_conformance"
|
14
|
+
require "resque/kubernetes/retriable_client"
|
12
15
|
require "resque/kubernetes/version"
|
13
16
|
|
14
17
|
module Resque
|
@@ -62,8 +62,12 @@ module Resque
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def client(scope)
|
65
|
-
return Resque::Kubernetes.kubeclient if Resque::Kubernetes.kubeclient
|
65
|
+
return RetriableClient.new(Resque::Kubernetes.kubeclient) if Resque::Kubernetes.kubeclient
|
66
|
+
client = build_client(scope)
|
67
|
+
RetriableClient.new(client) if client
|
68
|
+
end
|
66
69
|
|
70
|
+
def build_client(scope)
|
67
71
|
context = ContextFactory.context
|
68
72
|
return unless context
|
69
73
|
@default_namespace = context.namespace if context.namespace
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Resque
|
4
4
|
module Kubernetes
|
5
|
-
# Provides
|
5
|
+
# Provides functions to ensure a manifest conforms to a job specification
|
6
6
|
# and includes details needed for resque-kubernetes
|
7
7
|
module ManifestConformance
|
8
8
|
def adjust_manifest(manifest)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Resque
|
4
|
+
module Kubernetes
|
5
|
+
# Wraps Kubeclient::Client to retry timeout errors
|
6
|
+
class RetriableClient
|
7
|
+
attr_accessor :kubeclient
|
8
|
+
|
9
|
+
def initialize(client)
|
10
|
+
self.kubeclient = client
|
11
|
+
end
|
12
|
+
|
13
|
+
def method_missing(method, *args, &block)
|
14
|
+
if kubeclient.respond_to?(method)
|
15
|
+
Retriable.retriable(on: {Kubeclient::HttpError => /Timed out/}) do
|
16
|
+
kubeclient.send(method, *args, &block)
|
17
|
+
end
|
18
|
+
else
|
19
|
+
super
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def respond_to_missing?(method)
|
24
|
+
kubeclient.respond_to?(method)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/resque-kubernetes.gemspec
CHANGED
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: 1.
|
4
|
+
version: 1.3.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: 2018-11
|
11
|
+
date: 2018-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|
@@ -154,6 +154,20 @@ dependencies:
|
|
154
154
|
- - "~>"
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: '1.26'
|
157
|
+
- !ruby/object:Gem::Dependency
|
158
|
+
name: retriable
|
159
|
+
requirement: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - "~>"
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '3.0'
|
164
|
+
type: :runtime
|
165
|
+
prerelease: false
|
166
|
+
version_requirements: !ruby/object:Gem::Requirement
|
167
|
+
requirements:
|
168
|
+
- - "~>"
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '3.0'
|
157
171
|
description: Launches a Kubernetes Job when a Resque Job is enqueued, then terminates
|
158
172
|
the worker when there are no more jobs in the queue.
|
159
173
|
email:
|
@@ -187,6 +201,7 @@ files:
|
|
187
201
|
- lib/resque/kubernetes/job.rb
|
188
202
|
- lib/resque/kubernetes/jobs_manager.rb
|
189
203
|
- lib/resque/kubernetes/manifest_conformance.rb
|
204
|
+
- lib/resque/kubernetes/retriable_client.rb
|
190
205
|
- lib/resque/kubernetes/version.rb
|
191
206
|
- resque-kubernetes.gemspec
|
192
207
|
homepage: https://github.com/keylimetoolbox/resque-kubernetes
|