From 89cd7e741d1b3c1ec1d7484d5eb090f94a0c0ae4 Mon Sep 17 00:00:00 2001 From: Trevor Vaughan Date: Tue, 10 Jul 2018 11:02:10 -0400 Subject: [PATCH] (SIMP-4989) Remove parallelization (#75) Issues with Beaker are causing all parallel activities to fail so they are being disabled by default until we can figure out what's going on. The parallelization can be re-enabled at any time via an environment variable. SIMP-4989 #comment disable parallelization --- CHANGELOG.md | 4 ++++ README.md | 9 +++++++++ lib/simp/beaker_helpers.rb | 19 ++++++++++++------- lib/simp/beaker_helpers/version.rb | 2 +- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa5e062..b2730c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 1.10.12 / 2018-07-09 +* Forced all parallelization to `false` by default due to random issues with + Beaker + ### 1.10.11 / 2018-06-25 * Pinned `fog-openstack` to `0.1.25` for all releases due to dropping support for Ruby 1.9 in `0.1.26`. This should be removed once we drop support for diff --git a/README.md b/README.md index 61a09f4..7a62e0f 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Methods to assist beaker acceptance tests for SIMP. * [`install_puppet`](#install_puppet) * [Environment variables](#environment-variables-1) * [`BEAKER_fips`](#beaker_fips) + * [`BEAKER_SIMP_parallel`](#beaker_simp_parallel) * [`BEAKER_spec_prep`](#beaker_spec_prep) * [`BEAKER_stringify_facts`](#beaker_stringify_facts) * [`BEAKER_use_fixtures_dir_for_modules`](#beaker_use_fixtures_dir_for_modules) @@ -339,6 +340,14 @@ spec_prep` to populate the missing modules using `.fixtures.yml`. Note that this will _not_ update modules that are already present under `spec/fixtures/modules`. +#### `BEAKER_SIMP_parallel` + +_(Default: `no`)_ Execute each SIMP host setup method such as +`Simp::BeakerHelpers::copy_fixure_modules_to` and `Simp::BeakerHelpers::fix_errata_on` +on all hosts in a node set in parallel. Uses parallelization provided by Beaker. + +**NOTE:** Beaker's parallelization capability does not always work, so a word +to the wise is sufficient. #### `BEAKER_stringify_facts` #### `BEAKER_use_fixtures_dir_for_modules` diff --git a/lib/simp/beaker_helpers.rb b/lib/simp/beaker_helpers.rb index 0c91ffb..e140544 100644 --- a/lib/simp/beaker_helpers.rb +++ b/lib/simp/beaker_helpers.rb @@ -165,7 +165,8 @@ def copy_fixture_modules_to( suts = hosts, opts = {}) opts[:pluginsync] = opts.fetch(:pluginsync, true) unless ENV['BEAKER_copy_fixtures'] == 'no' - block_on(suts, :run_in_parallel => true) do |sut| + parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes') + block_on(suts, :run_in_parallel => parallel) do |sut| STDERR.puts " ** copy_fixture_modules_to: '#{sut}'" if ENV['BEAKER_helpers_verbose'] # Use spec_prep to provide modules (this supports isolated networks) @@ -214,7 +215,8 @@ def copy_fixture_modules_to( suts = hosts, opts = {}) def enable_fips_mode_on( suts = hosts ) puts '== configuring FIPS mode on SUTs' puts ' -- (use BEAKER_fips=no to disable)' - block_on(suts, :run_in_parallel => true) do |sut| + parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes') + block_on(suts, :run_in_parallel => parallel) do |sut| puts " -- enabling FIPS on '#{sut}'" # We need to use FIPS compliant algorithms and keylengths as per the FIPS @@ -327,7 +329,8 @@ def enable_yum_repos_on( suts = hosts ) :timeout ] - block_on(suts, :run_in_parallel => true) do |sut| + parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes') + block_on(suts, :run_in_parallel => parallel) do |sut| if sut['yum_repos'] sut['yum_repos'].each_pair do |repo, metadata| repo_manifest = %(yumrepo { #{repo}:) @@ -362,8 +365,8 @@ def enable_yum_repos_on( suts = hosts ) # Apply known OS fixes we need to run Beaker on each SUT def fix_errata_on( suts = hosts ) - - block_on(suts, :run_in_parallel => true) do |sut| + parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes') + block_on(suts, :run_in_parallel => parallel) do |sut| # We need to be able to flip between server and client without issue on sut, 'puppet resource group puppet gid=52' on sut, 'puppet resource user puppet comment="Puppet" gid="52" uid="52" home="/var/lib/puppet" managehome=true' @@ -556,7 +559,8 @@ def copy_keydist_to( ca_sut = master, host_keydist_dir = nil ) # # Can be passed any number of hosts either singly or as an Array def activate_interfaces(hosts) - block_on(hosts, :run_in_parallel => true) do |host| + parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes') + block_on(hosts, :run_in_parallel => parallel) do |host| interfaces_fact = retry_on(host,'facter interfaces', verbose: true).stdout interfaces = interfaces_fact.strip.split(',') @@ -682,7 +686,8 @@ def pluginsync_on( suts = hosts ) noop => false } PLUGINSYNC_MANIFEST - apply_manifest_on(hosts, pluginsync_manifest, :run_in_parallel => true) + parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes') + apply_manifest_on(hosts, pluginsync_manifest, :run_in_parallel => parallel) end diff --git a/lib/simp/beaker_helpers/version.rb b/lib/simp/beaker_helpers/version.rb index 88807c8..d95d85e 100644 --- a/lib/simp/beaker_helpers/version.rb +++ b/lib/simp/beaker_helpers/version.rb @@ -1,5 +1,5 @@ module Simp; end module Simp::BeakerHelpers - VERSION = '1.10.11' + VERSION = '1.10.12' end