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

Create a runnable distribution from assemble task #1774

Merged
merged 4 commits into from
Sep 16, 2022

Conversation

oeyh
Copy link
Collaborator

@oeyh oeyh commented Sep 15, 2022

Signed-off-by: Hai Yan [email protected]

Description

This PR improves the assemble gradle task. It now calls an additional install task provided by the distribution plugin to create a runnable distribution. With this change, we can build and run data prepper by:

  1. Run ./gradlew assemble
  2. Go to release/archives/linux/build/install/opensearch-data-prepper-{VERSION}-linux-x64 and run bin/data-prepper

Issues Resolved

Resolves #1762

Check List

  • New functionality includes testing.
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@oeyh oeyh requested a review from a team as a code owner September 15, 2022 22:01
Comment on lines +88 to +90
tasks.withType(Zip) {
enabled false
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This disables the tasks to build .zip distributions. I assume those are not needed?

Copy link
Member

Choose a reason for hiding this comment

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

We do not build zip archives presently.

Comment on lines -15 to -21
if(startParameter.getProjectProperties().containsKey('release')){
include 'release'
include 'release:archives'
include 'release:archives:linux'
include 'release:docker'
include 'release:maven'
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With the recent directory change, I think this conditional is not needed anymore. We need release projects included to assemble a runnable data prepper because the data-prepper shell script is inside release folder.

Anything I may be missing here?

Copy link
Member

Choose a reason for hiding this comment

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

I agree here that we shouldn't require this property anymore.

The only possible downsides I would see are: 1) If the release build requires build parameters the build would fail, but that seems to not be the case; 2) Users might have to download a few extra dependencies to build (e.g. Docker), but that should be quite minor.

I think the benefit of a streamlined command outweighs those.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this not required now because we want to create a runnable distribution even with ./gradlew assembe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's right.

dlvenable
dlvenable previously approved these changes Sep 16, 2022
Copy link
Member

@dlvenable dlvenable left a comment

Choose a reason for hiding this comment

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

We'll want to update our documentation here:
https://github.com/opensearch-project/data-prepper/blob/main/docs/developer_guide.md#running-the-project

Can be in this PR or a follow-on.

Comment on lines -15 to -21
if(startParameter.getProjectProperties().containsKey('release')){
include 'release'
include 'release:archives'
include 'release:archives:linux'
include 'release:docker'
include 'release:maven'
}
Copy link
Member

Choose a reason for hiding this comment

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

I agree here that we shouldn't require this property anymore.

The only possible downsides I would see are: 1) If the release build requires build parameters the build would fail, but that seems to not be the case; 2) Users might have to download a few extra dependencies to build (e.g. Docker), but that should be quite minor.

I think the benefit of a streamlined command outweighs those.

asifsmohammed
asifsmohammed previously approved these changes Sep 16, 2022
Comment on lines -15 to -21
if(startParameter.getProjectProperties().containsKey('release')){
include 'release'
include 'release:archives'
include 'release:archives:linux'
include 'release:docker'
include 'release:maven'
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this not required now because we want to create a runnable distribution even with ./gradlew assembe?

@oeyh oeyh dismissed stale reviews from asifsmohammed and dlvenable via 00d785a September 16, 2022 17:33
dlvenable
dlvenable previously approved these changes Sep 16, 2022
Comment on lines +88 to +90
tasks.withType(Zip) {
enabled false
}
Copy link
Member

Choose a reason for hiding this comment

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

We do not build zip archives presently.

dlvenable
dlvenable previously approved these changes Sep 16, 2022
@oeyh
Copy link
Collaborator Author

oeyh commented Sep 16, 2022

Found some unit test failures after rebasing on latest main. Pushed a commit to fix them.

Thanks @asifsmohammed for help with the fix.

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2022

Codecov Report

Merging #1774 (aeaa782) into main (e94d91a) will decrease coverage by 0.12%.
The diff coverage is 89.13%.

@@             Coverage Diff              @@
##               main    #1774      +/-   ##
============================================
- Coverage     94.11%   93.99%   -0.13%     
- Complexity     1423     1431       +8     
============================================
  Files           187      187              
  Lines          4180     4213      +33     
  Branches        336      339       +3     
============================================
+ Hits           3934     3960      +26     
- Misses          167      173       +6     
- Partials         79       80       +1     
Impacted Files Coverage Δ
.../opensearch/dataprepper/parser/PipelineParser.java 84.89% <80.76%> (-2.83%) ⬇️
.../dataprepper/peerforwarder/LocalPeerForwarder.java 100.00% <100.00%> (ø)
...taprepper/peerforwarder/PeerForwarderProvider.java 96.55% <100.00%> (ø)
...eerforwarder/PeerForwardingProcessorDecorator.java 100.00% <100.00%> (ø)
...dataprepper/peerforwarder/RemotePeerForwarder.java 86.00% <100.00%> (+2.27%) ⬆️
...peerforwarder/server/PeerForwarderHttpService.java 97.77% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@oeyh oeyh merged commit 21afeb6 into opensearch-project:main Sep 16, 2022
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.

Improve Data Prepper assemble task to create a runnable distribution
4 participants