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

Nr 355273 ci optimization #197

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
925b89f
revert partial deployment changes
sanathramesh Jan 21, 2025
ec19240
Upgrade fluent bit version to 3.2.2 to windows packages only (#191)
gunnalahema Jan 21, 2025
b9f4801
revert partial deployment changes
sanathramesh Jan 21, 2025
eaf0841
revert partial deployment changes
sanathramesh Jan 21, 2025
2f9f40b
increase forks, run windows parallely
sanathramesh Jan 21, 2025
127e6a1
testing version change on all versions
sanathramesh Jan 21, 2025
70b3a85
tear down instances
sanathramesh Jan 22, 2025
d5e05c5
fb version upgrade
sanathramesh Jan 29, 2025
75335ec
Merge branch 'main' into NR-355273-CI-optimization
sanathramesh Jan 29, 2025
633cb3b
staging test enabled
sanathramesh Jan 29, 2025
d0d45d1
few more optimizations
sanathramesh Jan 29, 2025
9dbafba
fix async wait
sanathramesh Jan 29, 2025
8576fe4
validate a correct wait format
sanathramesh Jan 29, 2025
cd751c4
validate a correct wait format
sanathramesh Jan 30, 2025
4a69e1e
dont kill instances
sanathramesh Jan 30, 2025
bd33a91
dont kill instances
sanathramesh Jan 30, 2025
5a19348
remove parallel processing
sanathramesh Jan 30, 2025
f7d6503
parallel process windows and linux
sanathramesh Jan 30, 2025
3d8b0be
segregate spin up executors
sanathramesh Jan 30, 2025
96575ef
prerelease changes
sanathramesh Jan 30, 2025
ce16eee
update deprecated Github action
sanathramesh Jan 30, 2025
566edc3
update deprecated Github action
sanathramesh Jan 30, 2025
5bc329b
github v4 action upgrade
sanathramesh Jan 30, 2025
84bb262
github v4 action upgrade
sanathramesh Jan 30, 2025
8b32a31
github v4 action upgrade
sanathramesh Jan 30, 2025
c8d8dc0
inherit secrets
sanathramesh Jan 30, 2025
ffda0be
remove tear down
sanathramesh Jan 30, 2025
e70af4e
tear down instances always
sanathramesh Jan 30, 2025
ad275ea
pick correct hosts
sanathramesh Jan 30, 2025
f484747
pick the correct hosts
sanathramesh Jan 30, 2025
cdeb4c0
pick the correct hosts
sanathramesh Jan 30, 2025
58d9873
parallelize sles
sanathramesh Jan 30, 2025
6ddcb0c
fix
sanathramesh Jan 30, 2025
dc9bbb2
fix
sanathramesh Jan 30, 2025
672a37d
fix
sanathramesh Jan 31, 2025
fe60b65
pass GPG creds
sanathramesh Jan 31, 2025
9c4e568
reducing forks to avoid throttling
sanathramesh Jan 31, 2025
78cec8e
tear down always
sanathramesh Jan 31, 2025
3f48d2f
enable staging tests
sanathramesh Jan 31, 2025
9ff9c95
enable staging publishing
sanathramesh Jan 31, 2025
cf76b92
enable staging publishing
sanathramesh Jan 31, 2025
37a56d9
remove env
sanathramesh Jan 31, 2025
f21b086
clean up
sanathramesh Feb 3, 2025
e6a879d
clean up
sanathramesh Feb 3, 2025
678d642
clean up
sanathramesh Feb 3, 2025
28c3cf5
switch amis to core base images, increase async call start wait time
sanathramesh Feb 3, 2025
0d53c04
windows waits for connection
sanathramesh Feb 3, 2025
457911b
reset ami, clean up playbooks, upgrade chocolatey
sanathramesh Feb 3, 2025
ac51e0e
reduce forks to accommodate throttling
sanathramesh Feb 3, 2025
a90c92b
increase ssm retries
sanathramesh Feb 3, 2025
72181a9
forks and retires
sanathramesh Feb 3, 2025
e9514cd
degrade fb version
sanathramesh Feb 4, 2025
962ee95
remove dependency on setup env
sanathramesh Feb 4, 2025
c7341a0
temporary changes
sanathramesh Feb 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 28 additions & 71 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ env:
GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded

jobs:
# Empties the GH pre-relase
# Empties the GH pre-release
# Generates strategy matrices that can be used by other jobs to run the build or testing of all supported packages
setup_environment:
runs-on: ubuntu-latest
outputs:
pre_release_name: ${{ steps.set_vars.outputs.pre_release_name }}
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 }}
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -58,11 +59,16 @@ jobs:
with:
python-version: '3.10'

# Creation of linux_and_windows_unique_target_package is necessary due to the upgrade of actions/upload-artifact from v3 to v4.
# The v4 action throws an error when package names are duplicated, which is the case for Windows packages.
- name: Compute and upload matrices
id: set-matrices
run: |
make versions/generateMatrices
echo "linux_and_windows_matrix=$( cat versions/linuxAndWindowsMatrix.json )" >> "$GITHUB_OUTPUT"
json_data=$(cat versions/linuxAndWindowsMatrix.json)
filtered_json=$(echo "$json_data" | jq 'unique_by(.targetPackageName)')
echo "linux_and_windows_unique_target_package=$(echo $filtered_json)" >> "$GITHUB_OUTPUT"
echo "sles_matrix=$( cat versions/slesMatrix.json )" >> "$GITHUB_OUTPUT"
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
Expand All @@ -79,11 +85,11 @@ jobs:
download_official_packages:
needs: [setup_environment]
runs-on: ubuntu-latest
if: ${{ needs.setup_environment.outputs.linux_and_windows_matrix != '[]' }}
if: ${{ needs.setup_environment.outputs.linux_and_windows_unique_target_package != '[]' }}
strategy:
fail-fast: true
matrix:
include: ${{ fromJson(needs.setup_environment.outputs.linux_and_windows_matrix) }}
include: ${{ fromJson(needs.setup_environment.outputs.linux_and_windows_unique_target_package) }}
name: ${{ matrix.osDistro }}-${{ matrix.osVersion }}-${{ matrix.arch }}
steps:
- name: Check out repository
Expand Down Expand Up @@ -119,20 +125,21 @@ jobs:
# for those distros using the same package, such as Windows). To avoid this, we first push all the files to a
# shared filesystem and let the "prepare_prerelease" step below upload them later, sequentially. This GH action
# ensures that if two jobs attempt pushing the same file, they get overwritten (last one prevails).
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
# Artifacts are pushed to *shared network folders* that have this name and that contain
# the artifact inside of them. Example: fluent-bit-2.1.8-386.exe/fluent-bit-2.1.8-386.exe
name: ${{ matrix.targetPackageName }}
path: packages/${{ matrix.targetPackageName }}
overwrite: true

upload_official_packages_to_prerelease:
needs: [ download_official_packages ]
runs-on: ubuntu-latest

steps:
- name: Download all artifacts from shared filesystem
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: packages

Expand All @@ -141,66 +148,16 @@ jobs:
# To understand the need for /*/*, see comment in "upload artifacts" step above
gh release upload ${{ env.PRE_RELEASE_NAME }} packages/*/* --repo newrelic/fluent-bit-package

spin_up_suse:
needs: setup_environment
if: ${{ needs.setup_environment.outputs.sles_matrix != '[]' }}
uses: ./.github/workflows/run_task.yml
with:
container_make_target: "terraform/ec2-suse-builders/provision PRE_RELEASE_NAME=${{ needs.setup_environment.outputs.pre_release_name }}"
secrets: inherit

build_suse_packages:
needs: [setup_environment,spin_up_suse]
uses: ./.github/workflows/run_task.yml
with:
container_make_target: "ansible/build-fb-suse/run PRE_RELEASE_NAME=${{ needs.setup_environment.outputs.pre_release_name }}"
secrets: inherit

tear_down_suse:
needs: [setup_environment,build_suse_packages]
uses: ./.github/workflows/run_task.yml
with:
container_make_target: "terraform/ec2-suse-builders/clean PRE_RELEASE_NAME=${{ needs.setup_environment.outputs.pre_release_name }}"
secrets: inherit

sign_suse_packages:
needs: [setup_environment, build_suse_packages]
runs-on: ubuntu-latest
if: ${{ needs.setup_environment.outputs.sles_matrix != '[]' }}
strategy:
fail-fast: true
matrix:
include: ${{ fromJson(needs.setup_environment.outputs.sles_matrix) }}
name: ${{ matrix.osDistro }}-${{ matrix.osVersion }}-${{ matrix.arch }}

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Fetch package from GitHub pre-release
run: |
mkdir -p packages
gh release download ${{ env.PRE_RELEASE_NAME }} --pattern ${{ matrix.targetPackageName }} --dir packages

- name: Sign package
run: |
sudo apt-get install -y debsigs
bash ./scripts/sign.sh

- name: Upload signed asset
run:
gh release upload ${{ env.PRE_RELEASE_NAME }} packages/* --clobber

# Runs E2E tests using the packages available in the tmp-pr-#PR prerelease
run_e2e_tests_prerelease:
needs: [ setup_environment,upload_official_packages_to_prerelease ]
name: Run E2E tests by installing NRIA from Production and installing Fluent Bit from the PR pre-release
uses: ./.github/workflows/run_e2e_tests.yml
# name: Run E2E tests by installing NRIA from Production and installing Fluent Bit from the PR pre-release
uses: ./.github/workflows/run_prerelease.yml
with:
gh_release_name: ${{ needs.setup_environment.outputs.pre_release_name }}
infra_agent_version: latest
infra_agent_env: prerelease
test_report_filename: test-report-prerelease.xml
sles_matrix: ${{ needs.setup_environment.outputs.sles_matrix }}
pre_release_name: ${{ needs.setup_environment.outputs.pre_release_name }}
secrets: inherit

publish_linux_to_staging:
Expand Down Expand Up @@ -229,15 +186,15 @@ jobs:
gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }}
gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded

# run_e2e_tests_staging:
# needs: [ setup_environment, run_e2e_tests_prerelease, publish_linux_to_staging ]
# if: |
# always() && !failure() && !cancelled()
# name: Run E2E tests for all supported packages installing NRIA+FB from staging
# uses: ./.github/workflows/run_e2e_tests.yml
# with:
# gh_release_name: ${{ needs.setup_environment.outputs.pre_release_name }}
# infra_agent_version: latest
# infra_agent_env: staging
# test_report_filename: test-report-staging.xml
# secrets: inherit
# run_e2e_tests_staging:
# needs: [ setup_environment, run_e2e_tests_prerelease, publish_linux_to_staging ]
# if: |
# always() && !failure() && !cancelled()
# name: Run E2E tests for all supported packages installing NRIA+FB from staging
# uses: ./.github/workflows/run_e2e_tests.yml
# with:
# gh_release_name: ${{ needs.setup_environment.outputs.pre_release_name }}
# infra_agent_version: latest
# infra_agent_env: staging
# test_report_filename: test-report-staging.xml
# secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/run_e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:

tear_down_test_executor_instances:
name: Tear down test executor instances
# if: always()
if: always()
needs: report_test_results
uses: ./.github/workflows/run_task.yml
with:
Expand Down
Loading
Loading