Fix ML build with 1) adapt to gradle shadow plugin v9 upgrade and 2) make ml-common fips build param aware#4654
Conversation
…make ml-common fips build param aware Signed-off-by: Craig Perkins <cwperx@amazon.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe pull request adds FIPS-140-3 crypto standard enforcement to CI/CD workflows via Gradle build flags, updates shadow MavenPublication configuration across multiple modules from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| then | ||
| echo "Security plugin is available" | ||
| ./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -Dhttps=true -Duser=admin -Dpassword=${{ steps.genpass.outputs.password }} -x spotlessJava | ||
| ./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -Dhttps=true -Duser=admin -Dpassword=${{ steps.genpass.outputs.password }} -Pcrypto.standard=FIPS-140-3 -x spotlessJava |
There was a problem hiding this comment.
These ones may not be needed if this truly uses a remote cluster.
Note: integTest task should be reserved for when tests are run against testclusters. Use integTestRemote task when running against a target cluster that is running outside the JVM.
| else | ||
| echo "Security plugin is NOT available" | ||
| ./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -x spotlessJava | ||
| ./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -Pcrypto.standard=FIPS-140-3 -x spotlessJava |
There was a problem hiding this comment.
These ones may not be needed if this truly uses a remote cluster.
Note: integTest task should be reserved for when tests are run against testclusters. Use integTestRemote task when running against a target cluster that is running outside the JVM.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/CI-workflow.yml (1)
242-249: Consider adding the FIPS flag to the commented Windows integTest for consistency.The commented-out Windows
integTestsection lacks the-Pcrypto.standard=FIPS-140-3flag that's now applied to Linux and Docker paths. If this section is re-enabled later, it would run without FIPS mode, creating inconsistency.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/CI-workflow.yml around lines 242 - 249, The commented Windows "Multi Nodes Integration Testing" block runs ./gradlew integTest -PnumNodes=3 without the FIPS flag; update that command to include the same FIPS mode used elsewhere (add -Pcrypto.standard=FIPS-140-3 to the ./gradlew invocation in the commented block) so if the section is re-enabled it will run with FIPS mode consistent with the Linux/Docker paths.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/workflows/CI-workflow.yml.github/workflows/maven-publish.ymlclient/build.gradlecommon/build.gradleml-algorithms/build.gradlespi/build.gradle
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Build and Test MLCommons Plugin on Windows (25)
- GitHub Check: Build and Test MLCommons Plugin on linux (25)
- GitHub Check: Build and Test MLCommons Plugin on linux (21)
- GitHub Check: Build and Test MLCommons Plugin on Windows (21)
🔇 Additional comments (6)
ml-algorithms/build.gradle (1)
7-7: FIPS mode handling looks correct.The conditional logic appropriately switches
bc-fipstocompileOnlyin FIPS mode (since OpenSearch provides it at runtime) and keeps it asimplementationotherwise. This aligns with the PR objective of making ml-common FIPS build parameter aware.Also applies to: 82-87
.github/workflows/maven-publish.yml (1)
47-47: LGTM!Adding the FIPS crypto standard flag to the publish command ensures consistent artifact builds with FIPS-140-3 compliance.
spi/build.gradle (1)
109-109: LGTM!The change to
from components.shadowis the correct migration for the newer shadow plugin versions, which uses Gradle's software component model for publications.common/build.gradle (1)
126-126: LGTM!Consistent shadow publication wiring change matching the pattern applied to other modules.
client/build.gradle (1)
85-85: LGTM!Consistent shadow publication wiring change matching the pattern applied to spi and common modules.
.github/workflows/CI-workflow.yml (1)
88-88: LGTM!The FIPS-140-3 crypto standard flag is consistently applied to all active
integTestinvocations across Linux and Docker test paths, ensuring tests run under the same crypto policy as the published artifacts.Also applies to: 192-192, 195-195
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/CI-workflow.yml:
- Around line 242-249: The commented Windows "Multi Nodes Integration Testing"
block runs ./gradlew integTest -PnumNodes=3 without the FIPS flag; update that
command to include the same FIPS mode used elsewhere (add
-Pcrypto.standard=FIPS-140-3 to the ./gradlew invocation in the commented block)
so if the section is re-enabled it will run with FIPS mode consistent with the
Linux/Docker paths.
Signed-off-by: Craig Perkins <cwperx@amazon.com>
| echo "build and run tests" && ./gradlew build -x spotlessJava && | ||
| echo "Publish to Maven Local" && ./gradlew publishToMavenLocal -x spotlessJava && | ||
| echo "Multi Nodes Integration Testing" && ./gradlew integTest -PnumNodes=3 -x spotlessJava' | ||
| echo "build and run tests" && ./gradlew build -Pcrypto.standard=FIPS-140-3 -x spotlessJava && |
There was a problem hiding this comment.
The workflow changes in this PR won't take effect until after this PR is merged, so the current build failures won't be fixed by these changes.
Would it make sense to split this into two PRs?
- First PR: Just the workflow changes
- Second PR: The code changes (which would then run against the updated workflow)
There was a problem hiding this comment.
what's the reason behind having second PR, code owners should be able to restart workflows on demand, aren't they?
There was a problem hiding this comment.
Why isn't it picking up the workflow changes? Happy to do either way.
Signed-off-by: Craig Perkins <cwperx@amazon.com>
…make ml-common fips build param aware (opensearch-project#4654) * Fix ML build with 1) adapt to gradle shadow plugin v9 upgrade and 2) make ml-common fips build param aware Signed-off-by: Craig Perkins <cwperx@amazon.com> * Add to build tasks as well Signed-off-by: Craig Perkins <cwperx@amazon.com> * Add FipsBuildParam in plugin/build.gradle Signed-off-by: Craig Perkins <cwperx@amazon.com> --------- Signed-off-by: Craig Perkins <cwperx@amazon.com> Signed-off-by: Carlos Rolo <carlos.rolo@netapp.com>
Description
Fix ML build with:
Related Issues
Build fix
Check List
--signoff.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.