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

Add publishToMavenLocal in default script #4434

Merged

Conversation

zane-neo
Copy link
Contributor

@zane-neo zane-neo commented Feb 9, 2024

Description

Add publishToMavenLocal in default script

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

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.

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5b4f11f) 91.35% compared to head (e52db95) 91.35%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4434   +/-   ##
=======================================
  Coverage   91.35%   91.35%           
=======================================
  Files         190      190           
  Lines        6197     6197           
=======================================
  Hits         5661     5661           
  Misses        536      536           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@prudhvigodithi
Copy link
Collaborator

Adding some context this will publish the pluginZip files to the local maven (~/.m2) folder and the dependencies can be consumed during runtime. USeful for opensearch-project/skills#178.

Copy link
Member

@peterzhuamazon peterzhuamazon left a comment

Choose a reason for hiding this comment

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

Talked to @prudhvigodithi and @zane-neo and this is good to approve.

Previous attempt: opensearch-project/security#3959

Thanks.

@prudhvigodithi prudhvigodithi merged commit a1663d3 into opensearch-project:main Feb 9, 2024
13 checks passed
@prudhvigodithi
Copy link
Collaborator

prudhvigodithi commented Feb 9, 2024

@zane-neo Found an issue building geospatial can you please check?

./gradlew publishToMavenLocal -Dopensearch.version=2.12.0 -Dbuild.snapshot=false -Dbuild.version_qualifier=
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.4
  OS Info               : Linux 5.10.209-175.812.amzn2int.x86_64 (amd64)
  JDK Version           : 21 (Eclipse Temurin JDK)
  JAVA_HOME             : /opt/java/openjdk-21
  Random Testing Seed   : 73E7C5DF05D6B0A
  In FIPS 140 mode      : false
=======================================
> Task :libs:h3:generatePomFileForPluginZipPublication FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':libs:h3:generatePomFileForPluginZipPublication' (type 'GenerateMavenPom').
  - Gradle detected a problem with the following location: '/tmp/tmp722hjs0c/geospatial/libs/h3/build/distributions/h3-2.12.0.0.pom'.
    
    Reason: Task ':libs:h3:publishNebulaPublicationToMavenLocal' uses this output of task ':libs:h3:generatePomFileForPluginZipPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':libs:h3:generatePomFileForPluginZipPublication' as an input of ':libs:h3:publishNebulaPublicationToMavenLocal'.
      2. Declare an explicit dependency on ':libs:h3:generatePomFileForPluginZipPublication' from ':libs:h3:publishNebulaPublicationToMavenLocal' using Task#dependsOn.
      3. Declare an explicit dependency on ':libs:h3:generatePomFileForPluginZipPublication' from ':libs:h3:publishNebulaPublicationToMavenLocal' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.4/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 1s

@prudhvigodithi
Copy link
Collaborator

Failed for opensearch-reports as well

+ ./gradlew publishToMavenLocal -Dopensearch.version=2.12.0 -Dbuild.snapshot=false -Dbuild.version_qualifier=
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.5
  OS Info               : Linux 5.10.209-175.812.amzn2int.x86_64 (amd64)
  JDK Version           : 21 (Eclipse Temurin JDK)
  JAVA_HOME             : /opt/java/openjdk-21
  Random Testing Seed   : E251AF2B1417D7C7
  In FIPS 140 mode      : false
=======================================
> Task :generatePomFileForPluginZipPublication FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':generatePomFileForPluginZipPublication' (type 'GenerateMavenPom').
  - Gradle detected a problem with the following location: '/tmp/tmp5aet32oq/opensearch-reports/build/distributions/opensearch-reports-scheduler-2.12.0.0.pom'.
    
    Reason: Task ':publishNebulaPublicationToMavenLocal' uses this output of task ':generatePomFileForPluginZipPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':generatePomFileForPluginZipPublication' as an input of ':publishNebulaPublicationToMavenLocal'.
      2. Declare an explicit dependency on ':generatePomFileForPluginZipPublication' from ':publishNebulaPublicationToMavenLocal' using Task#dependsOn.
      3. Declare an explicit dependency on ':generatePomFileForPluginZipPublication' from ':publishNebulaPublicationToMavenLocal' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.5/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 2s
13 actionable tasks: 4 executed, 9 up-to-date
2024-02-09 03:47:50 ERROR    Error building opensearch-reports, retry with: ./build.sh manifests/2.12.0/opensearch-2.12.0.yml --component opensearch-reports
2024-02-09 03:47:50 INFO     Removing /tmp/tmp5aet32oq
Traceback (most recent call last):
  File "/home/ci-runner/git/opensearch-build/./src/run_build.py", line 112, in <module>
    sys.exit(main())
  File "/home/ci-runner/git/opensearch-build/./src/run_build.py", line 93, in main
    builder.build(build_recorder)
  File "/home/ci-runner/git/opensearch-build/src/build_workflow/builder_from_source.py", line 56, in build
    self.git_repo.execute(build_command)
  File "/home/ci-runner/git/opensearch-build/src/git/git_repository.py", line 85, in execute
    subprocess.check_call(command, cwd=cwd, shell=True)
  File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'bash /home/ci-runner/git/opensearch-build/scripts/default/opensearch/build.sh -v 2.12.0 -p linux -a x64 -s false -o builds' returned non-zero exit status 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants