-
Notifications
You must be signed in to change notification settings - Fork 26
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
[WIP] Faster rpm build #436
base: master
Are you sure you want to change the base?
Conversation
This was externalized in subsequent versions of rpmbuild: rpm-software-management/rpm#1607 I believe we can manually run this if needed to build any python provides, requires, etc. whenever we pull in new python stuff.
Another option might be to just install rpmbuild 4.19 directly to avoid the curl and os macro changes. Not sure how hard that is or not |
@@ -22,14 +33,14 @@ def create_gemset_tarball | |||
plugin_index.write(plugin_index.read.gsub(BUILD_DIR.join("manageiq").to_s, '/var/www/miq/vmdb')) | |||
|
|||
name = "gemset" | |||
shell_cmd("tar -C #{BUILD_DIR} -zcf #{tar_full_path(name)} -X #{exclude_file(name)} #{tar_basename(name)}") | |||
shell_cmd("tar -C #{BUILD_DIR} -zcf #{tar_full_path(name)} --exclude-vcs -X #{exclude_file(name)} #{tar_basename(name)}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a problem if it removes more than the .git dir from git based gems within bundler (well have to check if that matters or not, and it's possible we already had those removed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I really want to see if I can run rpmdiff before and after this PR. I will not extract that until I can do that.
@@ -0,0 +1,50 @@ | |||
#!/bin/sh | |||
# From https://github.com/rpm-software-management/rpm/blob/rpm-4.19.1-release/scripts/brp-strip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, since this is a GPL file let's try curl and patch instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I think it's similar to pulling down the source for repmgr in https://github.com/ManageIQ/manageiq-rpm_build/blob/master/packages/repmgr13/repmgr.spec#L24. Then, we just have patch file with the minor change to add rb/js filtering and we can apply that on top.
My assumption is we'd need to add a new dnf repo to install it as it will likely pull in lots of other dependencies. We're using the latest rpm/rpmbuild available in our ubi8 repo. |
We also discussed a possible
|
d8e8854
to
54175d1
Compare
Dockerfile
Outdated
RUN curl -o brp-strip https://raw.githubusercontent.com/rpm-software-management/rpm/rpm-4.19.1-release/scripts/brp-strip | ||
|
||
RUN chmod +x brp-strip | ||
|
||
RUN patch -p2 < Add-js-rb-filtering-on-top-of-4.19.1.patch && \ | ||
ls -l /usr/lib/rpm/brp-strip && \ | ||
mv brp-strip /usr/lib/rpm/brp-strip && \ | ||
ls -l /usr/lib/rpm/brp-strip && \ | ||
rm -f Add-js-rb-filtering-on-top-of-4.19.1.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! A few comments here:
- The patch file should probably live in the container-assets directory, as opposed to the root. That way you can reuse the
COPY . /build_scripts
command which already copies the container-assets directory. - Prefer curling the file directly into /usr/lib/rpm/brp-strip, overwriting it, and then patching /usr/lib/rpm/brp-strip directly.
- No need to remove the patch file (it doesn't really get deleted from the container anyway)
- Smash all of the RUN commands into a single line.
From: https://github.com/rpm-software-management/rpm/blob/rpm-4.19.1-release/scripts/brp-strip Added js, rb files to the go filtering in upstream version Curl brp-strip 4.19.1 and patch it at image build time
54175d1
to
79931aa
Compare
Some comments on commits jrafanie/manageiq-rpm_build@215db4c~...79931aa lib/manageiq/rpm_build/generate_tar_files.rb
|
Checked commits jrafanie/manageiq-rpm_build@215db4c~...79931aa with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint lib/manageiq/rpm_build/generate_tar_files.rb
|
RUN curl -o /usr/lib/rpm/brp-strip https://raw.githubusercontent.com/rpm-software-management/rpm/rpm-4.19.1-release/scripts/brp-strip | ||
|
||
RUN chmod +x /usr/lib/rpm/brp-strip | ||
|
||
COPY . /build_scripts | ||
|
||
RUN cd /usr/lib/rpm/ && \ | ||
patch -p2 < /build_scripts/container-assets/Add-js-rb-filtering-on-top-of-4.19.1.patch | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can still smash all these together further
RUN curl -o /usr/lib/rpm/brp-strip https://raw.githubusercontent.com/rpm-software-management/rpm/rpm-4.19.1-release/scripts/brp-strip | |
RUN chmod +x /usr/lib/rpm/brp-strip | |
COPY . /build_scripts | |
RUN cd /usr/lib/rpm/ && \ | |
patch -p2 < /build_scripts/container-assets/Add-js-rb-filtering-on-top-of-4.19.1.patch | |
COPY . /build_scripts | |
RUN curl -o /usr/lib/rpm/brp-strip https://raw.githubusercontent.com/rpm-software-management/rpm/rpm-4.19.1-release/scripts/brp-strip && \ | |
chmod +x /usr/lib/rpm/brp-strip && \ | |
cd /usr/lib/rpm/ && \ | |
patch -p2 < /build_scripts/container-assets/Add-js-rb-filtering-on-top-of-4.19.1.patch |
This pull request is not mergeable. Please rebase and repush. |
Merged #437, so this needs a rebase. |
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
1 similar comment
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
Here are some very WIP small and larger changes to try to speed up the rpm build.
My plan is to extract things we like and get them in.
EDIT:
Extracted to #437