From 4299a4356d6b1c222e20339f631808edb9501285 Mon Sep 17 00:00:00 2001 From: Ryan Egesdahl Date: Wed, 21 Jul 2021 12:50:08 -0700 Subject: SERVER-54729 Add explicit dependencies to Debian packages Some dependencies were not being captured automatically by the Debian package build system (namely, the Cyrus SASL modules required for Enterprise), which was causing failures for some users. The explicit dependencies declared in the RPM packages are mirrored in the Debian packaging now. (cherry picked from commit 829e4a097bdf3e54fab7097697242334c4a79154) (cherry picked from commit 7d3fe7a3f137a99fd7985133621cef82ccbe76ec) (cherry picked from commit 47b693a6aeaa142bffcea57984b8e84f60204407) --- .../package_test/recipes/install_mongodb.rb | 40 +++++++++++++++------- .../test/recipes/service/install_mongodb_spec.rb | 4 ++- debian/mongodb-enterprise-unstable.control | 6 ++-- debian/mongodb-enterprise.control | 6 ++-- 4 files changed, 37 insertions(+), 19 deletions(-) diff --git a/buildscripts/package_test/recipes/install_mongodb.rb b/buildscripts/package_test/recipes/install_mongodb.rb index 13489ce7c4d..314ea37e646 100644 --- a/buildscripts/package_test/recipes/install_mongodb.rb +++ b/buildscripts/package_test/recipes/install_mongodb.rb @@ -1,3 +1,6 @@ +# This Chef task installs MongoDB in a new EC2 instance spun up by Kitchen in +# preparation for running some basic server functionality tests. + artifacts_tarball = 'artifacts.tgz' user = node['current_user'] homedir = node['etc']['passwd'][user]['dir'] @@ -24,13 +27,14 @@ end execute 'extract artifacts' do command "tar xzvf #{artifacts_tarball}" + live_stream true cwd homedir end if platform_family? 'debian' # SERVER-40491 Debian 8 sources.list need to point to archive url - if node['platform_version'] == '8.1' + if node['platform'] == 'debian' and node['platform_version'] == '8.1' cookbook_file '/etc/apt/sources.list' do source 'sources.list.debian8' owner 'root' @@ -40,17 +44,26 @@ if platform_family? 'debian' end end - execute 'apt-get update' do - command 'apt-get update' + execute 'apt update' do + command 'apt update' + live_stream true end ENV['DEBIAN_FRONTEND'] = 'noninteractive' package 'openssl' + # the ubuntu 16.04 image does not have some dependencies installed by default + # and it is required for the install_compass script + execute 'install dependencies' do + command 'apt-get install -y python libsasl2-modules-gssapi-mit' + live_stream true + end + # dpkg returns 1 if dependencies are not satisfied, which they will not be # for enterprise builds. We install dependencies in the next block. execute 'install mongod' do command 'dpkg -i `find . -name "*server*.deb"`' + live_stream true cwd homedir returns [0, 1] end @@ -58,6 +71,7 @@ if platform_family? 'debian' # install the tools so we can test install_compass execute 'install mongo tools' do command 'dpkg -i `find . -name "*tools*.deb"`' + live_stream true cwd homedir returns [0, 1] end @@ -65,18 +79,14 @@ if platform_family? 'debian' # yum and zypper fetch dependencies automatically, but dpkg does not. # Installing the dependencies explicitly is fragile, so we reply on apt-get # to install dependencies after the fact. - execute 'install dependencies' do - command 'apt-get update && apt-get -y -f install' - end - - # the ubuntu 16.04 image does not have python installed by default - # and it is required for the install_compass script - execute 'install python' do - command 'apt-get install -y python' + execute 'update and fix broken dependencies' do + command 'apt update && apt -y -f install' + live_stream true end execute 'install mongo shell' do command 'dpkg -i `find . -name "*shell*.deb"`' + live_stream true cwd homedir end end @@ -87,17 +97,20 @@ if platform_family? 'rhel' end execute 'install mongod' do command 'yum install -y `find . -name "*server*.rpm"`' + live_stream true cwd homedir end # install the tools so we can test install_compass execute 'install mongo tools' do command 'yum install -y `find . -name "*tools*.rpm"`' + live_stream true cwd homedir end execute 'install mongo shell' do command 'yum install -y `find . -name "*shell*.rpm"`' + live_stream true cwd homedir end end @@ -117,10 +130,12 @@ if platform_family? 'suse' done exit 1 EOD + flags "-x" end execute 'install mongod' do command 'zypper --no-gpg-checks -n install `find . -name "*server*.rpm"`' + live_stream true cwd homedir end @@ -132,12 +147,13 @@ if platform_family? 'suse' execute 'install mongo' do command 'zypper --no-gpg-checks -n install `find . -name "*shell*.rpm"`' + live_stream true cwd homedir end end inspec_wait = <