Showing with 884 additions and 1,332 deletions.
  1. +18 −4 .fixtures.yml
  2. +3 −21 .github/workflows/auto_release.yml
  3. +18 −0 .github/workflows/call_nightly.yml
  4. +15 −83 .github/workflows/pe_latest_testing.yml
  5. +19 −81 .github/workflows/pe_lts_testing.yml
  6. +138 −0 .github/workflows/pe_nightly_testing.yml
  7. +3 −3 .github/workflows/release.yml
  8. +9 −51 .github/workflows/spec.yml
  9. +1 −5 .pdkignore
  10. +2 −0 .puppet-lint.rc
  11. +212 −8 .rubocop.yml
  12. +0 −1 .ruby-version
  13. +5 −1 .sync.yml
  14. +15 −0 CHANGELOG.md
  15. +24 −24 Gemfile
  16. +13 −102 REFERENCE.md
  17. +2 −1 Rakefile
  18. +0 −421 files/json2timeseriesdb
  19. +115 −157 files/pe_metrics.rb
  20. +1 −5 files/psql_metrics
  21. +0 −59 files/puma_metrics
  22. +1 −1 files/system_metrics
  23. +58 −38 files/tk_metrics
  24. +9 −9 files/vmware_metrics
  25. +0 −53 functions/generate_metrics_server_command.pp
  26. +6 −13 functions/version_based_excludes.pp
  27. +16 −0 manifests/deprecated_parameter.pp
  28. +11 −21 manifests/init.pp
  29. +7 −28 manifests/pe_metric.pp
  30. +10 −5 manifests/service/ace.pp
  31. +10 −5 manifests/service/bolt.pp
  32. +10 −5 manifests/service/console.pp
  33. +9 −4 manifests/service/orchestrator.pp
  34. +9 −4 manifests/service/puppetdb.pp
  35. +12 −7 manifests/service/puppetserver.pp
  36. +13 −7 manifests/system.pp
  37. +22 −9 metadata.json
  38. +42 −0 spec/classes/init_spec.rb
  39. +23 −15 spec/classes/puppet_metrics_collector_system_spec.rb
  40. +1 −28 spec/defines/pe_metric_spec.rb
  41. +0 −51 spec/functions/generate_metrics_server_command_spec.rb
  42. +2 −2 spec/spec_helper.rb
22 changes: 18 additions & 4 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
---
fixtures:
forge_modules:
service: "puppetlabs/service"
package: "puppetlabs/package"
reboot: "puppetlabs/reboot"
repositories:
cron_core: "https://github.com/puppetlabs/puppetlabs-cron_core"
facts: 'https://github.com/puppetlabs/puppetlabs-facts'
puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent'
provision: 'https://github.com/puppetlabs/provision'
bootstrap: "https://github.com/puppetlabs/puppetlabs-bootstrap"
puppet_conf: "https://github.com/puppetlabs/puppetlabs-puppet_conf"
bootstrap: 'https://github.com/puppetlabs/puppetlabs-bootstrap'
puppet_conf: 'https://github.com/puppetlabs/puppetlabs-puppet_conf'
deploy_pe: 'https://github.com/jarretlavallee/puppet-deploy_pe'
ruby_task_helper: "https://git@github.com/puppetlabs/puppetlabs-ruby_task_helper"
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib"
ruby_task_helper: 'https://git@github.com/puppetlabs/puppetlabs-ruby_task_helper'
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib'
bash_task_helper: 'https://github.com/puppetlabs/puppetlabs-bash_task_helper'
node_manager: 'https://github.com/MartyEwings/puppet-node_manager.git'
apply_helpers: 'https://github.com/puppetlabs/puppetlabs-apply_helpers'
debug: 'https://github.com/nwops/puppet-debug'
format: 'https://github.com/voxpupuli/puppet-format'
container_inventory: 'https://gitlab.com/nwops/bolt-container_inventory'
peadm: 'https://github.com/puppetlabs/puppetlabs-peadm.git'
symlinks:
peadm_spec: "#{source_dir}/spec/fixtures/modules/peadm/spec/acceptance/peadm_spec/"
puppetlabs-puppet_metrics_collector: "#{source_dir}"
24 changes: 3 additions & 21 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
workflow_dispatch:

env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
Expand All @@ -14,21 +12,9 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: "Honeycomb: Start recording"
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
with:
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
dataset: ${{ env.HONEYCOMB_DATASET }}
job-status: ${{ job.status }}

- name: "Honeycomb: start first step"
run: |
echo STEP_ID="auto-release" >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: "Checkout Source"
if: ${{ github.repository_owner == 'puppetlabs' }}
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
Expand All @@ -44,13 +30,13 @@ jobs:
if: ${{ github.repository_owner == 'puppetlabs' }}
id: gv
run: |
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
echo "ver=$(jq --raw-output .version metadata.json)" >> $GITHUB_OUTPUT
- name: "Check if a release is necessary"
if: ${{ github.repository_owner == 'puppetlabs' }}
id: check
run: |
git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
git diff --quiet CHANGELOG.md && echo "release=false" >> $GITHUB_OUTPUT || echo "release=true" >> $GITHUB_OUTPUT
- name: "Commit changes"
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
Expand Down Expand Up @@ -84,7 +70,3 @@ jobs:
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: "Honeycomb: Record finish step"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Finished auto release workflow'
18 changes: 18 additions & 0 deletions .github/workflows/call_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Call nightly testing workflows

on:
workflow_dispatch:
schedule:
- cron: '25 5 * * 3'

jobs:
spec_testing:
name: "Spec testing"
uses: ./.github/workflows/spec.yml

nightly_testing:
if: github.repository != 'puppetlabs/puppetlabs-bash_task_helper' && github.repository != 'puppetlabs/puppetlabs-puppet_operations_appliance'
name: "PE Nightly Testing"
needs: spec_testing
uses: ./.github/workflows/pe_nightly_testing.yml
secrets: inherit
98 changes: 15 additions & 83 deletions .github/workflows/pe_latest_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ on:
workflow_dispatch:
workflow_call:

env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests

jobs:
setup_matrix:
name: "Setup Test Matrix"
Expand All @@ -16,19 +12,8 @@ jobs:
matrix: ${{ steps.get-matrix.outputs.matrix }}

steps:
- name: "Honeycomb: Start recording"
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
with:
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
dataset: ${{ env.HONEYCOMB_DATASET }}
job-status: ${{ job.status }}

- name: "Honeycomb: Start first step"
run: |
echo STEP_ID=setup-environment >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: Checkout Source
uses: actions/checkout@v2
uses: actions/checkout@v3
if: ${{ github.repository_owner == 'puppetlabs' }}

- name: Activate Ruby 2.7
Expand All @@ -42,42 +27,31 @@ jobs:
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
echo ::group::bundler environment
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
bundle env
echo ::endgroup::
- name: "Honeycomb: Record Setup Environment time"
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
# store the result of the curl call in $forge_response
- name: Curl Forge for PE versions
id: curl_forge
run: |
echo "::set-output name=forge_response::$(curl https://forge.puppet.com/private/versions/pe)"
echo "forge_response=$(curl https://forge.puppet.com/private/versions/pe)" >> $GITHUB_OUTPUT
- name: Set latest release
id: latest_release
run: |
out=$(jq -c '[.[] | select(.lts == false)][0].latest | {"collection": [.]}' <<<'${{ steps.curl_forge.outputs.forge_response }}')
echo "::set-output name=latest::$out"
echo "latest=$out" >> $GITHUB_OUTPUT
- name: Setup Acceptance Test Matrix
id: get-matrix
run: |
if [[ -e spec/fixtures/matrix/latest.json ]]; then
out=$(jq -c '. + ($matrix | .[])' --slurpfile matrix spec/fixtures/matrix/latest.json <<<'${{ steps.latest_release.outputs.latest }}')
echo "::set-output name=matrix::$out"
echo "matrix=$out" >> $GITHUB_OUTPUT
else
echo "::set-output name=matris::{}"
echo "matrix={}" >> $GITHUB_OUTPUT
fi
- name: "Honeycomb: Record Setup Test Matrix time"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
Acceptance:
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
needs:
Expand All @@ -88,50 +62,26 @@ jobs:
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}

env:
BUILDEVENT_FILE: '../buildevents.txt'

PUPPET_GEM_VERSION: '~> 7.24'
steps:
- run: |
echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE
- name: "Honeycomb: Start recording"
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
with:
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
dataset: ${{ env.HONEYCOMB_DATASET }}
job-status: ${{ job.status }}
matrix-key: ${{ matrix.platforms.label }}-${{ matrix.collection }}

- name: "Honeycomb: start first step"
run: |
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: Checkout Source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Activate Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
bundler-cache: true

- name: Print bundle environment
run: |
echo ::group::bundler environment
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
bundle env
echo ::endgroup::
- name: "Honeycomb: Record Setup Environment time"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: Provision test environment
run: |
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
echo ::group::=== REQUEST ===
cat request.json || true
echo
Expand All @@ -149,40 +99,22 @@ jobs:
echo INVENTORY_PATH=$FILE >> $GITHUB_ENV
- name: Install PE
run: |
buildevents cmd $TRACE_ID $STEP_ID 'rake deploy_pe::provision_master' -- bundle exec bolt --tmpdir /tmp --log-level debug --modulepath spec/fixtures/modules -i ./$INVENTORY_PATH plan run deploy_pe::provision_master --params '{"version":"${{ matrix.collection }}","pe_settings":{"password":"puppetlabs", "configure_tuning": false}}' --targets all --stream
bundle exec bolt --tmpdir /tmp --log-level debug --modulepath spec/fixtures/modules -i ./$INVENTORY_PATH plan run deploy_pe::provision_master --params '{"version":"${{ matrix.collection }}","pe_settings":{"password":"puppetlabs", "configure_tuning": false}}' --targets all --stream
- name: Install module
run: |
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
- name: "Honeycomb: Record deployment times"
if: ${{ always() }}
run: |
echo ::group::honeycomb step
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
echo ::endgroup::
bundle exec rake 'litmus:install_module'
- name: Run acceptance tests
run: |
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel'
- name: "Honeycomb: Record acceptance testing times"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
bundle exec rake 'litmus:acceptance:parallel'
- name: Remove test environment
if: ${{ always() }}
continue-on-error: true
run: |
if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
bundle exec rake 'litmus:tear_down'
echo ::group::=== REQUEST ===
cat request.json || true
echo
echo ::endgroup::
fi
- name: "Honeycomb: Record removal times"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'
Loading