active_job_k8s 1.0.0.pre.beta.1 → 1.0.0.pre.beta.2
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 +3 -0
- data/Gemfile.lock +6 -6
- data/README.md +4 -4
- data/bin/teardown +1 -1
- data/lib/active_job_k8s/railtie.rb +10 -6
- data/lib/active_job_k8s/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0e243c2919c8dc8eace85844dcf16ef254f8d800792cbea13dff1f127131e0d9
|
|
4
|
+
data.tar.gz: ef5337a68ea326948f3a8f4797847dfa2778d28b1de57de9d2fc32ba32d8f53d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 711362257e7c1d9cae487d8759bdeac69567a9a2a466563de0bc58e24231c39141c8534493a3377e9659709b4caba0e1613b71a18e2d3b0e45190de716a2aedf
|
|
7
|
+
data.tar.gz: 751297bd4a799d64fa71752451745fbd4e704ddab6197de37a6a9d6ad32d73423f8f1e16fd3a850ffdd225e984fc752b924576056e2528790efefb98e0e90cff
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
active_job_k8s (0.2
|
|
4
|
+
active_job_k8s (1.0.0.pre.beta.2)
|
|
5
5
|
http (>= 5.0)
|
|
6
6
|
kubeclient (~> 4.0)
|
|
7
7
|
rails (>= 6.0, < 8)
|
|
@@ -68,7 +68,7 @@ GEM
|
|
|
68
68
|
minitest (>= 5.1)
|
|
69
69
|
tzinfo (~> 2.0)
|
|
70
70
|
zeitwerk (~> 2.3)
|
|
71
|
-
addressable (2.8.
|
|
71
|
+
addressable (2.8.5)
|
|
72
72
|
public_suffix (>= 2.0.2, < 6.0)
|
|
73
73
|
builder (3.2.4)
|
|
74
74
|
concurrent-ruby (1.1.10)
|
|
@@ -96,7 +96,7 @@ GEM
|
|
|
96
96
|
http-form_data (2.3.0)
|
|
97
97
|
i18n (1.12.0)
|
|
98
98
|
concurrent-ruby (~> 1.0)
|
|
99
|
-
jsonpath (1.1.
|
|
99
|
+
jsonpath (1.1.3)
|
|
100
100
|
multi_json
|
|
101
101
|
kubeclient (4.11.0)
|
|
102
102
|
http (>= 3.0, < 6.0)
|
|
@@ -116,9 +116,9 @@ GEM
|
|
|
116
116
|
net-smtp
|
|
117
117
|
marcel (1.0.2)
|
|
118
118
|
method_source (1.0.0)
|
|
119
|
-
mime-types (3.
|
|
119
|
+
mime-types (3.5.1)
|
|
120
120
|
mime-types-data (~> 3.2015)
|
|
121
|
-
mime-types-data (3.
|
|
121
|
+
mime-types-data (3.2023.0808)
|
|
122
122
|
mini_mime (1.1.2)
|
|
123
123
|
minitest (5.17.0)
|
|
124
124
|
multi_json (1.15.0)
|
|
@@ -135,7 +135,7 @@ GEM
|
|
|
135
135
|
nio4r (2.5.8)
|
|
136
136
|
nokogiri (1.13.10-x86_64-linux)
|
|
137
137
|
racc (~> 1.4)
|
|
138
|
-
public_suffix (5.0.
|
|
138
|
+
public_suffix (5.0.3)
|
|
139
139
|
racc (1.6.2)
|
|
140
140
|
rack (2.2.5)
|
|
141
141
|
rack-test (2.0.2)
|
data/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Or install it yourself as:
|
|
|
33
33
|
### Adapter Configuration
|
|
34
34
|
Configure the KubeClient as documented here: https://github.com/ManageIQ/kubeclient and instantiate the adapter.
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Example: Local with default kind cluster:
|
|
37
37
|
```ruby
|
|
38
38
|
|
|
39
39
|
kubeclient_config = Kubeclient::Config.read(ENV['KUBECONFIG'] || File.join(Dir.home, '/.kube/config'))
|
|
@@ -43,7 +43,7 @@ ES Local with default kind cluster:
|
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
```
|
|
46
|
-
|
|
46
|
+
Example: production configuration:
|
|
47
47
|
```ruby
|
|
48
48
|
Rails.application.configure do
|
|
49
49
|
|
|
@@ -139,7 +139,7 @@ roleRef:
|
|
|
139
139
|
|
|
140
140
|
Inside you job you should describe the initial manifest for the [KubernetesJob](https://kubernetes.io/docs/concepts/workloads/controllers/job/)
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
Example:
|
|
143
143
|
```ruby
|
|
144
144
|
class HelloWorldJob < ApplicationJob
|
|
145
145
|
queue_as :default
|
|
@@ -161,7 +161,7 @@ The command will be inserted by the gem if not present.
|
|
|
161
161
|
command: ["rails"]
|
|
162
162
|
args: ["active_job_k8s:run_job"]
|
|
163
163
|
```
|
|
164
|
-
To the name of the Job
|
|
164
|
+
To the name of the Job we will append a timestamp to make it uniq
|
|
165
165
|
|
|
166
166
|
## Development
|
|
167
167
|
|
data/bin/teardown
CHANGED
|
@@ -7,14 +7,18 @@ module ActiveJobK8s
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
server do
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
if Rails.application.config.active_job.queue_adapter.is_a? ActiveJob::QueueAdapters::K8sAdapter
|
|
11
|
+
puts "=> START ActiveJobK8s - ControlLoop sleep [5]"
|
|
12
|
+
Thread.new do
|
|
13
|
+
Rails.application.reloader.wrap do
|
|
14
|
+
loop do
|
|
15
|
+
Rails.application.config.active_job.queue_adapter.scheduler.un_suspend_jobs
|
|
16
|
+
sleep 5
|
|
17
|
+
end
|
|
16
18
|
end
|
|
17
19
|
end
|
|
20
|
+
else
|
|
21
|
+
puts "=> Queue Adapter was not ActiveJob::QueueAdapters::K8sAdapter"
|
|
18
22
|
end
|
|
19
23
|
end
|
|
20
24
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_job_k8s
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.0.pre.beta.
|
|
4
|
+
version: 1.0.0.pre.beta.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Marino Bonetti
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-09-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: kubeclient
|
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
110
110
|
- !ruby/object:Gem::Version
|
|
111
111
|
version: 1.3.1
|
|
112
112
|
requirements: []
|
|
113
|
-
rubygems_version: 3.
|
|
113
|
+
rubygems_version: 3.2.33
|
|
114
114
|
signing_key:
|
|
115
115
|
specification_version: 4
|
|
116
116
|
summary: ActiveJob adapter for kubernetes job
|