summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Rosenboom <j.rosenboom@x-ion.de>2017-02-08 16:34:36 +0000
committerJens Rosenboom <j.rosenboom@x-ion.de>2017-02-09 15:06:49 +0100
commitced5be55122a467d1c6b6f94da64a7a956a35800 (patch)
treedbeffc9027e7e0a9628dcf2fbbd3a7bb8b5d25e6
parentf7f6c282491341a206c4eecb1e2e1d72b9b03651 (diff)
Remove docker-setup receipe
The docker-setup receive has been unmaintained and untested for some time now. The nova-docker project is also being removed from OpenStack [1] and people are advised to look at deploying Zun as a replacement. This also avoids having to rewrite this receipe in order to remove the use of the deprecated python cookbook. [1] https://review.openstack.org/430232 Change-Id: Ia8c9db272c6a0353130fc93d446b385fd72ac250 Partial-Bug: 1558538
Notes
Notes (review): Code-Review+2: Samuel Cassiba <s@cassiba.com> Workflow+1: Jan Klare <j.klare@cloudbau.de> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 10 Feb 2017 09:10:33 +0000 Reviewed-on: https://review.openstack.org/431044 Project: openstack/cookbook-openstack-compute Branch: refs/heads/master
-rw-r--r--README.md1
-rw-r--r--attributes/default.rb23
-rw-r--r--metadata.rb1
-rw-r--r--recipes/compute.rb27
-rw-r--r--recipes/docker-setup.rb65
-rw-r--r--spec/compute_spec.rb47
-rw-r--r--spec/docker-setup-redhat_spec.rb17
-rw-r--r--spec/docker-setup_spec.rb41
8 files changed, 0 insertions, 222 deletions
diff --git a/README.md b/README.md
index 3afa281..cfce7c1 100644
--- a/README.md
+++ b/README.md
@@ -40,7 +40,6 @@ The following cookbooks are dependencies:
40- 'openstack-identity', '>= 14.0.0' 40- 'openstack-identity', '>= 14.0.0'
41- 'openstack-image', '>= 14.0.0' 41- 'openstack-image', '>= 14.0.0'
42- 'openstack-network', '>= 14.0.0' 42- 'openstack-network', '>= 14.0.0'
43- 'python', '~> 1.4.6'
44- 'openstackclient', '>= 0.1.0' 43- 'openstackclient', '>= 0.1.0'
45 44
46Attributes 45Attributes
diff --git a/attributes/default.rb b/attributes/default.rb
index 447dac1..89468de 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -159,7 +159,6 @@ when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
159 'common_packages' => ['openstack-nova-common'], 159 'common_packages' => ['openstack-nova-common'],
160 'iscsi_helper' => 'ietadm', 160 'iscsi_helper' => 'ietadm',
161 'volume_packages' => ['sysfsutils', 'sg3_utils', 'device-mapper-multipath'], 161 'volume_packages' => ['sysfsutils', 'sg3_utils', 'device-mapper-multipath'],
162 'docker_build_pkgs' => ['git', 'python-devel', 'gcc'],
163 'package_overrides' => '' 162 'package_overrides' => ''
164 } 163 }
165when 'debian' 164when 'debian'
@@ -194,7 +193,6 @@ when 'debian'
194 'common_packages' => ['nova-common'], 193 'common_packages' => ['nova-common'],
195 'iscsi_helper' => 'tgtadm', 194 'iscsi_helper' => 'tgtadm',
196 'volume_packages' => ['sysfsutils', 'sg3-utils', 'multipath-tools'], 195 'volume_packages' => ['sysfsutils', 'sg3-utils', 'multipath-tools'],
197 'docker_build_pkgs' => ['git', 'python-dev', 'gcc'],
198 'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'" 196 'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'"
199 } 197 }
200end 198end
@@ -209,27 +207,6 @@ default['openstack']['compute']['misc_paste'] = nil
209 207
210# For true case, this logic allows the following ironic-related attribtes to be overwritten automatically. 208# For true case, this logic allows the following ironic-related attribtes to be overwritten automatically.
211 209
212# Docker configurations
213# Docker compute configuration is supported only in Rhel and Ubuntu
214# This is to be true to make a compute docker type and use nova docker driver as compute driver
215default['openstack']['compute']['docker']['enable'] = false
216# The nova docker driver that will be configured in a docker type compute
217default['openstack']['compute']['docker']['driver'] = 'novadocker.virt.docker.driver.DockerDriver'
218# Additional python packages required for nova docker driver build and installation from git source
219default['openstack']['compute']['docker']['pip_build_pkgs'] = ['setuptools', 'pbr']
220# github repository from which nova-docker source will be downloaded
221default['openstack']['compute']['docker']['github']['repository'] = 'https://github.com/stackforge/nova-docker'
222# github branch from which nova-docker source will be downloaded. Default is master
223default['openstack']['compute']['docker']['github']['branch'] = 'master'
224# Relative path to docker filter files in nova-docker source which will be cloned from git repo
225default['openstack']['compute']['docker']['filter_source_path'] = '/etc/nova/rootwrap.d'
226# Path to docker service sock file
227default['openstack']['compute']['docker']['service_sock'] = '/var/run/docker.sock'
228# Permission level to be assigned to docker service sock file
229default['openstack']['compute']['docker']['service_sock_mode'] = 666
230# Docker group which will be created and added with openstack compute user
231default['openstack']['compute']['docker']['group'] = 'docker'
232
233# ****************** OpenStack Compute Endpoints ****************************** 210# ****************** OpenStack Compute Endpoints ******************************
234 211
235# The OpenStack Compute (Nova) XVPvnc endpoint 212# The OpenStack Compute (Nova) XVPvnc endpoint
diff --git a/metadata.rb b/metadata.rb
index 07353eb..f36efb5 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -17,5 +17,4 @@ depends 'openstack-common', '>= 14.0.0'
17depends 'openstack-identity', '>= 14.0.0' 17depends 'openstack-identity', '>= 14.0.0'
18depends 'openstack-image', '>= 14.0.0' 18depends 'openstack-image', '>= 14.0.0'
19depends 'openstack-network', '>= 14.0.0' 19depends 'openstack-network', '>= 14.0.0'
20depends 'python', '~> 1.4'
21depends 'openstackclient' 20depends 'openstackclient'
diff --git a/recipes/compute.rb b/recipes/compute.rb
index e1ead5e..6f8680f 100644
--- a/recipes/compute.rb
+++ b/recipes/compute.rb
@@ -23,10 +23,6 @@ class ::Chef::Recipe
23 include ::Openstack 23 include ::Openstack
24end 24end
25 25
26if node['openstack']['compute']['docker']['enable']
27 include_recipe 'openstack-compute::docker-setup'
28end
29
30include_recipe 'openstack-compute::nova-common' 26include_recipe 'openstack-compute::nova-common'
31platform_options = node['openstack']['compute']['platform'] 27platform_options = node['openstack']['compute']['platform']
32 28
@@ -70,29 +66,6 @@ end
70 66
71include_recipe 'openstack-compute::libvirt' 67include_recipe 'openstack-compute::libvirt'
72 68
73docker_filter_source_path = node['openstack']['compute']['docker']['filter_source_path']
74install_directory = "#{Chef::Config['file_cache_path']}/nova-docker"
75docker_group = node['openstack']['compute']['docker']['group']
76docker_group_members = node['openstack']['compute']['service_user']
77filter_target_path = docker_filter_source_path + '/docker.filters'
78filter_source_path = install_directory + filter_target_path
79
80group docker_group do
81 members docker_group_members
82 action [:create, :manage]
83 only_if { node['openstack']['compute']['docker']['enable'] }
84end
85
86file 'docker.filter' do
87 owner 'root'
88 group 'root'
89 mode 00644
90 path filter_target_path
91 content lazy { ::File.open(filter_source_path).read }
92 action :create
93 only_if { node['openstack']['compute']['docker']['enable'] }
94end
95
96service 'nova-compute' do 69service 'nova-compute' do
97 service_name platform_options['compute_compute_service'] 70 service_name platform_options['compute_compute_service']
98 supports status: true, restart: true 71 supports status: true, restart: true
diff --git a/recipes/docker-setup.rb b/recipes/docker-setup.rb
deleted file mode 100644
index ebae397..0000000
--- a/recipes/docker-setup.rb
+++ /dev/null
@@ -1,65 +0,0 @@
1# encoding: UTF-8
2#
3# Cookbook Name:: openstack-compute
4# Recipe:: docker-setup
5#
6# Copyright 2015 IBM Corp.
7#
8# Licensed under the Apache License, Version 2.0 (the "License"); you may
9# not use this file except in compliance with the License. You may obtain
10# a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17# License for the specific language governing permissions and limitations
18# under the License.
19
20# Make sure that docker runtime is installed as a prerequsite
21
22include_recipe 'python::pip'
23
24# set nova docker driver as the compute driver
25node.set['openstack']['compute']['driver'] = node['openstack']['compute']['docker']['driver']
26docker_service_sock = node['openstack']['compute']['docker']['service_sock']
27docker_service_sock_mode = node['openstack']['compute']['docker']['service_sock_mode']
28platform_options = node['openstack']['compute']['platform']
29pip_build_pkgs = node['openstack']['compute']['docker']['pip_build_pkgs']
30
31# upgrade the required packages (some packages will be removed once RPM based nova-docker installation is introduced)
32platform_options['docker_build_pkgs'].each do |pkg|
33 package pkg do
34 options platform_options['package_overrides']
35 action :upgrade
36 end
37end
38
39# This will be removed once RPM based installation of nova-docker driver is available
40pip_build_pkgs.each do |pip_pkg|
41 python_pip pip_pkg do
42 action :upgrade
43 end
44end
45
46# Below code downloads docker driver from configured git repo and branch
47github_repository = node['openstack']['compute']['docker']['github']['repository']
48github_branch = node['openstack']['compute']['docker']['github']['branch']
49git_download_directory = "#{Chef::Config['file_cache_path']}/nova-docker"
50
51git git_download_directory do
52 repository github_repository
53 revision github_branch
54 action :sync
55end
56
57# Configure nova docker driver
58bash 'install nova docker driver' do
59 cwd git_download_directory
60 code <<-EOH
61 chmod #{docker_service_sock_mode} #{docker_service_sock}
62 python ./setup.py build
63 python ./setup.py install
64 EOH
65end
diff --git a/spec/compute_spec.rb b/spec/compute_spec.rb
index c3090b0..1dc3a85 100644
--- a/spec/compute_spec.rb
+++ b/spec/compute_spec.rb
@@ -91,52 +91,5 @@ describe 'openstack-compute::compute' do
91 it 'starts nova compute' do 91 it 'starts nova compute' do
92 expect(chef_run).to start_service 'nova-compute' 92 expect(chef_run).to start_service 'nova-compute'
93 end 93 end
94
95 it 'does not include docker-setup recipe' do
96 expect(chef_run).not_to include_recipe 'openstack-compute::docker-setup'
97 end
98
99 it 'does not create docker group' do
100 expect(chef_run).not_to create_group('docker')
101 end
102
103 it 'does not manage docker group' do
104 expect(chef_run).not_to manage_group('docker')
105 end
106
107 it 'does not create docker filter file' do
108 expect(chef_run).not_to create_file('/etc/nova/rootwrap.d/docker.filters')
109 end
110
111 context 'when docker is enabled' do
112 before do
113 node.set['openstack']['compute']['docker']['enable'] = true
114 end
115
116 it 'includes docker-setup recipe' do
117 expect(chef_run).to include_recipe 'openstack-compute::docker-setup'
118 end
119
120 it 'creates docker group' do
121 expect(chef_run).to create_group('docker')
122 end
123
124 it 'manages docker group' do
125 expect(chef_run).to manage_group('docker')
126 end
127
128 it 'creates a file with attributes' do
129 expect(chef_run).to create_file('/etc/nova/rootwrap.d/docker.filters').with(
130 user: 'root',
131 group: 'root',
132 mode: 0644,
133 path: '/etc/nova/rootwrap.d/docker.filters'
134 )
135 end
136
137 it 'configures compute service to subscribe for docker filter' do
138 expect(chef_run.service('nova-compute')).to subscribe_to('file[docker.filter]')
139 end
140 end
141 end 94 end
142end 95end
diff --git a/spec/docker-setup-redhat_spec.rb b/spec/docker-setup-redhat_spec.rb
deleted file mode 100644
index 1529fe2..0000000
--- a/spec/docker-setup-redhat_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
1# encoding: UTF-8
2
3require_relative 'spec_helper'
4
5describe 'openstack-compute::docker-setup' do
6 describe 'redhat' do
7 let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
8 let(:node) { runner.node }
9 cached(:chef_run) { runner.converge(described_recipe) }
10
11 %w(python-devel git gcc).each do |pkg|
12 it do
13 expect(chef_run).to upgrade_package pkg
14 end
15 end
16 end
17end
diff --git a/spec/docker-setup_spec.rb b/spec/docker-setup_spec.rb
deleted file mode 100644
index 25f7e9d..0000000
--- a/spec/docker-setup_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
1# encoding: UTF-8
2
3require_relative 'spec_helper'
4
5describe 'openstack-compute::docker-setup' do
6 describe 'ubuntu' do
7 let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
8 let(:node) { runner.node }
9 cached(:chef_run) { runner.converge(described_recipe) }
10
11 it 'runs a run python pip setuptools' do
12 expect(chef_run).to upgrade_python_pip('setuptools')
13 end
14
15 it 'runs a run python pip pbr' do
16 expect(chef_run).to upgrade_python_pip('pbr')
17 end
18
19 it 'upgrades git package' do
20 expect(chef_run).to upgrade_package 'git'
21 end
22
23 it 'upgrades gcc package' do
24 expect(chef_run).to upgrade_package 'gcc'
25 end
26
27 it 'upgrades python-dev package' do
28 expect(chef_run).to upgrade_package 'python-dev'
29 end
30
31 git_local_dir = Chef::Config[:file_cache_path] + '/nova-docker'
32
33 it 'syncs a git with nova docker git repo' do
34 expect(chef_run).to sync_git(git_local_dir).with(repository: 'https://github.com/stackforge/nova-docker')
35 end
36
37 it 'runs a bash block install nova docker driver' do
38 expect(chef_run).to run_bash('install nova docker driver')
39 end
40 end
41end