vx-container_connector 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vx/container_connector/docker.rb +12 -10
- data/lib/vx/container_connector/version.rb +1 -1
- data/spec/lib/docker_spec.rb +1 -1
- data/vx-container_connector.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: eae10f077e9c1aeef071e6b40291dce6e9fed3b2
|
4
|
+
data.tar.gz: 44a40ee38498f36ac01a882ee9f6d2c4f3e28131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea42fa3c6b221b58628c1f921e37d2b2d474844340a111a5bb3d97d1d12b7cf42011139976a7c9afbba688245d5b026d396169fa351d7039ed95c0e4aa5c42e1
|
7
|
+
data.tar.gz: a4305f503bb7d53093bd59125e0393f2c9d472c2a1fef7fed9ad78564dac0b0bbf6a276bc9fbdbc0b4979a7dc04be9450f12d21a57daca5ff91fddf6f5d2c609
|
@@ -15,15 +15,16 @@ module Vx
|
|
15
15
|
include ContainerConnector::Retriable
|
16
16
|
include Instrument
|
17
17
|
|
18
|
-
attr_reader :user, :password, :init, :image, :remote_dir, :memory
|
18
|
+
attr_reader :user, :password, :init, :image, :remote_dir, :memory, :memory_swap
|
19
19
|
|
20
20
|
def initialize(options = {})
|
21
|
-
@user
|
22
|
-
@password
|
23
|
-
@init
|
24
|
-
@image
|
25
|
-
@remote_dir
|
26
|
-
@memory
|
21
|
+
@user = options[:user] || "vexor"
|
22
|
+
@password = options[:password] || "vexor"
|
23
|
+
@init = options[:init] || %w{ /sbin/my_init }
|
24
|
+
@image = options[:image] || "ubuntu"
|
25
|
+
@remote_dir = options[:remote_dir] || "/home/#{user}"
|
26
|
+
@memory = options[:memory].to_i
|
27
|
+
@memory_swap = options[:memory_swap].to_i
|
27
28
|
end
|
28
29
|
|
29
30
|
def start(&block)
|
@@ -34,9 +35,10 @@ module Vx
|
|
34
35
|
|
35
36
|
def create_container_options
|
36
37
|
Default.create_container_options.merge(
|
37
|
-
'Cmd'
|
38
|
-
'Image'
|
39
|
-
'Memory'
|
38
|
+
'Cmd' => init,
|
39
|
+
'Image' => image,
|
40
|
+
'Memory' => memory,
|
41
|
+
'MemorySwap' => memory_swap
|
40
42
|
)
|
41
43
|
end
|
42
44
|
|
data/spec/lib/docker_spec.rb
CHANGED
@@ -62,7 +62,7 @@ describe Vx::ContainerConnector::Docker do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'should be successfuly with memory limit' do
|
65
|
-
conn = described_class.new memory: 1024 * 1024 * 10, init: "/bin/sleep 1", image: 'ubuntu'
|
65
|
+
conn = described_class.new memory: 1024 * 1024 * 10, memory_swap: 1024 * 1024 * 20, init: "/bin/sleep 1", image: 'ubuntu'
|
66
66
|
rs = nil
|
67
67
|
conn.start do |spawner|
|
68
68
|
rs = spawner.id
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency 'docker-api', '1.
|
21
|
+
spec.add_runtime_dependency 'docker-api', '= 1.15.0'
|
22
22
|
spec.add_runtime_dependency 'vx-common-spawn', '= 0.0.8'
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vx-container_connector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Galinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docker-api
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.15.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.15.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: vx-common-spawn
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|