Module: KubeQueue
- Defined in:
- lib/kube_queue.rb,
lib/kube_queue/client.rb,
lib/kube_queue/worker.rb,
lib/kube_queue/version.rb,
lib/kube_queue/executor.rb,
lib/kube_queue/worker/dsl.rb,
lib/kube_queue/configuration.rb,
lib/kube_queue/manifest_builder.rb,
lib/kube_queue/job_specification.rb
Defined Under Namespace
Modules: Worker
Classes: Client, Configuration, Executor, JobNotFound, JobSpecification, ManifestBuilder
Constant Summary
collapse
- VERSION =
"0.4.1".freeze
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.client ⇒ Object
22
23
24
|
# File 'lib/kube_queue.rb', line 22
def client
@client ||= default_client
end
|
.default_env ⇒ Object
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/kube_queue.rb', line 44
def default_env
return @default_env if @default_env
return {} unless defined?(Rails)
{
RAILS_LOG_TO_STDOUT: ENV['RAILS_LOG_TO_STDOUT'],
RAILS_ENV: ENV['RAILS_ENV']
}
end
|
.executor ⇒ Object
14
15
16
|
# File 'lib/kube_queue.rb', line 14
def executor
@executor ||= default_executor
end
|
Class Method Details
.configuration ⇒ Object
38
39
40
|
# File 'lib/kube_queue.rb', line 38
def configuration
@configuration ||= Configuration.new
end
|
34
35
36
|
# File 'lib/kube_queue.rb', line 34
def configure(&block)
configuration.configure(&block)
end
|
.default_client ⇒ Object
30
31
32
|
# File 'lib/kube_queue.rb', line 30
def default_client
Client.new
end
|
.default_executor ⇒ Object
26
27
28
|
# File 'lib/kube_queue.rb', line 26
def default_executor
Executor.new
end
|
.fetch_worker(name) ⇒ Object
55
56
57
|
# File 'lib/kube_queue.rb', line 55
def fetch_worker(name)
worker_registry.fetch(name)
end
|
18
19
20
|
# File 'lib/kube_queue.rb', line 18
def kubernetes_configure
yield client
end
|
.register_worker(name, klass) ⇒ Object
59
60
61
|
# File 'lib/kube_queue.rb', line 59
def register_worker(name, klass)
worker_registry[name] = klass
end
|
.worker_registry ⇒ Object
63
64
65
|
# File 'lib/kube_queue.rb', line 63
def worker_registry
@worker_registry ||= {}
end
|