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

perf: run installBcc in a subshell #4290

Merged
merged 10 commits into from
Apr 29, 2024

Conversation

zachary-bailey
Copy link
Collaborator

@zachary-bailey zachary-bailey commented Apr 13, 2024

What type of PR is this?

/kind performance

What this PR does / why we need it:

This PR modifies the way bcc tools are installed on ab VHDs. The installBcc function is ran in a subshell so that the main script can continue to execute while bcc packages are downloaded / compiled / installed in the background.

This PR results in about 3 minutes of saved time building the VHDs.

Which issue(s) this PR fixes:

Unsatisfactory VHD Build times.

Requirements:

@coveralls
Copy link

coveralls commented Apr 13, 2024

Pull Request Test Coverage Report for Build 8885833909

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 79.022%

Totals Coverage Status
Change from base Build 8883705751: 0.0%
Covered Lines: 2554
Relevant Lines: 3232

💛 - Coveralls

@ganeshkumarashok
Copy link
Contributor

What do you think about adding the tests for successful installation to this PR?

@zachary-bailey
Copy link
Collaborator Author

What do you think about adding the tests for successful installation to this PR?

@ganeshkumarashok Can do!

@ganeshkumarashok
Copy link
Contributor

ganeshkumarashok commented Apr 18, 2024

Could you note the approx time saved by parallelization, in the PR description as well?

@zachary-bailey
Copy link
Collaborator Author

zachary-bailey commented Apr 18, 2024

Could you note the approx time saved by parallelization, in the PR description as well?

Do you mean time saved by running it in the subshell? or marking time for both, in the other PR as well? @ganeshkumarashok

- bcc-tools
- libbcc-examples
EOF
PARENT_DIR=$(pwd)
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be the present directory right? Not parent directory?

- libbcc-examples
EOF
PARENT_DIR=$(pwd)

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: add a comment about creating a subshell to install in the background? This is not a common pattern in Agentbaker so it'll be good to note for the future

installBcc

exit $?
) > /tmp/bcc.log 2>&1 &
Copy link
Contributor

Choose a reason for hiding this comment

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

/tmp directory may get deleted on reboots. Can you save it in /var/log/bcc_installation.log instead? Those logs will remain

echo "$line is missing"
result=1
fi
done
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be simplified - just return 1 inside the then condition if line is missing

result=1
fi
done
if [ $result -eq 0 ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

This section can be removed and simplified

@zachary-bailey zachary-bailey merged commit 21b374d into master Apr 29, 2024
18 checks passed
@zachary-bailey zachary-bailey deleted the zacharybailey/installBccSubshell branch April 29, 2024 23:04
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.

3 participants