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

Use GZIP 6 RPM Compression To Fix Install On AL2 Without Kernel Patch #889

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

sethAmazon
Copy link
Contributor

@sethAmazon sethAmazon commented Oct 4, 2023

Description of the issue

Can't install rpm on the kernel patchless version of al2

Description of changes

Use Gzip 6 RPM Compression for rpm build spec
Current binary size 76mb new binary size 96mb
Current install time 11 seconds new install time 5 seconds

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

Manually build on al2 with kernel patch.
Install on al2 without kernel patch.

Requirements

Before commit the code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

@sethAmazon sethAmazon requested a review from a team as a code owner October 4, 2023 14:20
@sethAmazon sethAmazon marked this pull request as draft October 4, 2023 14:20
@sethAmazon sethAmazon changed the title Remove RPM Compression To Fix Install On AL2 Without Kernel Patch Use Gzip 0 RPM Compression To Fix Install On AL2 Without Kernel Patch Oct 4, 2023
@sethAmazon sethAmazon marked this pull request as ready for review October 4, 2023 14:57
@okankoAMZ
Copy link
Contributor

What happens if the OS doesn't have Gzip0 ?

@okankoAMZ
Copy link
Contributor

nit: Do you know the installation times for al2? Can you check with time command

@sethAmazon
Copy link
Contributor Author

It installed almost instantly

@sethAmazon
Copy link
Contributor Author

sh-4.2$ time sudo yum install -y gzip-no-compress-amazon-cloudwatch-agent.rpm
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Examining gzip-no-compress-amazon-cloudwatch-agent.rpm: amazon-cloudwatch-agent-1.300028.2+4+g327c833+dirty-1.x86_64
Marking gzip-no-compress-amazon-cloudwatch-agent.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package amazon-cloudwatch-agent.x86_64 0:1.300028.2+4+g327c833+dirty-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================================================
 Package                                      Arch                        Version                                              Repository                                                      Size
====================================================================================================================================================================================================
Installing:
 amazon-cloudwatch-agent                      x86_64                      1.300028.2+4+g327c833+dirty-1                        /gzip-no-compress-amazon-cloudwatch-agent                      339 M

Transaction Summary
====================================================================================================================================================================================================
Install  1 Package

Total size: 339 M
Installed size: 339 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : amazon-cloudwatch-agent-1.300028.2+4+g327c833+dirty-1.x86_64                                                                                                                     1/1
  Verifying  : amazon-cloudwatch-agent-1.300028.2+4+g327c833+dirty-1.x86_64                                                                                                                     1/1

Installed:
  amazon-cloudwatch-agent.x86_64 0:1.300028.2+4+g327c833+dirty-1

Complete!

real    0m5.734s
user    0m3.488s
sys     0m0.557s

okankoAMZ
okankoAMZ previously approved these changes Oct 4, 2023
okankoAMZ
okankoAMZ previously approved these changes Oct 4, 2023
@sethAmazon sethAmazon changed the title Use Gzip 0 RPM Compression To Fix Install On AL2 Without Kernel Patch Use XZ 9 RPM Compression To Fix Install On AL2 Without Kernel Patch Oct 4, 2023
@@ -10,6 +10,8 @@ Source: amazon-cloudwatch-agent.tar.gz

%define _enable_debug_packages 0
%define debug_package %{nil}
%define _source_payload w9.xzdio
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For testing, set this to 0, so build is faster bc compression takes a long time when set to 9

@sethAmazon sethAmazon changed the title Use XZ 9 RPM Compression To Fix Install On AL2 Without Kernel Patch Use XZ 2 RPM Compression To Fix Install On AL2 Without Kernel Patch Oct 4, 2023
@sethAmazon sethAmazon changed the title Use XZ 2 RPM Compression To Fix Install On AL2 Without Kernel Patch Use GZIP 6 RPM Compression To Fix Install On AL2 Without Kernel Patch Oct 4, 2023
@@ -10,6 +10,8 @@ Source: amazon-cloudwatch-agent.tar.gz

%define _enable_debug_packages 0
%define debug_package %{nil}
%define _source_payload w6.gzdio
%define _binary_payload w6.gzdio
Copy link
Contributor

Choose a reason for hiding this comment

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

overview still says gzip 0.

After evaluating xz compression and gzip compression with different compression levels we are choosing level 6 (which is the default)

Current binary size is X compared to before it was Y.
Current install time is X compared to before it was Y.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@sethAmazon sethAmazon merged commit 11de82c into aws:main Oct 4, 2023
6 checks passed
@sethAmazon sethAmazon deleted the do-not-compress branch October 4, 2023 17:34
sethAmazon added a commit to sethAmazon/amazon-cloudwatch-agent that referenced this pull request Oct 4, 2023
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