Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PE-19049) Add a meep classification feature flag #59

Merged
merged 16 commits into from
Mar 21, 2017

Conversation

jpartlow
Copy link
Contributor

This is part of a cluster of PRs to update Beaker plugins and the pe_acceptance_test suite for meep with classification.


(PE-19049,PE-18718,PE-18799) Provide a test method for meep classific… …
…ation

so we can adjust tests and setup steps that need to work either with old
pe node groups, or with meep.

Ultimately the test is just based on version boundary. But while we are
validating meep classification, we need to be able to toggle around a
temporary feature flag: the pe_infrastructure::use_meep_for_classification
parameter.

The function checks to see if this has been passed into
beaker via the hosts file answers hash. These are answers which
beaker-answers would include in the pe.conf it generates.

It can also be set from an ENV['PE_USE_MEEP_FOR_CLASSIFICATION']
variable. This will make it easier to setup temporary ci jobs.

The answer file setting will take precedence over the environment
variable.


(PE-19049) Modify how we obtain console dispatcher for frictionless …
platform configuration of the master node. Expect to use the
beaker-pe-large-environments::classification#get_dispatcher()
method, which will only be present during a pe_acceptance_tests run,
when beaker-pe-large-environments is part of the gem bundle.


(PE-19049,PE-11353) Ensure puppet service is stopped in 2017.1+ builds …
We began managing the puppet service in 2017.1.0 and need to ensure it
is stopped and disabled after installation, otherwise each subsequent
puppet agent run will restart the agent service, causing potential havoc
in smoke tests or other setup steps.

jpartlow and others added 10 commits February 23, 2017 14:41
The version variable is not used in the fetch_pe_on_windows method (and
hopefully wasn't producing a useful side effect...)

The removed snapshot and box keys in HOST_DEFAULTS were being
overwritten by later keys in the same hash definition and were producing
warnings...
…ation

so we can adjust tests and setup steps that need to work either with old
pe node groups, or with meep.

Ultimately the test is just based on version boundary. But while we are
validating meep classification, we need to be able to toggle around a
temporary feature flag: the pe_infrastructure::use_meep_for_classification
parameter.

The function checks to see if this has been passed into
beaker via the hosts file answers hash. These are answers which
beaker-answers would include in the pe.conf it generates.

It can also be set from an ENV['PE_USE_MEEP_FOR_CLASSIFICATION']
variable. This will make it easier to setup temporary ci jobs.

The answer file setting will take precedence over the environment
variable.
The individual specs were already requiring beaker. This change just
centralizes that into the spec_helper, and removes the
beaker_test_helper now that we are using Beaker 3.
platform configuration of the master node. Expect to use the
beaker-pe-large-environments::classification#get_dispatcher()
method, which will only be present during a pe_acceptance_tests run,
when beaker-pe-large-environments is part of the gem bundle.
The mock hosts being generated for tests where failing when :exec was
called, despite the allow() in the helpers.rb make_host() function.
Using a Beaker::Host resolved this.
We began managing the puppet service in 2017.1.0 and need to ensure it
is stopped and disabled after installation, otherwise each subsequent
puppet agent run will restart the agent service, causing potential havoc
in smoke tests or other setup steps.
...using the update_pe_conf function.  Since a null isn't meaningful
for a hocon lookup parameter in pe.conf (or at least, I can't think of
why it would be, at the moment), a nil can be used to remove a parameter
that we want to clean up from the file. It's possible I am overlooking
something tricky about nil, undef in hiera/lookup...it might be
applicable to a nodes.conf file where we wanted to clear a parameter on
a specific node that had been set in pe.conf, but this function only
applies to pe.conf, so I think this is acceptable for now.
This is necessary if we need to adjust parameters for a specific node
rather than for all infrastructure via pe.conf.
…vice

This commit updates the condition on performing the
`configure_puppet_agent_service` to be gated with
`use_meep_for_classification` so that it will automatically be set to
whatever arbitrary version we activate MEEP on.
@jpartlow jpartlow changed the title (PE-19049) (PE-19049) Add a meep classification feature flag Feb 23, 2017
@puppetlabs-jenkins
Copy link
Contributor

Can one of the admins verify this patch?

@puppetlabs-jenkins
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker-pe_btc-intn/176/

jpartlow and others added 4 commits March 9, 2017 18:01
Because scooter can in fact be in the bundle based on the GEM_SOURCE
setting, these specs can break, and it is not worth the effort reworking
the tests to be conditional based on presence or absence of the scooter
gem. RE-8616 should make the scooter gem public and then we don't need
to dance around it like this.
Prior to this commit we were essentially always passing in a config
to the installer during upgrades because we typically provide some
sort of custom answers for many tests. This meant that we were not
really testing upgrades without a config file being passed in.
This commit updates the beaker to not pass in a config/`-c` option
on upgrades from a MEEP install. In order to pass in the custom answers,
I have instead made use of the `update_pe_conf` method to inject the
answers.
The `do_install` method was getting a bit cluttered with too many
levels of logic, so I've moved the pe.conf setup steps out
into their own method, `setup_pe_conf`
The new functionality in `do_install` to copy the `conf.d` folder
@puppetlabs-jenkins
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker-pe_btc-intn/179/

demophoon and others added 2 commits March 15, 2017 18:36
This commit stops beaker from setting up additional pe_repo platform
classes on the master node group when using meep for classification as
this is handled in pe.conf with the agent_platform array with an array
of platform tags instead.
…-flag' into pe-modules-next

* issue/flanders/pe-19049-add-meep-classification-feature-flag:
  (PE-19831) Remove pe_repo classes from meep classification
  (PE-19438) Mock `scp_from` for `do_install`
  (PE-19438) Move pe.conf setup into descriptive function
  (PE-19438) Stop passing -c to upgrades from MEEP
  (PE-19049) Remove get_console_dispatcher_for_beaker_pe specs
  (PE-19049) use_meep_for_classification for configure_puppet_agent_service
  (PE-19049) Add helper method to read a hocon key from pe.conf
  (PE-19049) Add method to create or update a meep node.conf file
  (PE-19049) Can remove parameters from pe.conf
  (PE-19049,PE-11353) Ensure puppet service is stopped in 2017.1+ builds
  (maint) Use a Beaker::Host instance when mocking hosts
  (PE-19049) Modify how we obtain console dispatcher for frictionless
  (maint) Require beaker directly in spec_helper
  (PE-19049,PE-18718,PE-18799) Provide a test method for meep classification
  (maint) Remove unused variables
@puppetlabs-jenkins
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
http://jenkins-beaker.delivery.puppetlabs.net//job/qe_beaker-pe_btc-intn/185/

@demophoon
Copy link
Contributor

Frankenbuild run from mono smoke on 2017.2.x branch of pe_acceptance_tests with beaker-pe pointed at this PR

      - Host Configuration Summary -


              - Test Case Summary for suite 'tests' -
       Total Suite Time: 1129.00 seconds
      Average Test Time: 19.14 seconds
              Attempted: 59
                 Passed: 50
                 Failed: 0
                Errored: 0
                Skipped: 9
                Pending: 0
                  Total: 59

      - Specific Test Case Status -

Beaker completed successfully, thanks.
# Frankenbuilder Settings
# ----------------------------------------
# HYPERVISOR           | vmpooler
# CONFIGURATION        | mono
# BUILD                | 2017.2.0-rc1-167-g9e36a39
# PLATFORM             | el-7-x86_64
# TEMPLATE             | centos-7-x86_64
# PRE_SUITE_TESTS[@]   | /Users/britt/projects/work/yellow/pe_acceptance_tests/setup/install.rb
# TESTS[@]             | /Users/britt/projects/work/yellow/pe_acceptance_tests/acceptance/tests/
# HELPER               | /Users/britt/projects/work/yellow/pe_acceptance_tests/lib/beaker_helper.rb
# PRESERVE_HOSTS       | always
# ----------------------------------------
# Rerun with: ./builder 2017.2 --install --smoke --pe_acceptance_tests pe_acceptance_tests --vmpooler

@jpartlow
Copy link
Contributor Author

Mono frictionless upgrade, one agent, without pe-modules-next flag passed.

              - Test Case Summary for suite 'tests' -
       Total Suite Time: 1318.86 seconds
      Average Test Time: 22.35 seconds
              Attempted: 59
                 Passed: 51
                 Failed: 0
                Errored: 0
                Skipped: 8
                Pending: 0
                  Total: 59

      - Specific Test Case Status -
        
Failed Tests Cases:
Errored Tests Cases:
Skipped Tests Cases:
                  Test Case /home/jpartlow/work/src/other/pe_acceptance_tests/acceptance/tests/analytics/new_update.rb 
                  Test Case /home/jpartlow/work/src/other/pe_acceptance_tests/acceptance/tests/analytics/opt_out.rb 
                  Test Case /home/jpartlow/work/src/other/pe_acceptance_tests/acceptance/tests/mcollective/collectives.rb 
                  Test Case /home/jpartlow/work/src/other/pe_acceptance_tests/acceptance/tests/pe_checks/pe_repo_checks.rb 
                  Test Case /home/jpartlow/work/src/other/pe_acceptance_tests/acceptance/tests/security/admin_api_check.rb 
                  Test Case /home/jpartlow/work/src/other/pe_acceptance_tests/acceptance/tests/security/client_tls_verification.rb 
                  Test Case /home/jpartlow/work/src/other/pe_acceptance_tests/acceptance/tests/security/orch1552_pcp_agents_cant_send_unknown_messages.rb 
                  Test Case /home/jpartlow/work/src/other/pe_acceptance_tests/acceptance/tests/security/pe13452_pcp_agents_cant_send_commands.rb 
...
Beaker completed successfully, thanks.
# Frankenbuilder Settings
# ----------------------------------------
# HYPERVISOR           | vmpooler
# CONFIGURATION        | mono
# BUILD                | 2017.2.0-rc1-168-g0f227be
# UPGRADE_FROM         | 2016.4.3
# PLATFORM             | el-7-x86_64
# TEMPLATE             | centos-7-x86_64
# PRE_SUITE_TESTS[@]   | /home/jpartlow/work/src/other/pe_acceptance_tests/setup/install.rb,/home/jpartlow/work/src/other/pe_acceptance_tests/setup/frictionless_agent_upgrade.rb
# TESTS[@]             | /home/jpartlow/work/src/other/pe_acceptance_tests/acceptance/tests/
# HELPER               | /home/jpartlow/work/src/other/pe_acceptance_tests/lib/beaker_helper.rb
# AGENTS[@]            | ubuntu-16.04-amd64
# PRESERVE_HOSTS       | onfail
# ----------------------------------------
# Rerun with: ./frankenbuilder 2017.2.0-rc1-168-g0f227be --install --frictionless-upgrade --upgrade-from 2016.4.3 --smoke --vmpooler --agent ubuntu-16.04-amd64

@demophoon
Copy link
Contributor

Lei install smoke tests:

      - Host Configuration Summary -


              - Test Case Summary for suite 'tests' -
       Total Suite Time: 1292.09 seconds
      Average Test Time: 21.90 seconds
              Attempted: 59
                 Passed: 50
                 Failed: 0
                Errored: 1
                Skipped: 8
                Pending: 0
                  Total: 59

      - Specific Test Case Status -

Failed Tests Cases:
Errored Tests Cases:
                              Test Case /Users/britt/projects/work/yellow/pe_acceptance_tests/acceptance/tests/pe_checks/orchestrator_puppet_job_run.rb reported: #<Beaker::Host::CommandFailure: Host 'm5yr54f0odc3wtb.delivery.puppetlabs.net' exited with 1 running:
                             puppet job run --url https://m5yr54f0odc3wtb.delivery.puppetlabs.net:8143 --nodes m5yr54f0odc3wtb.delivery.puppetlabs.net,ban53tubbkvsp7q.delivery.puppetlabs.net,tab5ddats1mxhk4.delivery.puppetlabs.net,igon46tydxh7716.delivery.puppetlabs.net,xuaetfbaa7j2csj.delivery.puppetlabs.net
                            Last 10 lines of output were:
                                    Resource events: 0 failed 1 changed 909 unchanged 0 skipped 0 noop
                                    Report: https://m5yr54f0odc3wtb.delivery.puppetlabs.net/#/cm/report/8f620b04f0659a264f0093371185ac12d87b83ae
                                Started puppet run on ban53tubbkvsp7q.delivery.puppetlabs.net ...
                                Finished puppet run on ban53tubbkvsp7q.delivery.puppetlabs.net - Success!
                                    Resource events: 0 failed 3 changed 185 unchanged 0 skipped 0 noop
                                    Report: https://m5yr54f0odc3wtb.delivery.puppetlabs.net/#/cm/report/c2a3725a1ca9366b171ec065d033ccfd1ff8e034
                                Job finished with failures

                                Job failed. 1 run failed, 0 runs skipped, 4 runs succeeded.
                                Duration: 1 min, 4 sec>
                                Test line: /Users/britt/projects/work/yellow/pe_acceptance_tests/acceptance/tests/pe_checks/orchestrator_puppet_job_run.rb:111:in `block (3 levels) in run_test'
                            Failed running the test suite.

# Frankenbuilder Settings
# ----------------------------------------
# HYPERVISOR           | vmpooler
# CONFIGURATION        | mono
# BUILD                | 2017.2.0-rc1-168-g0f227be
# PLATFORM             | el-7-x86_64
# TEMPLATE             | centos-7-x86_64
# PRE_SUITE_TESTS[@]   | /Users/britt/projects/work/yellow/pe_acceptance_tests/setup/scale/install/
# TESTS[@]             | /Users/britt/projects/work/yellow/pe_acceptance_tests/acceptance/tests/
# HELPER               | /Users/britt/projects/work/yellow/pe_acceptance_tests/lib/beaker_helper.rb
# AGENTS[@]            | el-7-x86_64
# COMPILE_MASTERS[@]   | el-7-x86_64
# HUB_AGENTS[@]        | el-7-x86_64
# SPOKE_AGENTS[@]      | el-7-x86_64
# PRESERVE_HOSTS       | always
# ----------------------------------------
# Rerun with: ./builder 2017.2 --install --smoke --lei --pe_acceptance_tests pe_acceptance_tests --vmpooler

It was determined that the failure shown was unrelated to the changes made in beaker-pe and beaker-pe-large-environments.

@jpartlow
Copy link
Contributor Author

@puppetlabs/beaker This pr and puppetlabs/beaker-pe-large-environments#15 are needed to provide changes in PE installation and configuration for MEEP. We've kept them to one side while we tested out glisan using the pe-modules-next package to isolate changes, but we want to merge them in now so as to allow other teams to begin testing their code using MEEP in glisan.

We've been running some frankenbuilds without the feature-flags to help verify that the patches do not break the current methods of installing PE with beaker. So far a mono install and mono frictionless upgrade have passed. Britt had a successful mono lei less one orchestrator transient, and I have a split agent_upgrade underway.

Are there any other tests you guys would like to see, or any questions you have about the two patches before we merge these and release new gems?

@jpartlow
Copy link
Contributor Author

Split upgrade using puppet_agent module passed (without pe-modules-next feature flag)

              - Test Case Summary for suite 'tests' -
       Total Suite Time: 1233.21 seconds
      Average Test Time: 20.90 seconds
              Attempted: 59
                 Passed: 51
                 Failed: 0
                Errored: 0
                Skipped: 8
                Pending: 0
                  Total: 59

      - Specific Test Case Status -
        
Failed Tests Cases:
Errored Tests Cases:
Skipped Tests Cases:
        Test Case /home/jpartlow/work/src/other/pe_acceptance_tests_3/acceptance/tests/analytics/new_update.rb 
        Test Case /home/jpartlow/work/src/other/pe_acceptance_tests_3/acceptance/tests/analytics/opt_out.rb 
        Test Case /home/jpartlow/work/src/other/pe_acceptance_tests_3/acceptance/tests/license_checks/01-ticket_9991_ignore_default_internal_licenses.rb 
        Test Case /home/jpartlow/work/src/other/pe_acceptance_tests_3/acceptance/tests/license_checks/03-ticket_9991_count_new_licenses.rb 
        Test Case /home/jpartlow/work/src/other/pe_acceptance_tests_3/acceptance/tests/pe_checks/QA-1811_services_up_after_restart.rb 
        Test Case /home/jpartlow/work/src/other/pe_acceptance_tests_3/acceptance/tests/pe_checks/pe_repo_checks.rb 
        Test Case /home/jpartlow/work/src/other/pe_acceptance_tests_3/acceptance/tests/security/admin_api_check.rb 
        Test Case /home/jpartlow/work/src/other/pe_acceptance_tests_3/acceptance/tests/security/client_tls_verification.rb 

...
Beaker completed successfully, thanks.
# Frankenbuilder Settings
# ----------------------------------------
# HYPERVISOR           | vmpooler
# CONFIGURATION        | split
# BUILD                | 2017.2.0-rc1-168-g0f227be
# UPGRADE_FROM         | 2016.4.3
# PLATFORM             | el-7-x86_64
# TEMPLATE             | centos-7-x86_64
# PRE_SUITE_TESTS[@]   | /home/jpartlow/work/src/other/pe_acceptance_tests_3/setup/install.rb,/home/jpartlow/work/src/other/pe_acceptance_tests_3/setup/agent_upgrade.rb
# TESTS[@]             | /home/jpartlow/work/src/other/pe_acceptance_tests_3/acceptance/tests/
# HELPER               | /home/jpartlow/work/src/other/pe_acceptance_tests_3/lib/beaker_helper.rb
# AGENTS[@]            | ubuntu-16.04-amd64
# PRESERVE_HOSTS       | onfail
# ----------------------------------------
# Rerun with: ./frankenbuilder 2017.2 --install --split --agent-upgrade --upgrade-from 2016.4.3 --smoke --vmpooler --agent ubuntu-16.04-amd64

@demophoon
Copy link
Contributor

Reran LEI frankenbuilder just to be sure that things are okay:

      - Host Configuration Summary -


              - Test Case Summary for suite 'tests' -
       Total Suite Time: 1312.27 seconds
      Average Test Time: 22.24 seconds
              Attempted: 59
                 Passed: 51
                 Failed: 0
                Errored: 0
                Skipped: 8
                Pending: 0
                  Total: 59

Beaker completed successfully, thanks.
# Frankenbuilder Settings
# ----------------------------------------
# HYPERVISOR           | vmpooler
# CONFIGURATION        | mono
# BUILD                | 2017.2.0-rc1-172-g9422a87
# PLATFORM             | el-7-x86_64
# TEMPLATE             | centos-7-x86_64
# pe_acceptance_tests  | /home/ubuntu/projects/pe_acceptance_tests
# PRE_SUITE_TESTS[@]   | /home/ubuntu/projects/pe_acceptance_tests/setup/scale/install/
# TESTS[@]             | /home/ubuntu/projects/pe_acceptance_tests/acceptance/tests/
# HELPER               | /home/ubuntu/projects/pe_acceptance_tests/lib/beaker_helper.rb
# AGENTS[@]            | el-7-x86_64
# COMPILE_MASTERS[@]   | el-7-x86_64
# HUB_AGENTS[@]        | el-7-x86_64
# SPOKE_AGENTS[@]      | el-7-x86_64
# PRESERVE_HOSTS       | always
# SCRIPT_DIR           | /home/ubuntu/projects/frankenbuilder
# ----------------------------------------
# Rerun with: ./builder 2017.2 --install --smoke --lei

@tvpartytonight
Copy link
Contributor

🎉 time!

@tvpartytonight tvpartytonight merged commit b130ad2 into puppetlabs:master Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants