rbbt-image 0.1.23 → 0.1.24

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: 985e74d5183e70ec0ba00624edf6bf6a5fc32479
4
- data.tar.gz: 9f983398ac5b35b6ea43d36dc7d1d8c734190235
3
+ metadata.gz: 7ed58604b057907a38851a6a92d7194f18053a7b
4
+ data.tar.gz: 2d388128b25ad6bab542ea78d4c5f2c2ddeed92e
5
5
  SHA512:
6
- metadata.gz: 853f5b6d1221b2da5e48c4e553bfe69b96758df9d44c35ede7c642de519fe57e6b07995720ca2766fce4a34ebc21614168b4ba2dbb4b630f572637080efd55f2
7
- data.tar.gz: 43f68462a65f1b1affea381f1cd569b69c4407ce2b8675b530c3429d55c0f05cf2ecf771020ad476c04f5d74e494348e23eb25e484ab4b8118531d0eb49b20c5
6
+ metadata.gz: 38d6594b2ecd3bca2b2072bcef5e5d6860445897a2893736410f6a57e1d499719052f836ab16b963ea6f793188ac60f8dcc906cccaaa48c5996aa703a2659e07
7
+ data.tar.gz: 57bb41af613cbb225121ec437802ac2408eeb3d6fe6087398db207c38a054ab95cb0547c5c64a4d8b7286824840a43c87e60784737fd03cd1f5389502c6d7482
data/Vagrantfile CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- mode: ruby -*-
2
2
  # vi: set ft=ruby :
3
3
 
4
- build_script = File.join(File.basename(__FILE__), 'bin/build_rbbt_provision_sh')
4
+ build_script = File.join(File.dirname(__FILE__), 'bin/build_rbbt_provision_sh.rb')
5
5
  provision_script = `ruby #{build_script}`
6
6
 
7
7
  VAGRANTFILE_API_VERSION = "2"
@@ -12,11 +12,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
12
12
  # please see the online documentation at vagrantup.com.
13
13
 
14
14
  # Every Vagrant virtual environment requires a box to build off of.
15
- config.vm.box = "precise32"
15
+ config.vm.box = "ubuntu/xenial64"
16
16
 
17
17
  # The url from where the 'config.vm.box' box will be fetched if it
18
18
  # doesn't already exist on the user's system.
19
- config.vm.box_url = "http://files.vagrantup.com/precise32.box"
19
+ #config.vm.box_url = "http://files.vagrantup.com/xenial.box"
20
20
 
21
21
  config.vm.network "forwarded_port", guest: 2887, host: 28879
22
22
 
@@ -53,18 +53,19 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
53
53
  #
54
54
 
55
55
  Vagrant.configure("2") do |config|
56
- config.vm.provider "docker" do |d|
57
- d.image = "ubuntu:14.04.2"
58
- end
56
+ config.vm.provider "docker" do |d|
57
+ d.image = "ubuntu:xenial"
58
+ end
59
+
60
+ config.vm.provider :virtualbox do |vb|
61
+ # Don't boot with headless mode
62
+ vb.gui = true
63
+
64
+ # Use VBoxManage to customize the VM. For example to change memory:
65
+ vb.customize ["modifyvm", :id, "--memory", "4096"]
66
+ end
59
67
  end
60
68
  #
61
- # config.vm.provider :virtualbox do |vb|
62
- # # Don't boot with headless mode
63
- # vb.gui = true
64
- #
65
- # # Use VBoxManage to customize the VM. For example to change memory:
66
- # vb.customize ["modifyvm", :id, "--memory", "1024"]
67
- # end
68
69
  #
69
70
  # View the documentation for the provider you're using for more
70
71
  # information on available options.
@@ -89,7 +90,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
89
90
  #
90
91
  # config.vm.provision :puppet do |puppet|
91
92
  # puppet.manifests_path = "manifests"
92
- # puppet.manifest_file = "site.pp"
93
93
  # end
94
94
 
95
95
  # Enable provisioning with chef solo, specifying a cookbooks path, roles
@@ -132,5 +132,5 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
132
132
  end
133
133
 
134
134
  Vagrant::Config.run do |config|
135
- config.vm.customize ["modifyvm", :id, "--memory", 1024]
135
+ config.vm.customize ["modifyvm", :id, "--memory", 1024]
136
136
  end
@@ -36,11 +36,12 @@ $ #{$0} [options]
36
36
  -c--concurrent Prepare system for high-concurrency
37
37
  -Rbv--ruby_version* Ruby version to use, using three numbers (defaults to 2.4.1)
38
38
  -op--optimize Optimize files under ~/.rbbt
39
+ -dep--container_dependency* Use a different image in Dockerfile, Singularity and Virtualbox
39
40
  -dt--docker* Build docker image using the provided name
40
- -df--docker_file* Use a Dockerfile different than the default
41
- -dd--docker_dependency* Use a different image in the Dockerfile FROM
42
41
  -si--singularity* Build singularity image using the provided name
43
- -v--volumnes* List of volumes to set-up
42
+ -vb--virtualbox Build virtualbox image
43
+ -df--docker_file* Use a Dockerfile different than the default
44
+ -dv--docker_volumnes* List of volumes to set-up in Docker
44
45
  --nocolor Prevent rbbt from using colors and control sequences in the logs while provisioning
45
46
  --nobar Prevent rbbt from using progress bars while provisioning
46
47
  EOF
@@ -258,16 +259,16 @@ date
258
259
 
259
260
  EOF
260
261
 
261
- docker_dependency = options[:docker_dependency]
262
+ container_dependency = options[:container_dependency] || 'ubuntu:xenial'
262
263
 
263
- if options[:docker]
264
+ if docker_image = options[:docker]
264
265
  dockerfile = options[:dockerfile] || File.join(root_dir, 'Dockerfile')
265
266
  dockerfile_text = Open.read(dockerfile)
266
- dockerfile_text.sub!(/^FROM.*/,'FROM ' + docker_dependency) if docker_dependency
267
+ dockerfile_text.sub!(/^FROM.*/,'FROM ' + container_dependency) if container_dependency
267
268
  dockerfile_text.sub!(/^USER rbbt/,'USER ' + USER) if USER != 'rbbt'
268
269
  dockerfile_text.sub!(/^ENV HOME \/home\/rbbt/,'ENV HOME /home/' + USER) if USER != 'rbbt'
269
- if options[:volumnes]
270
- volumnes = options[:volumnes].split(/\s*[,|]\s*/).collect{|d| "VOLUME " << d} * "\n"
270
+ if options[:docker_volumnes]
271
+ volumnes = options[:docker_volumnes].split(/\s*[,|]\s*/).collect{|d| "VOLUME " << d} * "\n"
271
272
  dockerfile_text.sub!(/^RUN/, volumnes + "\nRUN")
272
273
  end
273
274
  if options[:R_packages]
@@ -281,8 +282,8 @@ if options[:docker]
281
282
 
282
283
  puts "RUN"
283
284
  puts "==="
284
- puts "docker build -t #{options[:docker]} '#{dir}'"
285
- io = CMD.cmd("docker build -t #{options[:docker]} '#{dir}'", :pipe => true, :log => true)
285
+ puts "docker build -t #{docker_image} '#{dir}'"
286
+ io = CMD.cmd("docker build -t #{docker_image} '#{dir}'", :pipe => true, :log => true)
286
287
  while line = io.gets
287
288
  puts line
288
289
  end
@@ -292,7 +293,6 @@ else
292
293
  end
293
294
 
294
295
  if singularity_image = options[:singularity]
295
- docker_dep = options[:docker_dependency] || 'ubuntu'
296
296
 
297
297
  TmpFile.with_file(nil, false) do |dir|
298
298
  Path.setup(dir)
@@ -301,7 +301,7 @@ if singularity_image = options[:singularity]
301
301
 
302
302
  bootstrap_text=<<-EOF
303
303
  Bootstrap: docker
304
- From: #{docker_dep}
304
+ From: #{container_dependency}
305
305
 
306
306
  %post
307
307
  cat > /tmp/rbbt_provision.sh <<"EOS"
@@ -332,3 +332,39 @@ EOF
332
332
 
333
333
  end
334
334
 
335
+ if options[:virtualbox]
336
+ TmpFile.with_file(nil, false) do |dir|
337
+ Path.setup(dir)
338
+
339
+ provision_file = dir['provision.sh']
340
+ vagrant_file = dir['Vagrantfile']
341
+
342
+ Open.write provision_file, provision_script
343
+ Open.write vagrant_file, <<-EOF
344
+ VAGRANTFILE_API_VERSION = "2"
345
+
346
+ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
347
+
348
+ config.vm.box = "#{container_dependency.sub(':','/')}64"
349
+
350
+ config.vm.provision :shell, :path => "#{provision_file}"
351
+
352
+ config.vm.provider "virtualbox" do |vb|
353
+ # Display the VirtualBox GUI when booting the machine
354
+ vb.gui = true
355
+
356
+ # Customize the amount of memory on the VM:
357
+ vb.memory = "8192"
358
+ end
359
+ end
360
+ EOF
361
+
362
+ iii dir
363
+ Misc.in_dir(dir) do
364
+ io = CMD.cmd('vagrant up', :pipe => true, :log => true)
365
+ while line = io.gets
366
+ puts line
367
+ end
368
+ end
369
+ end
370
+ end
@@ -7,10 +7,10 @@ cd /tmp
7
7
 
8
8
  apt-get remove r-base-core
9
9
 
10
- wget https://cran.r-project.org/src/base/R-3/R-3.3.2.tar.gz
11
- tar -xvzf R-3.3.2.tar.gz
10
+ wget https://ftp.gwdg.de/pub/misc/cran/src/base/R-3/R-3.4.2.tar.gz -O R.tar.gz
11
+ tar -xvzf R.tar.gz
12
12
 
13
- cd R-3.3.2/
13
+ cd R-*/
14
14
  ./configure --prefix=/usr/local --enable-R-shlib
15
15
  make && make install
16
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-image
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-25 00:00:00.000000000 Z
11
+ date: 2017-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util