diff --git a/.github/workflows/pmm-package-test-matrix-full.yml b/.github/workflows/pmm-package-test-matrix-full.yml new file mode 100644 index 000000000..a82feacc9 --- /dev/null +++ b/.github/workflows/pmm-package-test-matrix-full.yml @@ -0,0 +1,340 @@ +--- +name: Package Test Matrix + +on: + workflow_dispatch: + inputs: + package_testing_branch: + description: 'Target branch for package-testing repository' + type: string + default: 'master' + required: true + repository: + description: 'Select Repo for Client:' + required: true + default: 'dev-latest' + type: choice + options: + - release + - release candidate + - patch-release candidate + - dev-latest + metrics_mode: + description: 'Select the Metrics Mode for PMM Client:' + required: true + default: 'auto' + type: choice + options: + - auto + - push + - pull + push: + branches: + - PMM-12770-gh-action + +jobs: + get_versions: + name: Get versions + uses: percona/pmm-ui-tests/.github/workflows/pmm-version-getter.yml@main + with: + repository: ${{ inputs.repository || 'release'}} + + c_test: + name: "pmm2-client" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + cu_test: + name: "pmm2-client_upgrade" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_upgrade" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + tb_test: + name: "pmm2-client_custom_path" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_custom_path" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + auth_config_test: + name: "pmm2-client_integration_auth_config" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration_auth_config" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + auth_register_test: + name: "pmm2-client_integration_auth_register" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration_auth_register" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + auth_setup_test: + name: "pmm2-client_integration_auth_setup" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration_auth_setup" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + tbi_test: + name: "pmm2-client_integration_custom_path" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration_custom_path" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + port_test: + name: "pmm2-client_integration_custom_port" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration_custom_port" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + port_u_test: + name: "pmm2-client_integration_upgrade_custom_port" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration_upgrade_custom_port" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + i_test: + name: "pmm2-client_integration" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + iu_test: + name: "pmm2-client_integration_upgrade" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration_upgrade" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + tu_test: + name: "pmm2-client_integration_upgrade_custom_path" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration_upgrade_custom_path" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} diff --git a/.github/workflows/pmm-package-test-matrix.yml b/.github/workflows/pmm-package-test-matrix.yml new file mode 100644 index 000000000..746bf6c9b --- /dev/null +++ b/.github/workflows/pmm-package-test-matrix.yml @@ -0,0 +1,127 @@ +--- +name: Package Test Matrix + +on: + workflow_dispatch: + inputs: + package_testing_branch: + description: 'Target branch for package-testing repository' + type: string + default: 'master' + required: true + repository: + description: 'Select Repo for Client:' + required: true + default: 'dev-latest' + type: choice + options: + - release + - release candidate + - patch-release candidate + - dev-latest + metrics_mode: + description: 'Select the Metrics Mode for PMM Client:' + required: true + default: 'auto' + type: choice + options: + - auto + - push + - pull + push: + branches: + - PMM-12770-gh-action + +jobs: + get_versions: + name: Get versions + uses: percona/pmm-ui-tests/.github/workflows/pmm-version-getter.yml@main + with: + repository: ${{ inputs.repository || 'release'}} + + + playbook: + description: 'Select test to run:' + default: 'pmm2-client_integration' + required: true + type: choice + options: + - pmm2-client_integration + + + + + i_test: + name: "pmm2-client_integration" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + u_test: + name: "pmm2-client_integration_upgrade" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration_upgrade" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} + + t_test: + name: "pmm2-client_integration_upgrade_custom_path" + uses: ./.github/workflows/pmm-package-test.yml + secrets: inherit + needs: get_versions + strategy: + fail-fast: false + matrix: + os: ["bionic-x64", + "bullseye-x64", + "buster-x64", + "focal-x64", + "jammy-x64", + "centos-7-x64", + "ol-8-x64", + "ol-9-x64"] + with: + package_testing_branch: ${{ inputs.package_testing_branch || 'master' }} + expected_version: ${{needs.get_versions.outputs.finish_version}} + repository: ${{ inputs.repository || 'release'}} + metrics_mode: ${{ inputs.metrics_mode || 'auto'}} + playbook: "pmm2-client_integration_upgrade_custom_path" + test_name: ${{ matrix.os }} + os: ${{ matrix.os }} \ No newline at end of file diff --git a/.github/workflows/pmm-package-test-single.yml b/.github/workflows/pmm-package-test-single.yml index 58bce12f4..a596b06b1 100644 --- a/.github/workflows/pmm-package-test-single.yml +++ b/.github/workflows/pmm-package-test-single.yml @@ -56,7 +56,6 @@ jobs: strategy: fail-fast: false matrix: - os: ["bionic-x64", "bullseye-x64", "buster-x64", diff --git a/Vagrantfile.template.pmm2-rpm b/Vagrantfile.template.pmm2-rpm index 06a7575cf..96de1a7de 100644 --- a/Vagrantfile.template.pmm2-rpm +++ b/Vagrantfile.template.pmm2-rpm @@ -32,7 +32,9 @@ Vagrant.configure(2) do |config| sudo yum install -y epel-release sudo yum -y update - sudo yum install -y ansible git wget + sudo yum install -y ansible-core git wget + ### for Centos 7 + # sudo yum install -y ansible git wget cd /pmm/package-testing # ansible-playbook -vv --connection=local --inventory 127.0.0.1, --limit 127.0.0.1 playbooks/pmm2-client.yml diff --git a/playbooks/pmm2-client_custom_path.yml b/playbooks/pmm2-client_custom_path.yml index 7b63edffe..3499e8ff8 100644 --- a/playbooks/pmm2-client_custom_path.yml +++ b/playbooks/pmm2-client_custom_path.yml @@ -71,16 +71,18 @@ delay: 5 retries: 5 + - name: Grep PMM Client tempdir path from config + shell: cat {{ custom_path }}/config/pmm-agent.yaml | awk '/tempdir/ {print $NF}' + register: tmp_path + become: yes + - name: PMM-8141 fix for deleted vmscrpconfig file, file being created with vmagent reload - command: "{{item}}" - with_items: - - "rm -r /tmp/vm_agent" - - "pkill -f vmagent" + command: "rm -r {{ tmp_path.stdout }}/vm_agent && pkill -f vmagent" become: yes - name: PMM-8141 verify new vmscrpconfig folder is created at tmp after killing vmagent process - command: "ls -la /tmp/vm_agent" + command: "ls -la {{ tmp_path.stdout }}/vm_agent" register: vm_agent_folder_ls become: yes until: vm_agent_folder_ls.stdout != "" diff --git a/playbooks/pmm2-client_integration_custom_path.yml b/playbooks/pmm2-client_integration_custom_path.yml index 8bf155cae..2f22757f0 100644 --- a/playbooks/pmm2-client_integration_custom_path.yml +++ b/playbooks/pmm2-client_integration_custom_path.yml @@ -15,6 +15,7 @@ pmm_version: "{{ lookup('env', 'PMM_VERSION') }}" pmm_repo: "{{ lookup('env', 'install_repo') }}" custom_path: "/pmm2-client-custom-path" + feature_build: "{{ lookup('env', 'feature_build') }}" tasks: - name: Register Instance IP @@ -25,12 +26,24 @@ set_fact: instance_ip: "{{ instance_ip.stdout }}" + - name: Set Integrations list + set_fact: + enabled_db: "{{ db_list|select|list }}" + vars: + db_list: + - "{{ (false) | ternary('ps-8.0','') }}" + - "{{ (ansible_os_family == 'RedHat' and ansible_distribution_major_version < '9') | ternary('ps-5.7','') }}" + - "{{ (ansible_os_family == 'Debian') | ternary('ps-5.7','') }}" + - psmdb-6.0 + - "{{ (ansible_os_family == 'Debian') | ternary('pg-13','') }}" + - "{{ (ansible_os_family == 'RedHat' and ansible_distribution_major_version < '8') | ternary('pg-13','') }}" + - name: include tasks for test env setup include_tasks: ../tasks/pmm2_client_test_prepare.yml ### install PMM Client from tarball - name: install pmm2-client tarball to custom path - command: "../scripts/pmm2_client_install_tarball.sh -v {{ pmm_version }} -p {{ custom_path }}" + command: "../scripts/pmm2_client_install_tarball.sh -v {{ (feature_build is defined) | ternary(feature_build, pmm_version) }} -p {{ custom_path }}" - name: check that PMM client version is correct include_tasks: ../tasks/verify_pmm_client_version.yml diff --git a/scripts/pmm2_client_custom_path.sh b/scripts/pmm2_client_custom_path.sh deleted file mode 100755 index d19d6ec67..000000000 --- a/scripts/pmm2_client_custom_path.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -while [ $# -gt 0 ]; do - - if [[ $1 == *"--"* ]]; then - param="${1/--/}" - declare $param="$2" - fi - - shift -done - -############################################################ -# Help # -############################################################ -Help() -{ - echo "Custom PMM 2 Client installation script." - echo - echo "Syntax: scriptTemplate [-h|l|p]" - echo "options:" - echo "h Print this Help." - echo "l listening custom port mode. Sets default version to 2.27.0" - echo "p Installation path. Default: /pmm2-client-custom-path" - echo -} - -if [ -z "$version" ]; then - export version=${PMM_VERSION:-2.27.0} -fi - -### Variables -custom_path=/pmm2-client-custom-path - -############################################################ -# Process the input options. # -############################################################ -while getopts ":hlp:" option; do - case $option in - h) # display Help - Help - exit 0 - ;; - l) # listening custom port starts from 2.27 - if [ -z "$version" ]; then - export version=${PMM_VERSION:-2.27.0} - fi - ;; - p) # Enter a custom path - path=$OPTARG - ;; - \?) # Invalid option - echo "Error: Invalid option" - exit 1 - ;; - esac -done - - -### Main program -wget https://downloads.percona.com/downloads/TESTING/pmm/pmm2-client-${version}.tar.gz -tar -xvf pmm2-client-${version}.tar.gz -pushd / -mkdir -p ${custom_path} -pushd ${custom_path} -export PMM_DIR=$(pwd) -popd -popd -mv pmm2-client-${version} pmm2-client -cd pmm2-client -./install_tarball