diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 213fc134e..aff4ff165 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -21,6 +21,8 @@ jobs: runs-on: ubuntu-latest outputs: pre_release_name: ${{ steps.set_vars.outputs.pre_release_name }} + nr_fb_output_plugin_version: ${{ steps.set_vars.outputs.nr_fb_output_plugin_version }} + nr_fb_output_plugin_tag: ${{ steps.set_vars.outputs.nr_fb_output_plugin_tag }} sles_matrix: ${{ steps.set-matrices.outputs.sles_matrix }} linux_and_windows_matrix: ${{ steps.set-matrices.outputs.linux_and_windows_matrix }} linux_and_windows_unique_target_package : ${{ steps.set-matrices.outputs.linux_and_windows_unique_target_package }} @@ -29,13 +31,6 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - # This is a workaround required to pass environment variables to the run_e2e_tests workflow - # See: https://stackoverflow.com/a/73305536 and https://github.com/orgs/community/discussions/26671#discussioncomment-3252793 - - name: Make dynamically-generated env variables available to be passed down to reusable workflows - id: set_vars - run: | - echo "pre_release_name=$PRE_RELEASE_NAME" >> $GITHUB_OUTPUT - - name: (Re)create pre-release run: | pre_release_exists=$(gh release view $PRE_RELEASE_NAME &>/dev/null && echo "true" || echo "false") @@ -75,6 +70,16 @@ jobs: gh release upload ${{ env.PRE_RELEASE_NAME }} versions/linuxAndWindowsMatrix.json --repo newrelic/fluent-bit-package gh release upload ${{ env.PRE_RELEASE_NAME }} versions/slesMatrix.json --repo newrelic/fluent-bit-package + # Extract plugin version and tag from the generated matrix (they're defined in common.yml and merged into all entries) + - name: Extract plugin configuration from matrix + id: set_vars + run: | + echo "pre_release_name=$PRE_RELEASE_NAME" >> $GITHUB_OUTPUT + nr_fb_output_plugin_version=$(cat versions/linuxAndWindowsMatrix.json | jq -r '.[0].nrFbOutputPluginVersion') + nr_fb_output_plugin_tag=$(cat versions/linuxAndWindowsMatrix.json | jq -r '.[0].nrFbOutputPluginTag') + echo "nr_fb_output_plugin_version=${nr_fb_output_plugin_version}" >> $GITHUB_OUTPUT + echo "nr_fb_output_plugin_tag=${nr_fb_output_plugin_tag}" >> $GITHUB_OUTPUT + - name: Compute and upload schemas run: | make schemas/generateSchemas; @@ -168,6 +173,8 @@ jobs: sles_matrix: ${{ needs.setup_environment.outputs.sles_matrix }} pre_release_name: ${{ needs.setup_environment.outputs.pre_release_name }} windows_matrix: ${{ needs.setup_environment.outputs.windows_matrix }} + nr_fb_output_plugin_version: ${{ needs.setup_environment.outputs.nr_fb_output_plugin_version }} + nr_fb_output_plugin_tag: ${{ needs.setup_environment.outputs.nr_fb_output_plugin_tag }} secrets: inherit publish_linux_to_staging: diff --git a/.github/workflows/run_prerelease.yml b/.github/workflows/run_prerelease.yml index dd474b8d0..55522d625 100644 --- a/.github/workflows/run_prerelease.yml +++ b/.github/workflows/run_prerelease.yml @@ -41,6 +41,14 @@ on: required: false default: test-report-windows-prerelease.xml type: string + nr_fb_output_plugin_version: + description: Version/tag of the newrelic-fluent-bit-output plugin to test. Must be provided from versions/common.yml (nrFbOutputPluginVersion) + required: true + type: string + nr_fb_output_plugin_tag: + description: GitHub release tag for the newrelic-fluent-bit-output plugin. Must be provided from versions/common.yml (nrFbOutputPluginTag) + required: true + type: string workflow_dispatch: inputs: gh_release_name: @@ -80,6 +88,14 @@ on: required: false default: test-report-windows-prerelease.xml type: string + nr_fb_output_plugin_version: + description: Version/tag of the newrelic-fluent-bit-output plugin to test. Must be provided from versions/common.yml (nrFbOutputPluginVersion) + required: true + type: string + nr_fb_output_plugin_tag: + description: GitHub release tag for the newrelic-fluent-bit-output plugin. Must be provided from versions/common.yml (nrFbOutputPluginTag) + required: true + type: string # So that only one test suite will be run simultaneously against a given GH release. This ensures that there will not # be multiple runners accessing the same Terraform state at the same time. Note that we need to set this lock here as well @@ -162,17 +178,17 @@ jobs: && (needs.tear_down_suse.result == 'success' || needs.tear_down_suse.result == 'skipped')}} uses: ./.github/workflows/run_task.yml with: - container_make_target: "ansible/provision-and-execute-tests/${{ inputs.infra_agent_env }}-linux PRE_RELEASE_NAME=${{ inputs.gh_release_name }} TEST_REPORT_NAME=${{ inputs.linux_test_report_name }}" + container_make_target: "ansible/provision-and-execute-tests/${{ inputs.infra_agent_env }}-linux PRE_RELEASE_NAME=${{ inputs.gh_release_name }} TEST_REPORT_NAME=${{ inputs.linux_test_report_name }} NR_FB_OUTPUT_PLUGIN_VERSION=${{ inputs.nr_fb_output_plugin_version }} NR_FB_OUTPUT_PLUGIN_TAG=${{ inputs.nr_fb_output_plugin_tag }}" secrets: inherit -# provision_and_execute_tests_windows: -# name: Provision instances and run tests for windows -# needs: spin_up_test_executor_instances -# if: ${{ (needs.spin_up_test_executor_instances.result == 'success' || needs.spin_up_test_executor_instances.result == 'skipped') && ( inputs.windows_matrix != '[]' ) }} -# uses: ./.github/workflows/run_task.yml -# with: -# container_make_target: "ansible/provision-and-execute-tests/${{ inputs.infra_agent_env }}-windows PRE_RELEASE_NAME=${{ inputs.gh_release_name }} TEST_REPORT_NAME=${{ inputs.windows_test_report_name }}" -# secrets: inherit + provision_and_execute_tests_windows: + name: Provision instances and run tests for windows + needs: spin_up_test_executor_instances + if: ${{ (needs.spin_up_test_executor_instances.result == 'success' || needs.spin_up_test_executor_instances.result == 'skipped') && ( inputs.windows_matrix != '[]' ) }} + uses: ./.github/workflows/run_task.yml + with: + container_make_target: "ansible/provision-and-execute-tests/${{ inputs.infra_agent_env }}-windows PRE_RELEASE_NAME=${{ inputs.gh_release_name }} TEST_REPORT_NAME=${{ inputs.windows_test_report_name }} NR_FB_OUTPUT_PLUGIN_VERSION=${{ inputs.nr_fb_output_plugin_version }} NR_FB_OUTPUT_PLUGIN_TAG=${{ inputs.nr_fb_output_plugin_tag }}" + secrets: inherit report_linux_test_results: name: Report results linux diff --git a/ansible/provision-and-execute-tests/Makefile b/ansible/provision-and-execute-tests/Makefile index b71f8981b..672ef1cab 100644 --- a/ansible/provision-and-execute-tests/Makefile +++ b/ansible/provision-and-execute-tests/Makefile @@ -2,22 +2,22 @@ include ../Ansible.common.mk .PHONY: prerelease prerelease: dependencies prepare-inventory - ansible-playbook $(ANSIBLE_FOLDER)/playbook-provision-prerelease.yml -i $(ANSIBLE_INVENTORY) + ansible-playbook $(ANSIBLE_FOLDER)/playbook-provision-prerelease.yml -i $(ANSIBLE_INVENTORY) $(if $(NR_FB_OUTPUT_PLUGIN_VERSION),-e nr_fb_output_plugin_version=$(NR_FB_OUTPUT_PLUGIN_VERSION)) $(if $(NR_FB_OUTPUT_PLUGIN_TAG),-e plugin_tag=$(NR_FB_OUTPUT_PLUGIN_TAG)) ansible-playbook $(ANSIBLE_FOLDER)/playbook-run-tests.yml -i $(ANSIBLE_INVENTORY) - ansible-playbook $(ANSIBLE_FOLDER)/playbook-windows.yml -i $(ANSIBLE_INVENTORY) + ansible-playbook $(ANSIBLE_FOLDER)/playbook-windows.yml -i $(ANSIBLE_INVENTORY) $(if $(NR_FB_OUTPUT_PLUGIN_VERSION),-e nr_fb_output_plugin_version=$(NR_FB_OUTPUT_PLUGIN_VERSION)) $(if $(NR_FB_OUTPUT_PLUGIN_TAG),-e plugin_tag=$(NR_FB_OUTPUT_PLUGIN_TAG)) ansible-playbook $(ANSIBLE_FOLDER)/playbook-merge-results.yml -i $(ANSIBLE_INVENTORY) .PHONY: prerelease-linux prerelease-linux: dependencies prepare-inventory - ansible-playbook $(ANSIBLE_FOLDER)/playbook-provision-prerelease.yml -i $(ANSIBLE_INVENTORY) + ansible-playbook $(ANSIBLE_FOLDER)/playbook-provision-prerelease.yml -i $(ANSIBLE_INVENTORY) $(if $(NR_FB_OUTPUT_PLUGIN_VERSION),-e nr_fb_output_plugin_version=$(NR_FB_OUTPUT_PLUGIN_VERSION)) $(if $(NR_FB_OUTPUT_PLUGIN_TAG),-e plugin_tag=$(NR_FB_OUTPUT_PLUGIN_TAG)) ansible-playbook $(ANSIBLE_FOLDER)/playbook-run-tests.yml -i $(ANSIBLE_INVENTORY) ansible-playbook $(ANSIBLE_FOLDER)/playbook-merge-results.yml -i $(ANSIBLE_INVENTORY) .PHONY: prerelease-windows prerelease-windows: dependencies prepare-inventory - ansible-playbook $(ANSIBLE_FOLDER)/playbook-windows.yml -i $(ANSIBLE_INVENTORY) + ansible-playbook $(ANSIBLE_FOLDER)/playbook-windows.yml -i $(ANSIBLE_INVENTORY) $(if $(NR_FB_OUTPUT_PLUGIN_VERSION),-e nr_fb_output_plugin_version=$(NR_FB_OUTPUT_PLUGIN_VERSION)) $(if $(NR_FB_OUTPUT_PLUGIN_TAG),-e plugin_tag=$(NR_FB_OUTPUT_PLUGIN_TAG)) ansible-playbook $(ANSIBLE_FOLDER)/playbook-merge-results.yml -i $(ANSIBLE_INVENTORY) .PHONY: staging diff --git a/ansible/provision-and-execute-tests/playbook-provision-prerelease.yml b/ansible/provision-and-execute-tests/playbook-provision-prerelease.yml index ea12bddf7..3d658cfe5 100644 --- a/ansible/provision-and-execute-tests/playbook-provision-prerelease.yml +++ b/ansible/provision-and-execute-tests/playbook-provision-prerelease.yml @@ -47,7 +47,8 @@ os_distro: "{{ tags.os_distro }}" os_version: "{{ tags.os_version }}" arch: "{{ tags.arch }}" - nr_fb_output_plugin_version: 1.19.2 + # Value set in versions/common.yml (nrFbOutputPluginVersion) and can be overridden via extra vars (-e nr_fb_output_plugin_version=) + nr_fb_output_plugin_version: "{{ nr_fb_output_plugin_version }}" # The following vars are injected in the fargate task env new_relic_api_key: "{{ lookup('ansible.builtin.env', 'NEW_RELIC_API_KEY') }}" new_relic_account_id: "{{ lookup('ansible.builtin.env', 'NEW_RELIC_ACCOUNT_ID') }}" diff --git a/ansible/provision-and-execute-tests/playbook-windows.yml b/ansible/provision-and-execute-tests/playbook-windows.yml index fbcb9f3de..c4c824d8d 100644 --- a/ansible/provision-and-execute-tests/playbook-windows.yml +++ b/ansible/provision-and-execute-tests/playbook-windows.yml @@ -55,7 +55,8 @@ node_path: 'C:\Program Files\nodejs\' - nr_fb_output_plugin_version: '1.19.2' + # Value set in versions/common.yml (nrFbOutputPluginVersion) and can be overridden via extra vars (-e nr_fb_output_plugin_version=) + nr_fb_output_plugin_version: "{{ nr_fb_output_plugin_version }}" environment: NEW_RELIC_API_KEY: "{{ new_relic_api_key }}" NEW_RELIC_ACCOUNT_ID: "{{ new_relic_account_id }}" diff --git a/ansible/provision-and-execute-tests/roles/install_nr_fluent_bit_output/vars/linux.yml b/ansible/provision-and-execute-tests/roles/install_nr_fluent_bit_output/vars/linux.yml index e84bd1202..4a605dfe4 100644 --- a/ansible/provision-and-execute-tests/roles/install_nr_fluent_bit_output/vars/linux.yml +++ b/ansible/provision-and-execute-tests/roles/install_nr_fluent_bit_output/vars/linux.yml @@ -1,5 +1,9 @@ infra_agent_config_file_absolute_path: /etc/newrelic-infra.yml nr_fb_output_file_extension: 'so' nr_fb_output_plugin_artifact: 'out_newrelic-linux-{{ plugin_arch }}-{{ plugin_version }}.{{ nr_fb_output_file_extension }}' -nr_fb_output_plugin_url: "https://github.com/newrelic/newrelic-fluent-bit-output/releases/download/v{{ plugin_version }}/{{ nr_fb_output_plugin_artifact }}" -nr_fb_output_plugin_download_file_path: "/tmp/out_newrelic.{{ nr_fb_output_file_extension }}'" \ No newline at end of file +# For standard releases, plugin_version is like "1.19.2" and tag is "v1.19.2" +# For custom/beta releases, plugin_version includes the full artifact name like "newrelic-fluent-bit-output-3.3.1-beta-rhel8-test" +# and the tag should be set via plugin_tag variable (defaults to "v{{ plugin_version }}" for backwards compatibility) +nr_fb_output_plugin_tag: "{{ plugin_tag | default('v' + plugin_version) }}" +nr_fb_output_plugin_url: "https://github.com/newrelic/newrelic-fluent-bit-output/releases/download/{{ nr_fb_output_plugin_tag }}/{{ nr_fb_output_plugin_artifact }}" +nr_fb_output_plugin_download_file_path: "/tmp/out_newrelic.{{ nr_fb_output_file_extension }}" \ No newline at end of file diff --git a/ansible/provision-and-execute-tests/roles/install_nr_fluent_bit_output/vars/windows.yml b/ansible/provision-and-execute-tests/roles/install_nr_fluent_bit_output/vars/windows.yml index a41d2ef0e..b417174fc 100644 --- a/ansible/provision-and-execute-tests/roles/install_nr_fluent_bit_output/vars/windows.yml +++ b/ansible/provision-and-execute-tests/roles/install_nr_fluent_bit_output/vars/windows.yml @@ -1,5 +1,9 @@ infra_agent_config_file_absolute_path: C:\Program Files\New Relic\newrelic-infra\newrelic-infra.yml nr_fb_output_file_extension: 'dll' nr_fb_output_plugin_artifact: 'out_newrelic-windows-{{ plugin_arch }}-{{ plugin_version }}.{{ nr_fb_output_file_extension }}' -nr_fb_output_plugin_url: "https://github.com/newrelic/newrelic-fluent-bit-output/releases/download/v{{ plugin_version }}/{{ nr_fb_output_plugin_artifact }}" +# For standard releases, plugin_version is like "1.19.2" and tag is "v1.19.2" +# For custom/beta releases, plugin_version includes the full artifact name like "newrelic-fluent-bit-output-3.3.1-beta-rhel8-test" +# and the tag should be set via plugin_tag variable (defaults to "v{{ plugin_version }}" for backwards compatibility) +nr_fb_output_plugin_tag: "{{ plugin_tag | default('v' + plugin_version) }}" +nr_fb_output_plugin_url: "https://github.com/newrelic/newrelic-fluent-bit-output/releases/download/{{ nr_fb_output_plugin_tag }}/{{ nr_fb_output_plugin_artifact }}" nr_fb_output_plugin_download_file_path: 'C:\Windows\Temp\out_newrelic.{{ nr_fb_output_file_extension }}' \ No newline at end of file diff --git a/versions/amazonlinux_2.ymlx b/versions/amazonlinux_2.yml similarity index 100% rename from versions/amazonlinux_2.ymlx rename to versions/amazonlinux_2.yml diff --git a/versions/amazonlinux_2023.ymlx b/versions/amazonlinux_2023.yml similarity index 100% rename from versions/amazonlinux_2023.ymlx rename to versions/amazonlinux_2023.yml diff --git a/versions/centos_7.ymlx b/versions/centos_7.yml similarity index 100% rename from versions/centos_7.ymlx rename to versions/centos_7.yml diff --git a/versions/centos_8.ymlx b/versions/centos_8.yml similarity index 100% rename from versions/centos_8.ymlx rename to versions/centos_8.yml diff --git a/versions/centos_9.ymlx b/versions/centos_9.yml similarity index 100% rename from versions/centos_9.ymlx rename to versions/centos_9.yml diff --git a/versions/common.yml b/versions/common.yml index e0abbdf93..15ed85b4e 100644 --- a/versions/common.yml +++ b/versions/common.yml @@ -1,4 +1,9 @@ -fbVersion: 4.2.0 +fbVersion: 4.2.2 + +# New Relic Fluent Bit Output Plugin Configuration +# These values are used during E2E testing to download and test a specific version of the NR output plugin +nrFbOutputPluginVersion: 3.3.1-beta-rhel8-test +nrFbOutputPluginTag: v3.3.1-beta-rhel8-test # This file, together with each distro file are processed and merged incrementally to # build all the information required to download and test each package. Each package ends diff --git a/versions/debian_11_bullseye.ymlx b/versions/debian_11_bullseye.yml similarity index 100% rename from versions/debian_11_bullseye.ymlx rename to versions/debian_11_bullseye.yml diff --git a/versions/sles_15.3.ymlx b/versions/sles_15.3.yml similarity index 100% rename from versions/sles_15.3.ymlx rename to versions/sles_15.3.yml diff --git a/versions/sles_15.4.ymlx b/versions/sles_15.4.yml similarity index 65% rename from versions/sles_15.4.ymlx rename to versions/sles_15.4.yml index c582771f1..f0eac45e6 100644 --- a/versions/sles_15.4.ymlx +++ b/versions/sles_15.4.yml @@ -2,4 +2,4 @@ osDistro: sles osVersion: 15.4 packages: - arch: x86_64 - ami: ami-054bba390120adf1d \ No newline at end of file + ami: ami-0c00d482c766145ab \ No newline at end of file diff --git a/versions/sles_15.5.ymlx b/versions/sles_15.5.yml similarity index 65% rename from versions/sles_15.5.ymlx rename to versions/sles_15.5.yml index 6e419a9a7..588fc73b5 100644 --- a/versions/sles_15.5.ymlx +++ b/versions/sles_15.5.yml @@ -2,4 +2,4 @@ osDistro: sles osVersion: 15.5 packages: - arch: x86_64 - ami: ami-0b7de87a082366f50 \ No newline at end of file + ami: ami-0ee05215c07f1b8cd \ No newline at end of file diff --git a/versions/sles_15.6.yml b/versions/sles_15.6.yml new file mode 100644 index 000000000..c0876bbb5 --- /dev/null +++ b/versions/sles_15.6.yml @@ -0,0 +1,5 @@ +osDistro: sles +osVersion: 15.6 +packages: + - arch: x86_64 + ami: ami-06efc45c7e3e16e77 diff --git a/versions/sles_15.7.yml b/versions/sles_15.7.yml new file mode 100644 index 000000000..37a3e3e80 --- /dev/null +++ b/versions/sles_15.7.yml @@ -0,0 +1,5 @@ +osDistro: sles +osVersion: 15.7 +packages: + - arch: x86_64 + ami: ami-0f409b75e8c70d0e4 diff --git a/versions/strategyMatrix.py b/versions/strategyMatrix.py index 9a3a485ed..80eba03fe 100644 --- a/versions/strategyMatrix.py +++ b/versions/strategyMatrix.py @@ -186,7 +186,7 @@ def list_distro_files(): return [ filename for filename in os.listdir(".") - if ((filename.endswith(".yml") or filename.endswith(".yaml")) and not filename.startswith("windows")) + if (filename.endswith(".yml") or filename.endswith(".yaml")) and filename != "common.yml" ] except Exception as e: diff --git a/versions/ubuntu_22_jammy.ymlx b/versions/ubuntu_22_jammy.yml similarity index 100% rename from versions/ubuntu_22_jammy.ymlx rename to versions/ubuntu_22_jammy.yml diff --git a/versions/ubuntu_24_noble.ymlx b/versions/ubuntu_24_noble.yml similarity index 100% rename from versions/ubuntu_24_noble.ymlx rename to versions/ubuntu_24_noble.yml