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

test: add benchmarking for test, scan, cleanup, and convert to sig steps #5015

Merged
merged 85 commits into from
Oct 10, 2024

Conversation

zachary-bailey
Copy link
Collaborator

@zachary-bailey zachary-bailey commented Oct 1, 2024

What type of PR is this?

/kind test

What this PR does / why we need it:

This PR adds benchmarking to additional scripts in preparation for merging the regression detection program.

Which issue(s) this PR fixes:

Unsatisfactory VHD Build pipeline duration.

Requirements:

Notes

Another CSE file was created in order to prevent having to source cse_helpers.sh into the test/scan/cleanup steps as it would cause them to fail.

@coveralls
Copy link

coveralls commented Oct 1, 2024

Pull Request Test Coverage Report for Build 11279754971

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 71.271%

Totals Coverage Status
Change from base Build 11279278712: 0.0%
Covered Lines: 2590
Relevant Lines: 3634

💛 - Coveralls

declare -a benchmarks_order=()
VHD_BUILD_PERF_DATA=${BUILD_PERF_DATA_FILE}

check_array_size() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already define these here: https://github.com/Azure/AgentBaker/blob/master/parts/linux/cloud-init/artifacts/cse_helpers.sh#L500-L548

could we upload this file to the packer VM and source them within install-deps as well? that way we won't have to worry about updating code in multiple places

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean remove these functions from cse_helpers.sh and source them to the install scripts from this file only? I like that idea and was initially going in that direction.

The only reason I ended up not wanting to remove them from cse_helpers.sh was because I thought they could be useful for node bootstrapping benchmarking. But looking around yesterday, it seems we already have some infrastructure for logging during the bootstrapping process.

Unfortunately, sourcing cse_helpers.sh to these files (convert, test, scan, etc) fails the step because of the variable assignments, so its a bit of a dilemma. How would you like me to proceed? @cameronmeissner

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we decouple the variable assignment and the helper functions into two files ? this way one can source the helper functions only ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree though this is some pretty bad code duplication :(

Copy link
Collaborator Author

@zachary-bailey zachary-bailey Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to just source the functions into cse_helpers from this new file...? That way they are available to scripts that run after the packer vm is deprovisioned, still available in cse_helpers for node bootstrap benchmarking later on, and not duplicated.

@djsly @cameronmeissner

vhdbuilder/packer/cleanup.sh Outdated Show resolved Hide resolved
vhdbuilder/packer/cleanup.sh Show resolved Hide resolved
@@ -482,71 +482,6 @@ isMarinerOrAzureLinux() {
return 1
}

installJq() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt this used anywhere else ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for future: installJq function used to be here but was moved to cse_helpers.sh, evalPackageDownloadURL moved up after removal

@djsly djsly merged commit 1756c35 into master Oct 10, 2024
24 of 26 checks passed
@djsly djsly deleted the zb/benchmarkTestAndScan branch October 10, 2024 19:58
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