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
This commit is contained in:
parent
f7f6c28249
commit
ced5be5512
|
@ -40,7 +40,6 @@ The following cookbooks are dependencies:
|
||||||
- 'openstack-identity', '>= 14.0.0'
|
- 'openstack-identity', '>= 14.0.0'
|
||||||
- 'openstack-image', '>= 14.0.0'
|
- 'openstack-image', '>= 14.0.0'
|
||||||
- 'openstack-network', '>= 14.0.0'
|
- 'openstack-network', '>= 14.0.0'
|
||||||
- 'python', '~> 1.4.6'
|
|
||||||
- 'openstackclient', '>= 0.1.0'
|
- 'openstackclient', '>= 0.1.0'
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
|
|
|
@ -159,7 +159,6 @@ when 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
|
||||||
'common_packages' => ['openstack-nova-common'],
|
'common_packages' => ['openstack-nova-common'],
|
||||||
'iscsi_helper' => 'ietadm',
|
'iscsi_helper' => 'ietadm',
|
||||||
'volume_packages' => ['sysfsutils', 'sg3_utils', 'device-mapper-multipath'],
|
'volume_packages' => ['sysfsutils', 'sg3_utils', 'device-mapper-multipath'],
|
||||||
'docker_build_pkgs' => ['git', 'python-devel', 'gcc'],
|
|
||||||
'package_overrides' => ''
|
'package_overrides' => ''
|
||||||
}
|
}
|
||||||
when 'debian'
|
when 'debian'
|
||||||
|
@ -194,7 +193,6 @@ when 'debian'
|
||||||
'common_packages' => ['nova-common'],
|
'common_packages' => ['nova-common'],
|
||||||
'iscsi_helper' => 'tgtadm',
|
'iscsi_helper' => 'tgtadm',
|
||||||
'volume_packages' => ['sysfsutils', 'sg3-utils', 'multipath-tools'],
|
'volume_packages' => ['sysfsutils', 'sg3-utils', 'multipath-tools'],
|
||||||
'docker_build_pkgs' => ['git', 'python-dev', 'gcc'],
|
|
||||||
'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'"
|
'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -209,27 +207,6 @@ default['openstack']['compute']['misc_paste'] = nil
|
||||||
|
|
||||||
# For true case, this logic allows the following ironic-related attribtes to be overwritten automatically.
|
# For true case, this logic allows the following ironic-related attribtes to be overwritten automatically.
|
||||||
|
|
||||||
# Docker configurations
|
|
||||||
# Docker compute configuration is supported only in Rhel and Ubuntu
|
|
||||||
# This is to be true to make a compute docker type and use nova docker driver as compute driver
|
|
||||||
default['openstack']['compute']['docker']['enable'] = false
|
|
||||||
# The nova docker driver that will be configured in a docker type compute
|
|
||||||
default['openstack']['compute']['docker']['driver'] = 'novadocker.virt.docker.driver.DockerDriver'
|
|
||||||
# Additional python packages required for nova docker driver build and installation from git source
|
|
||||||
default['openstack']['compute']['docker']['pip_build_pkgs'] = ['setuptools', 'pbr']
|
|
||||||
# github repository from which nova-docker source will be downloaded
|
|
||||||
default['openstack']['compute']['docker']['github']['repository'] = 'https://github.com/stackforge/nova-docker'
|
|
||||||
# github branch from which nova-docker source will be downloaded. Default is master
|
|
||||||
default['openstack']['compute']['docker']['github']['branch'] = 'master'
|
|
||||||
# Relative path to docker filter files in nova-docker source which will be cloned from git repo
|
|
||||||
default['openstack']['compute']['docker']['filter_source_path'] = '/etc/nova/rootwrap.d'
|
|
||||||
# Path to docker service sock file
|
|
||||||
default['openstack']['compute']['docker']['service_sock'] = '/var/run/docker.sock'
|
|
||||||
# Permission level to be assigned to docker service sock file
|
|
||||||
default['openstack']['compute']['docker']['service_sock_mode'] = 666
|
|
||||||
# Docker group which will be created and added with openstack compute user
|
|
||||||
default['openstack']['compute']['docker']['group'] = 'docker'
|
|
||||||
|
|
||||||
# ****************** OpenStack Compute Endpoints ******************************
|
# ****************** OpenStack Compute Endpoints ******************************
|
||||||
|
|
||||||
# The OpenStack Compute (Nova) XVPvnc endpoint
|
# The OpenStack Compute (Nova) XVPvnc endpoint
|
||||||
|
|
|
@ -17,5 +17,4 @@ depends 'openstack-common', '>= 14.0.0'
|
||||||
depends 'openstack-identity', '>= 14.0.0'
|
depends 'openstack-identity', '>= 14.0.0'
|
||||||
depends 'openstack-image', '>= 14.0.0'
|
depends 'openstack-image', '>= 14.0.0'
|
||||||
depends 'openstack-network', '>= 14.0.0'
|
depends 'openstack-network', '>= 14.0.0'
|
||||||
depends 'python', '~> 1.4'
|
|
||||||
depends 'openstackclient'
|
depends 'openstackclient'
|
||||||
|
|
|
@ -23,10 +23,6 @@ class ::Chef::Recipe
|
||||||
include ::Openstack
|
include ::Openstack
|
||||||
end
|
end
|
||||||
|
|
||||||
if node['openstack']['compute']['docker']['enable']
|
|
||||||
include_recipe 'openstack-compute::docker-setup'
|
|
||||||
end
|
|
||||||
|
|
||||||
include_recipe 'openstack-compute::nova-common'
|
include_recipe 'openstack-compute::nova-common'
|
||||||
platform_options = node['openstack']['compute']['platform']
|
platform_options = node['openstack']['compute']['platform']
|
||||||
|
|
||||||
|
@ -70,29 +66,6 @@ end
|
||||||
|
|
||||||
include_recipe 'openstack-compute::libvirt'
|
include_recipe 'openstack-compute::libvirt'
|
||||||
|
|
||||||
docker_filter_source_path = node['openstack']['compute']['docker']['filter_source_path']
|
|
||||||
install_directory = "#{Chef::Config['file_cache_path']}/nova-docker"
|
|
||||||
docker_group = node['openstack']['compute']['docker']['group']
|
|
||||||
docker_group_members = node['openstack']['compute']['service_user']
|
|
||||||
filter_target_path = docker_filter_source_path + '/docker.filters'
|
|
||||||
filter_source_path = install_directory + filter_target_path
|
|
||||||
|
|
||||||
group docker_group do
|
|
||||||
members docker_group_members
|
|
||||||
action [:create, :manage]
|
|
||||||
only_if { node['openstack']['compute']['docker']['enable'] }
|
|
||||||
end
|
|
||||||
|
|
||||||
file 'docker.filter' do
|
|
||||||
owner 'root'
|
|
||||||
group 'root'
|
|
||||||
mode 00644
|
|
||||||
path filter_target_path
|
|
||||||
content lazy { ::File.open(filter_source_path).read }
|
|
||||||
action :create
|
|
||||||
only_if { node['openstack']['compute']['docker']['enable'] }
|
|
||||||
end
|
|
||||||
|
|
||||||
service 'nova-compute' do
|
service 'nova-compute' do
|
||||||
service_name platform_options['compute_compute_service']
|
service_name platform_options['compute_compute_service']
|
||||||
supports status: true, restart: true
|
supports status: true, restart: true
|
||||||
|
|
|
@ -1,65 +0,0 @@
|
||||||
# encoding: UTF-8
|
|
||||||
#
|
|
||||||
# Cookbook Name:: openstack-compute
|
|
||||||
# Recipe:: docker-setup
|
|
||||||
#
|
|
||||||
# Copyright 2015 IBM Corp.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
# not use this file except in compliance with the License. You may obtain
|
|
||||||
# a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
# License for the specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
|
|
||||||
# Make sure that docker runtime is installed as a prerequsite
|
|
||||||
|
|
||||||
include_recipe 'python::pip'
|
|
||||||
|
|
||||||
# set nova docker driver as the compute driver
|
|
||||||
node.set['openstack']['compute']['driver'] = node['openstack']['compute']['docker']['driver']
|
|
||||||
docker_service_sock = node['openstack']['compute']['docker']['service_sock']
|
|
||||||
docker_service_sock_mode = node['openstack']['compute']['docker']['service_sock_mode']
|
|
||||||
platform_options = node['openstack']['compute']['platform']
|
|
||||||
pip_build_pkgs = node['openstack']['compute']['docker']['pip_build_pkgs']
|
|
||||||
|
|
||||||
# upgrade the required packages (some packages will be removed once RPM based nova-docker installation is introduced)
|
|
||||||
platform_options['docker_build_pkgs'].each do |pkg|
|
|
||||||
package pkg do
|
|
||||||
options platform_options['package_overrides']
|
|
||||||
action :upgrade
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# This will be removed once RPM based installation of nova-docker driver is available
|
|
||||||
pip_build_pkgs.each do |pip_pkg|
|
|
||||||
python_pip pip_pkg do
|
|
||||||
action :upgrade
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Below code downloads docker driver from configured git repo and branch
|
|
||||||
github_repository = node['openstack']['compute']['docker']['github']['repository']
|
|
||||||
github_branch = node['openstack']['compute']['docker']['github']['branch']
|
|
||||||
git_download_directory = "#{Chef::Config['file_cache_path']}/nova-docker"
|
|
||||||
|
|
||||||
git git_download_directory do
|
|
||||||
repository github_repository
|
|
||||||
revision github_branch
|
|
||||||
action :sync
|
|
||||||
end
|
|
||||||
|
|
||||||
# Configure nova docker driver
|
|
||||||
bash 'install nova docker driver' do
|
|
||||||
cwd git_download_directory
|
|
||||||
code <<-EOH
|
|
||||||
chmod #{docker_service_sock_mode} #{docker_service_sock}
|
|
||||||
python ./setup.py build
|
|
||||||
python ./setup.py install
|
|
||||||
EOH
|
|
||||||
end
|
|
|
@ -91,52 +91,5 @@ describe 'openstack-compute::compute' do
|
||||||
it 'starts nova compute' do
|
it 'starts nova compute' do
|
||||||
expect(chef_run).to start_service 'nova-compute'
|
expect(chef_run).to start_service 'nova-compute'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not include docker-setup recipe' do
|
|
||||||
expect(chef_run).not_to include_recipe 'openstack-compute::docker-setup'
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'does not create docker group' do
|
|
||||||
expect(chef_run).not_to create_group('docker')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'does not manage docker group' do
|
|
||||||
expect(chef_run).not_to manage_group('docker')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'does not create docker filter file' do
|
|
||||||
expect(chef_run).not_to create_file('/etc/nova/rootwrap.d/docker.filters')
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when docker is enabled' do
|
|
||||||
before do
|
|
||||||
node.set['openstack']['compute']['docker']['enable'] = true
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'includes docker-setup recipe' do
|
|
||||||
expect(chef_run).to include_recipe 'openstack-compute::docker-setup'
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'creates docker group' do
|
|
||||||
expect(chef_run).to create_group('docker')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'manages docker group' do
|
|
||||||
expect(chef_run).to manage_group('docker')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'creates a file with attributes' do
|
|
||||||
expect(chef_run).to create_file('/etc/nova/rootwrap.d/docker.filters').with(
|
|
||||||
user: 'root',
|
|
||||||
group: 'root',
|
|
||||||
mode: 0644,
|
|
||||||
path: '/etc/nova/rootwrap.d/docker.filters'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'configures compute service to subscribe for docker filter' do
|
|
||||||
expect(chef_run.service('nova-compute')).to subscribe_to('file[docker.filter]')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
# encoding: UTF-8
|
|
||||||
|
|
||||||
require_relative 'spec_helper'
|
|
||||||
|
|
||||||
describe 'openstack-compute::docker-setup' do
|
|
||||||
describe 'redhat' do
|
|
||||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
|
||||||
let(:node) { runner.node }
|
|
||||||
cached(:chef_run) { runner.converge(described_recipe) }
|
|
||||||
|
|
||||||
%w(python-devel git gcc).each do |pkg|
|
|
||||||
it do
|
|
||||||
expect(chef_run).to upgrade_package pkg
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,41 +0,0 @@
|
||||||
# encoding: UTF-8
|
|
||||||
|
|
||||||
require_relative 'spec_helper'
|
|
||||||
|
|
||||||
describe 'openstack-compute::docker-setup' do
|
|
||||||
describe 'ubuntu' do
|
|
||||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
|
||||||
let(:node) { runner.node }
|
|
||||||
cached(:chef_run) { runner.converge(described_recipe) }
|
|
||||||
|
|
||||||
it 'runs a run python pip setuptools' do
|
|
||||||
expect(chef_run).to upgrade_python_pip('setuptools')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'runs a run python pip pbr' do
|
|
||||||
expect(chef_run).to upgrade_python_pip('pbr')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'upgrades git package' do
|
|
||||||
expect(chef_run).to upgrade_package 'git'
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'upgrades gcc package' do
|
|
||||||
expect(chef_run).to upgrade_package 'gcc'
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'upgrades python-dev package' do
|
|
||||||
expect(chef_run).to upgrade_package 'python-dev'
|
|
||||||
end
|
|
||||||
|
|
||||||
git_local_dir = Chef::Config[:file_cache_path] + '/nova-docker'
|
|
||||||
|
|
||||||
it 'syncs a git with nova docker git repo' do
|
|
||||||
expect(chef_run).to sync_git(git_local_dir).with(repository: 'https://github.com/stackforge/nova-docker')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'runs a bash block install nova docker driver' do
|
|
||||||
expect(chef_run).to run_bash('install nova docker driver')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in New Issue