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

[Enhancement] Adding TYPE Support With archives/packages/dirs Options #2571

Closed
peterzhuamazon opened this issue Mar 23, 2022 · 7 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@peterzhuamazon
Copy link
Member

This issue is a expansion of #2517.

We want to add a TYPE parameter (-Dbuild.type ?) during core build, TYPE=archives/packages/dirs.
User can do distribution=rpm;type=dirs and they will be provided with directory of files that is built for rpm, instead of rpm pkg as a final result.

This is specifically useful when we want to install additional plugins, more changes, extra tweaks before packaging them into final release artifacts, without the need to untar/unzip/extract rpm before repackaging them back.

This would also avoid many issues during the extraction phase and we can completely remove the extraction out of the code base of opensearch-build repo.

Thanks.

@peterzhuamazon
Copy link
Member Author

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Mar 25, 2022

Initially we think running distribution:packages:rpm:build would give me extracted files.
Which runs pretty well in 1.2.0.

In 1.3.0 it failed as well and turns out it is using the same cpio utility.
See #2517.

./gradlew distribution:packages:rpm:build

> Task :distribution:packages:rpm:checkExtraction FAILED
Output for rpm:
warning: Unable to get systemd shutdown inhibition lock
warning: Unable to get systemd shutdown inhibition lock
error: unpacking of archive failed on file /local/home/zhujiaxi/OpenSearch/distribution/packages/rpm/build/extracted/rpm-extracted/usr/share/opensearch/jdk/man/ja: cpio: rename failed - Is a directory
error: opensearch-0:1.3.1~SNAPSHOT-1.x86_64: install failed


This is really a blocker now if we cannot fix it in the core.
But seems like it needs to delete ja as well.
Core needs to find a way to retain the files before the rpm generation even happens.

@xuezhou25
Copy link
Contributor

xuezhou25 commented Mar 25, 2022

It's not easy to retain the files before the rpm package, because packaging process is controlled by Gradle nebula ospackage plugin.
As far as I know, ospackage plugin doesn't give the opportunity to preserve source files before packaging.
Currently in OpenSearch build script, the files used for packaging is gathered in separate steps (for example:
https://github.com/opensearch-project/OpenSearch/blob/1.3.0/distribution/packages/build.gradle#L157-L175).
There is no existing directory that contains all the files to generate rpm/deb packages.
My thought is to copy all the required files into a directory before using the ospackage plugin, but it will lead to much code modification.
@saratvemulapalli @dblock

@dblock
Copy link
Member

dblock commented Mar 25, 2022

I agree with @xuezhou25. We're building RPM in core, but then we want to add things to RPM and rebuild RPM again for the bundle build. I think if we want directory output, or some other output we need to add a different distribution target.

@anasalkouz
Copy link
Member

@peterzhuamazon what is your thought on the suggested approach?

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Mar 25, 2022

@dblock @saratvemulapalli This PR #2602 is raised to resolve #2517 temporarily.
@xuezhou25 is working on resolving this issue on a separate PR.

Thanks.

@andrross
Copy link
Member

Closing this in favor of #2665 to track a longer term solution here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants