daddy 0.6.0 → 0.6.1

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: f899214f3cbeadeb3fb451453508137be4cdc895
4
- data.tar.gz: 5da79b2b12b6bab34e98cb60f803fa8132598b6f
3
+ metadata.gz: 95f5a9cfe4deb8ec8ffcd81c71bd34ac50b22b88
4
+ data.tar.gz: 43ed2d56b4ba17f5858203925d367d2e78bd33aa
5
5
  SHA512:
6
- metadata.gz: 91d11028da72b3d763c4f8eab72824cd22cfbe88c034d9140c0c9338e195935d0e8ed48bf09e865ff258444b42366f6ac1af78ec7be801e42cfc3399864f331a
7
- data.tar.gz: 44f9dc04a91aa5ea9f7ec35c129117e17a4a40c0de31a3c344e019ac73d7f2ff57e1d407d35c16d031f621ea7d1034c0559a6354898f315a3e45a703b8835ddc
6
+ metadata.gz: c020001baa2ee0ec81200950d266fde8a46d8632fec7555f8283a769dcf24b558ded90e8c7f76b56657325e5fc4a72b1585f866e0e24a2ba9765bf40144fb1be
7
+ data.tar.gz: 6fe2e4f00ad210f4fa61c3d7a5dfd8f0e597c47c6b87ccdf7fc20560a18ae60fc57e7d222ac889acd8febaf98ba55a4e3d2d4d826cd72efd830798151704e58e
@@ -0,0 +1 @@
1
+ dfd0761e0b7e36c1d74c928ad986500c905be5ebcfbc29914d574af1db7218cf bazel-0.8.1-dist.zip
@@ -0,0 +1,22 @@
1
+ directory 'tmp'
2
+
3
+ execute "download bazel-#{Daddy::BAZEL_VERSION}" do
4
+ cwd 'tmp'
5
+ command <<-EOF
6
+ wget https://github.com/bazelbuild/bazel/releases/download/#{Daddy::BAZEL_VERSION}/bazel-#{Daddy::BAZEL_VERSION}-dist.zip -O bazel-#{Daddy::BAZEL_VERSION}-dist.zip
7
+ EOF
8
+ not_if "sha256sum -c #{::File.join(::File.dirname(__FILE__), "bazel-#{Daddy::BAZEL_VERSION}_sha256sum.txt")}"
9
+ end
10
+
11
+ execute "install bazel-#{Daddy::BAZEL_VERSION}" do
12
+ cwd 'tmp'
13
+ command <<-EOF
14
+ rm -Rf bazel-#{Daddy::BAZEL_VERSION}/
15
+ unzip bazel-#{Daddy::BAZEL_VERSION}-dist.zip -d bazel-#{Daddy::BAZEL_VERSION}
16
+ pushd bazel-#{Daddy::BAZEL_VERSION}
17
+ bash ./compile.sh
18
+ sudo cp -f output/bazel /usr/local/bin/
19
+ popd
20
+ EOF
21
+ not_if "which bazel && bazel version | grep 'Build label: #{Daddy::BAZEL_VERSION}-'"
22
+ end
@@ -10,6 +10,33 @@ when /rhel-6\.(.*?)/
10
10
  user 'root'
11
11
  end
12
12
 
13
+ group 'docker' do
14
+ user 'root'
15
+ end
16
+
17
+ execute "add user to docker group" do
18
+ user 'root'
19
+ command "usermod -aG docker #{ENV['USER']}"
20
+ not_if "groups #{ENV['USER']} | grep -E \"\sdocker\""
21
+ end
22
+
23
+ local_ruby_block 'post install message' do
24
+ block do
25
+ message = I18n.t('itamae.messages.docker.after_install', :user => ENV['USER'])
26
+ message.split("\n").map {|line| Itamae.logger.info line }
27
+ end
28
+ action :nothing
29
+ subscribes :run, 'execute[add user to docker group]'
30
+ end
31
+
32
+ local_ruby_block 'post install message' do
33
+ block do
34
+ message = I18n.t('itamae.messages.docker.after_install', :user => ENV['USER'])
35
+ ['', message.split("\n"), ''].flatten.map {|line| Itamae.logger.info line }
36
+ end
37
+ action :nothing
38
+ subscribes :run, 'execute[add user to docker group]'
39
+ end
13
40
  when /rhel-7\.(.*?)/
14
41
  %w{ yum-utils device-mapper-persistent-data lvm2 }.each do |name|
15
42
  package name do
@@ -25,30 +52,20 @@ when /rhel-7\.(.*?)/
25
52
  package 'docker-ce' do
26
53
  user 'root'
27
54
  end
55
+
56
+ group 'docker' do
57
+ user 'root'
58
+ end
59
+
60
+ execute "add user to docker group" do
61
+ command "sudo usermod -a -G docker #{ENV['USER']} && newgrp docker"
62
+ not_if "groups #{ENV['USER']} | grep -E \"\sdocker\""
63
+ end
28
64
  else
29
65
  raise "unsupported operating system: #{os_version}"
30
66
  end
31
67
 
32
- group 'docker' do
33
- user 'root'
34
- end
35
-
36
- execute "add user to docker group" do
37
- user 'root'
38
- command "usermod -aG docker #{ENV['USER']}"
39
- not_if "groups #{ENV['USER']} | grep -E \"\sdocker\""
40
- end
41
-
42
68
  service 'docker' do
43
69
  action [:enable, :start]
44
70
  user 'root'
45
71
  end
46
-
47
- local_ruby_block 'post install message' do
48
- block do
49
- message = I18n.t('itamae.messages.docker.after_install', :user => ENV['USER'])
50
- message.split("\n").map {|line| Itamae.logger.info line }
51
- end
52
- action :nothing
53
- subscribes :run, 'execute[add user to docker group]'
54
- end
@@ -0,0 +1,12 @@
1
+ %w{
2
+ qemu-kvm qemu-img libvirt libvirt-client libvirt-python libguestfs-tools virt-install virt-manager virt-viewer
3
+ }.each do |name|
4
+ package name do
5
+ user 'root'
6
+ end
7
+ end
8
+
9
+ service 'libvirtd' do
10
+ user 'root'
11
+ action [:enable, :start]
12
+ end
@@ -8,7 +8,7 @@ directory '/etc/nginx/conf.d/servers' do
8
8
  end
9
9
 
10
10
  template "/etc/nginx/conf.d/servers/#{ENV['SERVER_NAME']}.conf" do
11
- source 'templates/passenger.conf.erb'
11
+ source ::File.join(File.dirname(__FILE__), 'templates/etc/nginx/conf.d/servers/passenger.conf.erb')
12
12
  user 'root'
13
13
  owner 'root'
14
14
  group 'root'
@@ -78,6 +78,19 @@ end
78
78
  end
79
79
  end
80
80
 
81
+ case os_version
82
+ when /rhel-6\.(.*?)/
83
+ when /rhel-7\.(.*?)/
84
+ template '/etc/tmpfiles.d/passenger.conf' do
85
+ user 'root'
86
+ owner 'root'
87
+ group 'root'
88
+ mode '644'
89
+ variables :path => '/var/run/passenger-instreg',
90
+ :owner => 'root', :group => 'root', :mode => '0755'
91
+ end
92
+ end
93
+
81
94
  template '/etc/nginx/conf.d/default.conf' do
82
95
  user 'root'
83
96
  owner 'root'
@@ -4,6 +4,7 @@ directory '/opt/nginx-rtmp-module' do
4
4
  group ENV['USER']
5
5
  mode '755'
6
6
  end
7
+
7
8
  git '/opt/nginx-rtmp-module/v1.1.11' do
8
9
  repository 'https://github.com/arut/nginx-rtmp-module.git'
9
10
  revision 'v1.1.11'
@@ -1,4 +1,10 @@
1
1
  gem_package 'passenger' do
2
2
  user 'root'
3
- version '5.1.8'
3
+ version Daddy::PASSENGER_VERSION
4
+ end
5
+
6
+ execute "rm -Rf /opt/nginx/nginx-#{Daddy::NGINX_VERSION}" do
7
+ user 'root'
8
+ subscribes :run, 'gem_package[passenger]'
9
+ action :nothing
4
10
  end
@@ -0,0 +1 @@
1
+ cda7d967c9a4bfa52337cdf551bcc5cff026b6ac50a8834e568ce4a794ca81da Python-3.6.3.tar.xz
@@ -0,0 +1,23 @@
1
+ directory 'tmp'
2
+
3
+ execute "download python-#{Daddy::PYTHON_VERSION}" do
4
+ cwd 'tmp'
5
+ command <<-EOF
6
+ curl -O https://www.python.org/ftp/python/#{Daddy::PYTHON_VERSION}/Python-#{Daddy::PYTHON_VERSION}.tar.xz
7
+ EOF
8
+ not_if "sha256sum -c #{::File.join(::File.dirname(__FILE__), "Python-#{Daddy::PYTHON_VERSION}_sha256sum.txt")}"
9
+ end
10
+
11
+ execute "install python-#{Daddy::PYTHON_VERSION}" do
12
+ cwd 'tmp'
13
+ command <<-EOF
14
+ rm -Rf Python-#{Daddy::PYTHON_VERSION}/
15
+ tar Jxf Python-#{Daddy::PYTHON_VERSION}.tar.xz
16
+ pushd Python-#{Daddy::PYTHON_VERSION}
17
+ ./configure --enable-optimizations
18
+ make
19
+ sudo make install
20
+ popd
21
+ EOF
22
+ not_if "which python3 && python3 -V | grep 'Python #{Daddy::PYTHON_VERSION}'"
23
+ end
@@ -0,0 +1,41 @@
1
+ directory '/opt/tensorflow' do
2
+ user 'root'
3
+ owner ENV['USER']
4
+ group ENV['USER']
5
+ mode '755'
6
+ end
7
+
8
+ include_recipe '../python/install'
9
+ include_recipe '../bazel/install'
10
+
11
+ {
12
+ dev: '0.4.0',
13
+ numpy: '1.13.3',
14
+ pip: '9.0.1',
15
+ wheel: '0.30.0'
16
+ }.each do |name, ver|
17
+ pip name.to_s do
18
+ user 'root'
19
+ pip_binary 'pip3'
20
+ version ver
21
+ end
22
+ end
23
+
24
+ git '/opt/tensorflow/r1.4' do
25
+ repository 'https://github.com/tensorflow/tensorflow'
26
+ revision 'r1.4'
27
+ end
28
+
29
+ local_ruby_block 'install tensorflow' do
30
+ cwd '/opt/tensorflow/r1.4'
31
+ block do
32
+ Itamae.logger.info ''
33
+ Itamae.logger.info 'Run following commands to proceed.'
34
+ Itamae.logger.info "\n\n" + <<-EOF
35
+ PYTHON_BIN_PATH=/usr/local/bin/python3 ./configure
36
+ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
37
+ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
38
+ sudo pip3 install /tmp/tensorflow_pkg/tensorflow-1.4.1-cp36-cp36m-linux_x86_64.whl
39
+ EOF
40
+ end
41
+ end
@@ -0,0 +1 @@
1
+ d <%= @path %> <%= @mode %> <%= @owner %> <%= @group %>
@@ -1,4 +1,5 @@
1
1
  STDOUT.sync = true
2
2
  Dir.glob(File.join(File.dirname(__FILE__), 'tasks/*.rake')).each { |r| import r }
3
3
 
4
- set :passenger_restart_with_sudo, true
4
+ require "capistrano/scm/git"
5
+ install_plugin Capistrano::SCM::Git
@@ -0,0 +1,13 @@
1
+ namespace :deploy do
2
+
3
+ desc 'Clear temporary cache'
4
+ task :clear_cache do
5
+ on roles(:web), in: :groups, limit: 3, wait: 10 do
6
+ within release_path do
7
+ execute :rake, 'tmp:cache:clear'
8
+ end
9
+ end
10
+ end
11
+ end
12
+
13
+ after 'deploy:restart', 'deploy:clear_cache'
@@ -2,6 +2,7 @@ require 'capybara/cucumber'
2
2
  require_relative 'cucumber/helpers'
3
3
 
4
4
  Capybara.default_selector = :css
5
+ Capybara.server = :puma if defined?(Puma)
5
6
 
6
7
  Before do
7
8
  resize_window(1280, 720)
data/lib/daddy/version.rb CHANGED
@@ -2,7 +2,13 @@ module Daddy
2
2
  VERSION = [
3
3
  VERSION_MAJOR = '0',
4
4
  VERSION_MINOR = '6',
5
- VERSION_REVISION = '0'
5
+ VERSION_REVISION = '1'
6
+ ].join('.')
7
+
8
+ BAZEL_VERSION = [
9
+ BAZEL_VERSION_MAJOR = '0',
10
+ BAZEL_VERSION_MINOR = '8',
11
+ BAZEL_VERSION_REVISION = '1'
6
12
  ].join('.')
7
13
 
8
14
  NGINX_VERSION = [
@@ -10,4 +16,16 @@ module Daddy
10
16
  NGINX_VERSION_MINOR = '13',
11
17
  NGINX_VERSION_REVISION = '5'
12
18
  ].join('.')
19
+
20
+ PASSENGER_VERSION = [
21
+ PASSENGER_VERSION_MAJOR = '5',
22
+ PASSENGER_VERSION_MINOR = '1',
23
+ PASSENGER_VERSION_REVISION = '12'
24
+ ].join('.')
25
+
26
+ PYTHON_VERSION = [
27
+ PYTHON_VERSION_MAJOR = '3',
28
+ PYTHON_VERSION_MINOR = '6',
29
+ PYTHON_VERSION_REVISION = '3'
30
+ ].join('.')
13
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-09 00:00:00.000000000 Z
11
+ date: 2018-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: itamae-plugin-resource-pip
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: ohai
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -276,6 +290,8 @@ files:
276
290
  - app/assets/stylesheets/ympicker.css.scss
277
291
  - bin/dad
278
292
  - itamae/cookbooks/app_base_dir.rb
293
+ - itamae/cookbooks/bazel/bazel-0.8.1_sha256sum.txt
294
+ - itamae/cookbooks/bazel/install.rb
279
295
  - itamae/cookbooks/docker/install.rb
280
296
  - itamae/cookbooks/docker/registry/install.rb
281
297
  - itamae/cookbooks/epel/install.rb
@@ -283,6 +299,7 @@ files:
283
299
  - itamae/cookbooks/god/install.rb
284
300
  - itamae/cookbooks/jenkins/install.rb
285
301
  - itamae/cookbooks/jenkins/plugins/install.rb
302
+ - itamae/cookbooks/kvm/install.rb
286
303
  - itamae/cookbooks/letsencrypt/install.rb
287
304
  - itamae/cookbooks/memcached/install.rb
288
305
  - itamae/cookbooks/mysql/install.rb
@@ -296,12 +313,15 @@ files:
296
313
  - itamae/cookbooks/nginx/modules/nginx-rtmp-module.rb
297
314
  - itamae/cookbooks/nginx/modules/passenger.rb
298
315
  - itamae/cookbooks/nginx/nginx-1.13.5_sha256sum.txt
299
- - itamae/cookbooks/nginx/templates/passenger.conf.erb
300
- - itamae/cookbooks/nginx/templates/unicorn.conf.erb
316
+ - itamae/cookbooks/nginx/templates/etc/nginx/conf.d/servers/passenger.conf.erb
317
+ - itamae/cookbooks/nginx/templates/etc/nginx/conf.d/servers/unicorn.conf.erb
301
318
  - itamae/cookbooks/obs_studio/install.rb
302
319
  - itamae/cookbooks/phantomjs/install.rb
320
+ - itamae/cookbooks/python/Python-3.6.3_sha256sum.txt
321
+ - itamae/cookbooks/python/install.rb
303
322
  - itamae/cookbooks/redis/install.rb
304
323
  - itamae/cookbooks/sbt/install.rb
324
+ - itamae/cookbooks/tensorflow/install.rb
305
325
  - itamae/cookbooks/trac/install.rb
306
326
  - itamae/cookbooks/unicorn/install.rb
307
327
  - itamae/cookbooks/unicorn/templates/init.d/app.erb
@@ -321,11 +341,13 @@ files:
321
341
  - itamae/templates/etc/nginx/nginx.conf.erb
322
342
  - itamae/templates/etc/sysconfig/jenkins.erb
323
343
  - itamae/templates/etc/systemd/system/tracd.service.erb
344
+ - itamae/templates/etc/tmpfiles.d/passenger.conf.erb
324
345
  - itamae/templates/etc/vsftpd/vsftpd.conf.erb
325
346
  - itamae/templates/etc/yum.repos.d/jenkins.repo.erb
326
347
  - itamae/templates/etc/yum.repos.d/nginx.repo.erb
327
348
  - itamae/templates/lib/systemd/system/nginx.service.erb
328
349
  - lib/capistrano/daddy.rb
350
+ - lib/capistrano/tasks/clear_cache.rake
329
351
  - lib/capistrano/tasks/update_linked_files.rake
330
352
  - lib/daddy.rb
331
353
  - lib/daddy/cucumber.rb