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

Update build script to publish to maven local #596

Merged
merged 3 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ext {

allprojects {

group = 'org.opensearch'
group = 'org.opensearch.plugin'
Copy link
Member

Choose a reason for hiding this comment

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

This is not ideal because we set group=org.opensearch so jars can be pushed to org/opensearch/<>.
We then set groupId=org.opensearch.plugin so zips can be pushed to org/opensearch/plugin/<>.

Copy link
Member Author

Choose a reason for hiding this comment

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

For k-NN, we dont puish any jars at the moment.

Copy link
Contributor

@reta reta Oct 26, 2022

Choose a reason for hiding this comment

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

@jmazanec15 you could keep group=org.opensearch there and use groupId=org.opensearch.plugin for ZIPs, it will fix the issue:

   > Invalid publication 'nebula': supplied groupId (org.opensearch) does not match value from POM file (org.opensearch.plugin). Cannot edit groupId directly in the POM file.

Copy link
Member Author

@jmazanec15 jmazanec15 Oct 26, 2022

Choose a reason for hiding this comment

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

@reta I believe this is what we do now:

  1. https://github.com/opensearch-project/k-NN/blob/main/build.gradle#L56
  2. https://github.com/opensearch-project/k-NN/blob/main/build.gradle#L91

I think I can leave as is, but change build script to use:

./gradlew publishPluginZipPublicationToMavenLocal

version = opensearch_version.tokenize('-')[0] + '.0'
if (version_qualifier) {
version += "-${version_qualifier}"
Expand Down
1 change: 1 addition & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ make opensearchknn_faiss opensearchknn_nmslib
cd $work_dir
./gradlew assemble --no-daemon --refresh-dependencies -DskipTests=true -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER
./gradlew publishPluginZipPublicationToZipStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER
./gradlew :publishToMavenLocal -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER

# Add lib to zip
zipPath=$(find "$(pwd)" -path \*build/distributions/*.zip)
Expand Down