Browse Source

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
changes/44/431044/2
Jens Rosenboom 2 years ago
parent
commit
ced5be5512
8 changed files with 0 additions and 222 deletions
  1. 0
    1
      README.md
  2. 0
    23
      attributes/default.rb
  3. 0
    1
      metadata.rb
  4. 0
    27
      recipes/compute.rb
  5. 0
    65
      recipes/docker-setup.rb
  6. 0
    47
      spec/compute_spec.rb
  7. 0
    17
      spec/docker-setup-redhat_spec.rb
  8. 0
    41
      spec/docker-setup_spec.rb

+ 0
- 1
README.md View File

@@ -40,7 +40,6 @@ The following cookbooks are dependencies:
40 40
 - 'openstack-identity', '>= 14.0.0'
41 41
 - 'openstack-image', '>= 14.0.0'
42 42
 - 'openstack-network', '>= 14.0.0'
43
-- 'python', '~> 1.4.6'
44 43
 - 'openstackclient', '>= 0.1.0'
45 44
 
46 45
 Attributes

+ 0
- 23
attributes/default.rb View File

@@ -159,7 +159,6 @@ when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
159 159
     'common_packages' => ['openstack-nova-common'],
160 160
     'iscsi_helper' => 'ietadm',
161 161
     'volume_packages' => ['sysfsutils', 'sg3_utils', 'device-mapper-multipath'],
162
-    'docker_build_pkgs' => ['git', 'python-devel', 'gcc'],
163 162
     'package_overrides' => ''
164 163
   }
165 164
 when 'debian'
@@ -194,7 +193,6 @@ when 'debian'
194 193
     'common_packages' => ['nova-common'],
195 194
     'iscsi_helper' => 'tgtadm',
196 195
     'volume_packages' => ['sysfsutils', 'sg3-utils', 'multipath-tools'],
197
-    'docker_build_pkgs' => ['git', 'python-dev', 'gcc'],
198 196
     'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'"
199 197
   }
200 198
 end
@@ -209,27 +207,6 @@ default['openstack']['compute']['misc_paste'] = nil
209 207
 
210 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
215
-default['openstack']['compute']['docker']['enable'] = false
216
-# The nova docker driver that will be configured in a docker type compute
217
-default['openstack']['compute']['docker']['driver'] = 'novadocker.virt.docker.driver.DockerDriver'
218
-# Additional python packages required for nova docker driver build and installation from git source
219
-default['openstack']['compute']['docker']['pip_build_pkgs'] = ['setuptools', 'pbr']
220
-# github repository from which nova-docker source will be downloaded
221
-default['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
223
-default['openstack']['compute']['docker']['github']['branch'] = 'master'
224
-# Relative path to docker filter files in nova-docker source which will be cloned from git repo
225
-default['openstack']['compute']['docker']['filter_source_path'] = '/etc/nova/rootwrap.d'
226
-# Path to docker service sock file
227
-default['openstack']['compute']['docker']['service_sock'] = '/var/run/docker.sock'
228
-# Permission level to be assigned to docker service sock file
229
-default['openstack']['compute']['docker']['service_sock_mode'] = 666
230
-# Docker group which will be created and added with openstack compute user
231
-default['openstack']['compute']['docker']['group'] = 'docker'
232
-
233 210
 # ****************** OpenStack Compute Endpoints ******************************
234 211
 
235 212
 # The OpenStack Compute (Nova) XVPvnc endpoint

+ 0
- 1
metadata.rb View File

@@ -17,5 +17,4 @@ depends 'openstack-common', '>= 14.0.0'
17 17
 depends 'openstack-identity', '>= 14.0.0'
18 18
 depends 'openstack-image', '>= 14.0.0'
19 19
 depends 'openstack-network', '>= 14.0.0'
20
-depends 'python', '~> 1.4'
21 20
 depends 'openstackclient'

+ 0
- 27
recipes/compute.rb View File

@@ -23,10 +23,6 @@ class ::Chef::Recipe
23 23
   include ::Openstack
24 24
 end
25 25
 
26
-if node['openstack']['compute']['docker']['enable']
27
-  include_recipe 'openstack-compute::docker-setup'
28
-end
29
-
30 26
 include_recipe 'openstack-compute::nova-common'
31 27
 platform_options = node['openstack']['compute']['platform']
32 28
 
@@ -70,29 +66,6 @@ end
70 66
 
71 67
 include_recipe 'openstack-compute::libvirt'
72 68
 
73
-docker_filter_source_path = node['openstack']['compute']['docker']['filter_source_path']
74
-install_directory = "#{Chef::Config['file_cache_path']}/nova-docker"
75
-docker_group = node['openstack']['compute']['docker']['group']
76
-docker_group_members = node['openstack']['compute']['service_user']
77
-filter_target_path = docker_filter_source_path + '/docker.filters'
78
-filter_source_path = install_directory + filter_target_path
79
-
80
-group docker_group do
81
-  members docker_group_members
82
-  action [:create, :manage]
83
-  only_if { node['openstack']['compute']['docker']['enable'] }
84
-end
85
-
86
-file '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'] }
94
-end
95
-
96 69
 service 'nova-compute' do
97 70
   service_name platform_options['compute_compute_service']
98 71
   supports status: true, restart: true

+ 0
- 65
recipes/docker-setup.rb View File

@@ -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
-
22
-include_recipe 'python::pip'
23
-
24
-# set nova docker driver as the compute driver
25
-node.set['openstack']['compute']['driver'] = node['openstack']['compute']['docker']['driver']
26
-docker_service_sock = node['openstack']['compute']['docker']['service_sock']
27
-docker_service_sock_mode = node['openstack']['compute']['docker']['service_sock_mode']
28
-platform_options = node['openstack']['compute']['platform']
29
-pip_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)
32
-platform_options['docker_build_pkgs'].each do |pkg|
33
-  package pkg do
34
-    options platform_options['package_overrides']
35
-    action :upgrade
36
-  end
37
-end
38
-
39
-# This will be removed once RPM based installation of nova-docker driver is available
40
-pip_build_pkgs.each do |pip_pkg|
41
-  python_pip pip_pkg do
42
-    action :upgrade
43
-  end
44
-end
45
-
46
-# Below code downloads docker driver from configured git repo and branch
47
-github_repository = node['openstack']['compute']['docker']['github']['repository']
48
-github_branch =   node['openstack']['compute']['docker']['github']['branch']
49
-git_download_directory = "#{Chef::Config['file_cache_path']}/nova-docker"
50
-
51
-git git_download_directory do
52
-  repository github_repository
53
-  revision github_branch
54
-  action :sync
55
-end
56
-
57
-# Configure nova docker driver
58
-bash '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
65
-end

+ 0
- 47
spec/compute_spec.rb View File

@@ -91,52 +91,5 @@ describe 'openstack-compute::compute' do
91 91
     it 'starts nova compute' do
92 92
       expect(chef_run).to start_service 'nova-compute'
93 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 94
   end
142 95
 end

+ 0
- 17
spec/docker-setup-redhat_spec.rb View File

@@ -1,17 +0,0 @@
1
-# encoding: UTF-8
2
-
3
-require_relative 'spec_helper'
4
-
5
-describe '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
17
-end

+ 0
- 41
spec/docker-setup_spec.rb View File

@@ -1,41 +0,0 @@
1
-# encoding: UTF-8
2
-
3
-require_relative 'spec_helper'
4
-
5
-describe '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
41
-end

Loading…
Cancel
Save