rbbt-image 0.1.22 → 0.1.23

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f50f19d65d7e0b5aeac62e088eb649a89b8f3d69
4
- data.tar.gz: 04c5e4b3bceb73f38c5c5fb62003eb17f6812117
3
+ metadata.gz: 985e74d5183e70ec0ba00624edf6bf6a5fc32479
4
+ data.tar.gz: 9f983398ac5b35b6ea43d36dc7d1d8c734190235
5
5
  SHA512:
6
- metadata.gz: 5901297085f63d32fdfafc603034f55a9a8fe5775b81e766b586b30be00b974bcf9de21c3cb8336cb98ca3861ede62bda41637e90061fe1aad8c00ce04a7945b
7
- data.tar.gz: dac403f6cbfcb5817c0c228dded58533481653130d077ae1ecdc03330e86c960d17169db89ff9f2aeb046364382e79ed62961db187ad8aaba758ee215fe021fe
6
+ metadata.gz: 853f5b6d1221b2da5e48c4e553bfe69b96758df9d44c35ede7c642de519fe57e6b07995720ca2766fce4a34ebc21614168b4ba2dbb4b630f572637080efd55f2
7
+ data.tar.gz: 43f68462a65f1b1affea381f1cd569b69c4407ce2b8675b530c3429d55c0f05cf2ecf771020ad476c04f5d74e494348e23eb25e484ab4b8118531d0eb49b20c5
data/Dockerfile CHANGED
@@ -1,6 +1,8 @@
1
- FROM ubuntu
1
+ FROM ubuntu:xenial
2
2
  USER root
3
+ # START PROVISION
3
4
  ADD provision.sh /tmp/provision.sh
4
5
  RUN /bin/bash /tmp/provision.sh
6
+ # END PROVISION
5
7
  USER rbbt
6
8
  ENV HOME /home/rbbt
@@ -26,19 +26,25 @@ $ #{$0} [options]
26
26
  -rr--remote_resources* Remote resources to gather from file-server
27
27
  -rw--remote_workflows* Remote workflows server from workflow-server
28
28
  -ss--skip_base_system Skip base system installation
29
+ -st--skip_tokyocabinet Skip tokyocabinet setup installation
29
30
  -sr--skip_ruby Skip ruby setup installation
30
31
  -sg--skip_gem Skip ruby gem installation
31
32
  -su--skip_user_setup Skip user setup
32
33
  -sb--skip_bootstrap Skip user bootstrap
34
+ -Rc--R_custom Install a custom installation of R
35
+ -Rp--R_packages Install basic R packages
33
36
  -c--concurrent Prepare system for high-concurrency
37
+ -Rbv--ruby_version* Ruby version to use, using three numbers (defaults to 2.4.1)
34
38
  -op--optimize Optimize files under ~/.rbbt
35
39
  -dt--docker* Build docker image using the provided name
36
40
  -df--docker_file* Use a Dockerfile different than the default
37
41
  -dd--docker_dependency* Use a different image in the Dockerfile FROM
42
+ -si--singularity* Build singularity image using the provided name
38
43
  -v--volumnes* List of volumes to set-up
39
44
  --nocolor Prevent rbbt from using colors and control sequences in the logs while provisioning
40
45
  --nobar Prevent rbbt from using progress bars while provisioning
41
46
  EOF
47
+
42
48
  if options[:help]
43
49
  if defined? rbbt_usage
44
50
  rbbt_usage and exit 0
@@ -51,9 +57,16 @@ end
51
57
  root_dir = File.dirname(File.dirname(File.expand_path(__FILE__)))
52
58
  script_dir = File.join(root_dir, "share/provision_scripts/")
53
59
 
60
+ if options[:singularity]
61
+ options[:skip_user_setup] = true
62
+ options[:skip_bootstrap] = true
63
+ end
64
+
54
65
  USER = options[:user] || 'rbbt'
55
66
  SKIP_BASE_SYSTEM = options[:skip_base_system]
67
+ SKIP_TOKYOCABINET= options[:skip_tokyocabinet]
56
68
  SKIP_RUBY = options[:skip_ruby]
69
+ R_CUSTOM = options[:R_custom]
57
70
  SKIP_BOOT = options[:skip_bootstrap]
58
71
  SKIP_USER = options[:skip_user_setup]
59
72
  SKIP_GEM = options[:skip_gem]
@@ -75,6 +88,8 @@ VARIABLES[:REMOTE_WORKFLOWS] = options[:remote_workflows].split(/[\s,]+/)*" " if
75
88
  VARIABLES[:RBBT_NOCOLOR] = "true" if options[:nocolor]
76
89
  VARIABLES[:RBBT_NO_PROGRESS] = "true" if options[:nobar]
77
90
 
91
+ options[:ruby_version] ||= "2.4.1"
92
+
78
93
 
79
94
  provision_script =<<-EOF
80
95
  #!/bin/bash -x
@@ -82,6 +97,9 @@ provision_script =<<-EOF
82
97
  echo "RUNNING PROVISION"
83
98
  echo
84
99
  echo "CMD: #{File.basename($0) + " " + orig_argv.collect{|a| a =~ /\s/ ? "\'#{a}\'" : a }.join(" ")}"
100
+ echo
101
+ echo -n "Starting: "
102
+ date
85
103
 
86
104
  EOF
87
105
 
@@ -95,16 +113,32 @@ else
95
113
  end
96
114
  }
97
115
 
98
- echo "2. Setting up ruby"
116
+ #{
117
+ if not SKIP_BASE_SYSTEM and R_CUSTOM
118
+ "echo 1.1 Setting custom R"
119
+ File.read(script_dir + 'R_setup.sh')
120
+ end
121
+ }
122
+
123
+ echo "2. Setting up tokyocabinet"
124
+ #{
125
+ if not SKIP_TOKYOCABINET
126
+ File.read(script_dir + 'tokyocabinet_setup.sh')
127
+ else
128
+ "echo SKIPPED\necho"
129
+ end
130
+ }
131
+
132
+ echo "3. Setting up ruby"
99
133
  #{
100
134
  if not SKIP_RUBY
101
- File.read(script_dir + 'ruby_setup.sh')
135
+ "export RUBY_VERSION='#{options[:ruby_version]}'\n" << File.read(script_dir + 'ruby_setup.sh')
102
136
  else
103
137
  "echo SKIPPED\necho"
104
138
  end
105
139
  }
106
140
 
107
- echo "3. Setting up gems"
141
+ echo "3.1. Setting up gems"
108
142
  #{
109
143
  if not SKIP_GEM
110
144
  File.read(script_dir + 'gem_setup.sh')
@@ -220,6 +254,8 @@ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc /usr/share/man /usr
220
254
 
221
255
  echo
222
256
  echo "Installation done."
257
+ date
258
+
223
259
  EOF
224
260
 
225
261
  docker_dependency = options[:docker_dependency]
@@ -234,6 +270,9 @@ if options[:docker]
234
270
  volumnes = options[:volumnes].split(/\s*[,|]\s*/).collect{|d| "VOLUME " << d} * "\n"
235
271
  dockerfile_text.sub!(/^RUN/, volumnes + "\nRUN")
236
272
  end
273
+ if options[:R_packages]
274
+ dockerfile_text.sub!(/^(# END PROVISION)/, '\1' + "\n" + Open.read(File.join(script_dir, 'Dockerfile.R-packages')) + "\n" )
275
+ end
237
276
  TmpFile.with_file(nil, false) do |dir|
238
277
  FileUtils.mkdir_p dir
239
278
  Path.setup(dir)
@@ -252,3 +291,44 @@ else
252
291
  puts provision_script
253
292
  end
254
293
 
294
+ if singularity_image = options[:singularity]
295
+ docker_dep = options[:docker_dependency] || 'ubuntu'
296
+
297
+ TmpFile.with_file(nil, false) do |dir|
298
+ Path.setup(dir)
299
+
300
+ provision_file = dir['provision.sh']
301
+
302
+ bootstrap_text=<<-EOF
303
+ Bootstrap: docker
304
+ From: #{docker_dep}
305
+
306
+ %post
307
+ cat > /tmp/rbbt_provision.sh <<"EOS"
308
+ #{provision_script}
309
+ EOS
310
+ bash /tmp/rbbt_provision.sh
311
+ EOF
312
+ FileUtils.mkdir_p dir
313
+ Open.write(dir["singularity_bootstrap"].find, bootstrap_text)
314
+ Open.write(provision_file, provision_script)
315
+
316
+ puts "RUN"
317
+ puts "==="
318
+ cmd_create = "singularity create -s 2048 #{singularity_image}"
319
+ cmd_boot = "singularity bootstrap #{singularity_image} '#{dir["singularity_bootstrap"]}'"
320
+ puts cmd_create
321
+ io = CMD.cmd(cmd_create, :pipe => true, :log => true)
322
+ while line = io.gets
323
+ puts line
324
+ end
325
+
326
+ puts cmd_boot
327
+ io = CMD.cmd(cmd_boot, :pipe => true, :log => true)
328
+ while line = io.gets
329
+ puts line
330
+ end
331
+ end
332
+
333
+ end
334
+
@@ -0,0 +1,16 @@
1
+ RUN echo "install.packages(c('Rcpp','RJSONIO','XML'), repos='http://cran.us.r-project.org')" | R --vanilla
2
+ RUN wget 'https://cran.r-project.org/src/contrib/Archive/plyr/plyr_1.8.1.tar.gz' -O /tmp/plyr_1.8.1.tar.gz
3
+ RUN R CMD INSTALL /tmp/plyr_1.8.1.tar.gz
4
+ RUN wget 'https://cran.r-project.org/src/contrib/Archive/car/car_2.0-22.tar.gz' -O /tmp/car_2.0-22.tar.gz
5
+ RUN R CMD INSTALL /tmp/car_2.0-22.tar.gz
6
+ RUN echo "install.packages(c('digest', 'gtable', 'reshape2', 'scales', 'proto'), repos='http://cran.us.r-project.org')" | R --vanilla
7
+ RUN wget 'https://cran.r-project.org/src/contrib/Archive/ggplot2/ggplot2_1.0.0.tar.gz' -O /tmp/ggplot2_1.0.0.tar.gz
8
+ RUN R CMD INSTALL /tmp/ggplot2_1.0.0.tar.gz
9
+ RUN wget 'https://cran.r-project.org/src/contrib/Archive/ggthemes/ggthemes_1.7.0.tar.gz' -O /tmp/ggthemes_1.7.0.tar.gz
10
+ RUN R CMD INSTALL /tmp/ggthemes_1.7.0.tar.gz
11
+ RUN wget 'https://cran.r-project.org/src/contrib/gridSVG_1.5-0.tar.gz' -O /tmp/gridSVG_1.5-0.tar.gz
12
+ RUN R CMD INSTALL /tmp/gridSVG_1.5-0.tar.gz
13
+ RUN echo "install.packages(c('NMF'), repos='http://cran.us.r-project.org')" | R --vanilla
14
+ RUN echo "install.packages(c('Cairo','drc', 'Rserve'), repos='http://cran.us.r-project.org')" | R --vanilla
15
+ RUN echo "source('http://bioconductor.org/biocLite.R'); biocLite('limma')" | R --vanilla
16
+ RUN rm /tmp/*.gz
@@ -0,0 +1,25 @@
1
+ #!/bin/bash -x
2
+
3
+ # R INSTALL
4
+ # ============
5
+
6
+ cd /tmp
7
+
8
+ apt-get remove r-base-core
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
12
+
13
+ cd R-3.3.2/
14
+ ./configure --prefix=/usr/local --enable-R-shlib
15
+ make && make install
16
+
17
+ grep -v R_HOME /etc/profile > profile.tmp
18
+ echo >> profile.tmp
19
+ echo "# For RSRuby gem " >> profile.tmp
20
+ echo "export R_HOME='/usr/local/lib/R'" >> profile.tmp
21
+ echo "export LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:\$R_HOME/lib\"" >> profile.tmp
22
+ echo "export LD_RUN_PATH=\"\$LD_RUN_PATH:\$R_HOME/lib\"" >> profile.tmp
23
+ mv profile.tmp /etc/profile
24
+
25
+ . /etc/profile
@@ -3,16 +3,21 @@
3
3
  # RUBY GEMS and RBBT
4
4
  # =================
5
5
 
6
+ . /etc/profile
7
+
6
8
  export REALLY_GEM_UPDATE_SYSTEM=true
7
9
  env REALLY_GEM_UPDATE_SYSTEM=true gem update --no-ri --no-rdoc --system
8
10
  gem install --force --no-ri --no-rdoc ZenTest
9
11
  gem install --force --no-ri --no-rdoc RubyInline
10
12
 
11
13
  # R (extra config in gem)
12
- gem install --conservative --no-ri --no-rdoc rsruby -- --with-R-dir=/usr/lib/R --with-R-include=/usr/share/R/include --with_cflags="-fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wall -fno-strict-aliasing"
14
+ . /etc/profile
15
+ export R_INCLUDE="$(echo "$R_HOME" | sed 's@/usr/lib\(32\|64\)*@/usr/share@')/include"
16
+ gem install --conservative --no-ri --no-rdoc rsruby -- --with-R-dir="$R_HOME" --with-R-include="$R_INCLUDE" \
17
+ --with_cflags="-fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wall -fno-strict-aliasing"
13
18
 
14
19
  # Java (extra config in gem)
15
- export JAVA_HOME=$(echo /usr/lib/jvm/java-7-openjdk-*)
20
+ export JAVA_HOME=$(echo /usr/lib/jvm/java-?-openjdk-*)
16
21
  gem install --conservative --force --no-ri --no-rdoc rjb
17
22
 
18
23
  # Rbbt and some optional gems
@@ -28,3 +33,5 @@ gem install --no-ri --no-rdoc --force \
28
33
  wget http://ubio.bioinfo.cnio.es/people/mvazquezg/lockfile-2.1.4.gem -O /tmp/lockfile-2.1.4.gem
29
34
  gem install --no-ri --no-rdoc /tmp/lockfile-2.1.4.gem
30
35
 
36
+ # Extra things for web interface
37
+ gem install --no-ri --no-rdoc bio-svgenes mimemagic
@@ -3,13 +3,19 @@
3
3
  # RUBY INSTALL
4
4
  # ============
5
5
 
6
+ _small_version=`echo $RUBY_VERSION | cut -f 1,2 -d.`
6
7
  cd /tmp
7
- wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz
8
- tar -xvzf ruby-2.3.0.tar.gz
9
- cd ruby-2.3.0/
8
+ wget https://cache.ruby-lang.org/pub/ruby/$_small_version/ruby-${RUBY_VERSION}.tar.gz -O "ruby.tar.gz"
9
+ tar -xvzf ruby.tar.gz
10
+ cd ruby-*/
10
11
  ./configure --prefix=/usr/local
11
12
  make && make install
12
13
 
13
- grep "#Ruby2" /etc/profile || echo 'export PATH="/usr/local/bin:$PATH" #Ruby2' >> /etc/profile
14
+ unset _small_version
15
+
16
+ grep '#Ruby2' /etc/profile || echo 'export PATH="/usr/local/bin:$PATH" #Ruby2' >> /etc/profile
14
17
  . /etc/profile
15
18
 
19
+ #\curl -sSL https://get.rvm.io | bash -s stable
20
+ #source /etc/profile.d/rvm.sh
21
+ #rvm install $RUBY_VERSION
@@ -0,0 +1,11 @@
1
+ #!/bin/bash -x
2
+
3
+ # TOKYOCABINET INSTALL
4
+ # ===================
5
+
6
+ cd /tmp
7
+ wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.48.tar.gz -O "tokyocabinet.tar.gz"
8
+ tar -xvzf tokyocabinet.tar.gz
9
+ cd tokyocabinet-1.4.48
10
+ ./configure --prefix=/usr/local
11
+ make && make install
@@ -11,16 +11,19 @@ apt-get -y install \
11
11
  bison autoconf g++ libxslt1-dev make \
12
12
  zlib1g-dev libbz2-dev libreadline6 libreadline6-dev \
13
13
  wget curl git openssl libyaml-0-2 libyaml-dev \
14
- ruby2.0 ruby-dev \
15
- r-base-core r-base-dev r-cran-rserve \
16
- openjdk-7-jdk \
17
- libtokyocabinet-dev tokyocabinet-bin \
14
+ openjdk-8-jdk \
15
+ libcairo2 libcairo2-dev r-base-core r-base-dev r-cran-rserve liblzma5 liblzma-dev libcurl4-openssl-dev \
18
16
  build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev libffi-dev
19
17
 
18
+ # This link was broken for some reason
19
+ rm /usr/lib/R/bin/Rserve
20
+ ln -s /usr/lib/R/site-library/Rserve/libs/Rserve /usr/lib/R/bin/Rserve
20
21
 
21
22
  grep R_HOME /etc/profile || echo "export R_HOME='/usr/lib/R' # For Ruby's RSRuby gem" >> /etc/profile
22
23
  . /etc/profile
23
24
 
24
- # This link was broken for some reason
25
- rm /usr/lib/R/bin/Rserve
26
- ln -s /usr/lib/R/site-library/Rserve/libs/Rserve /usr/lib/R/bin/Rserve
25
+ apt-get clean
26
+ rm -rf /var/lib/apt/lists/*
27
+
28
+
29
+
@@ -16,3 +16,4 @@ test -z ${BOOTSTRAP_CPUS+x} && BOOTSTRAP_CPUS="2"
16
16
 
17
17
  test -z ${RBBT_LOG+x} && RBBT_LOG="LOW"
18
18
 
19
+ test -z ${RUBY_VERSION+x} && RUBY_VERSION="2.4.1"
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.22
4
+ version: 0.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-11 00:00:00.000000000 Z
11
+ date: 2017-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util
@@ -39,9 +39,12 @@ files:
39
39
  - bin/build_rbbt_provision_sh.rb
40
40
  - bin/run_rbbt_docker.rb
41
41
  - lib/rbbt/docker.rb
42
+ - share/provision_scripts/Dockerfile.R-packages
43
+ - share/provision_scripts/R_setup.sh
42
44
  - share/provision_scripts/bootstrap.sh
43
45
  - share/provision_scripts/gem_setup.sh
44
46
  - share/provision_scripts/ruby_setup.sh
47
+ - share/provision_scripts/tokyocabinet_setup.sh
45
48
  - share/provision_scripts/ubuntu_setup.sh
46
49
  - share/provision_scripts/user_setup.sh
47
50
  - share/provision_scripts/variables.sh
@@ -65,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
68
  version: '0'
66
69
  requirements: []
67
70
  rubyforge_project:
68
- rubygems_version: 2.6.6
71
+ rubygems_version: 2.6.13
69
72
  signing_key:
70
73
  specification_version: 4
71
74
  summary: Build docker and Vagrant (VM) images