vx-container_connector 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50c55ea07a69070c996f4236c64d83249a72223c
4
- data.tar.gz: 0003c8da861c71f2ac68b6b77cbfb4ef39b21baf
3
+ metadata.gz: db21fe3331dbe6a729da8bb12dcf87087fd2ceb3
4
+ data.tar.gz: 816eda636dc9bdae8a9c361eca41d3ebe4e2a6d4
5
5
  SHA512:
6
- metadata.gz: d98034882190dcf2c771af7df2f9e5ad48c8d24b62f38f74cdad9ce87b88b9224cdd4fc03c20135914262dedec9a5246f8d0be77f9d50ab16aad35d15849818f
7
- data.tar.gz: de3113970e59c8b4537abd81c85c1abfafaf5aaf8428bbcb0769b7565b41f665a7d8356c53d91bde431508a0fb083cf5fe3da632bc1f1a866379eb630b9a5b83
6
+ metadata.gz: d41134848e869821cf8903e929a67c0e91fd474b5c0856191be67f7980ca52a9c41688dc3a5a52b6341025423bfa08c72c6af5c0f92c68628ddb138bffba46be
7
+ data.tar.gz: 3fd36596e6c37e51e103564349997f649ef87017bf3c50cb87c9039ce925772fbdda9c7dd100573f44c3970ea8a6686faf59ef6e42f4cb223f2609d727ddfab0
@@ -15,14 +15,15 @@ module Vx
15
15
  include ContainerConnector::Retriable
16
16
  include Instrument
17
17
 
18
- attr_reader :user, :password, :init, :image, :remote_dir
18
+ attr_reader :user, :password, :init, :image, :remote_dir, :memory
19
19
 
20
20
  def initialize(options = {})
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}"
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 || 0
26
27
  end
27
28
 
28
29
  def start(&block)
@@ -33,8 +34,9 @@ module Vx
33
34
 
34
35
  def create_container_options
35
36
  Default.create_container_options.merge(
36
- 'Cmd' => init,
37
- 'Image' => image,
37
+ 'Cmd' => init,
38
+ 'Image' => image,
39
+ 'Memory' => memory
38
40
  )
39
41
  end
40
42
 
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module ContainerConnector
3
- VERSION = "0.5.4"
3
+ VERSION = "0.5.5"
4
4
  end
5
5
  end
@@ -51,7 +51,7 @@ describe Vx::ContainerConnector::Docker do
51
51
 
52
52
  context "start container", docker: true do
53
53
 
54
- let(:conn) { described_class.new image: "vexor/trusty:1.0.0" }
54
+ let(:conn) { described_class.new image: "ubuntu", init: "/bin/sleep 1" }
55
55
 
56
56
  it 'should be successfuly' do
57
57
  rs = nil
@@ -61,6 +61,15 @@ describe Vx::ContainerConnector::Docker do
61
61
  expect(rs).to_not be_empty
62
62
  end
63
63
 
64
+ it 'should be successfuly with memory limit' do
65
+ conn = described_class.new memory: 1024 * 1024 * 10, init: "/bin/sleep 1", image: 'ubuntu'
66
+ rs = nil
67
+ conn.start do |spawner|
68
+ rs = spawner.id
69
+ end
70
+ expect(rs).to_not be_empty
71
+ end
72
+
64
73
  context "and spawn script" do
65
74
  it "successfuly" do
66
75
  rs = ""
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  Bundler.require(:test)
2
2
 
3
3
  ENV['VX_ENV'] = 'test'
4
- ENV['DOCKER_URL'] = "tcp://localhost:4243"
4
+ ENV['DOCKER_URL'] = "tcp://localhost:2375"
5
5
 
6
6
  require File.expand_path '../../lib/vx/container_connector', __FILE__
7
7
  require 'rspec/autorun'
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
4
+ version: 0.5.5
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-07-02 00:00:00.000000000 Z
11
+ date: 2014-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api
@@ -42,54 +42,54 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: ' description '
83
+ description: " description "
84
84
  email:
85
85
  - dima.exe@gmail.com
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - .gitignore
91
- - .rspec
92
- - .travis.yml
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".travis.yml"
93
93
  - Gemfile
94
94
  - LICENSE.txt
95
95
  - Rakefile
@@ -119,12 +119,12 @@ require_paths:
119
119
  - lib
120
120
  required_ruby_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  requirements:
127
- - - '>='
127
+ - - ">="
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []