4242 description : ' Branch/tag/commit of the wazuh-dashboard-reporting repository to build the main plugins'
4343 required : true
4444 default : ' main'
45+ reference_ml_commons_plugins :
46+ type : string
47+ description : ' Branch/tag/commit of the wazuh-dashboard-ml-commons repository to build the ML Commons plugins'
48+ required : true
49+ default : ' main'
4550 is_stage :
4651 type : boolean
4752 description : ' Set production nomenclature'
8388 type : string
8489 required : true
8590 default : ' main'
91+ reference_ml_commons_plugins :
92+ type : string
93+ required : true
94+ default : ' main'
8695 is_stage :
8796 type : boolean
8897 required : true
@@ -111,6 +120,7 @@ jobs:
111120 COMMIT_SHA : ${{ steps.setup-variables.outputs.COMMIT_SHA }}
112121 PLUGINS_SHA : ${{ steps.setup-variables.outputs.PLUGINS_SHA }}
113122 SECURITY_SHA : ${{ steps.setup-variables.outputs.SECURITY_SHA }}
123+ ML_COMMONS_SHA : ${{ steps.setup-variables.outputs.ML_COMMONS_SHA }}
114124 REPORTING_SHA : ${{ steps.setup-variables.outputs.REPORTING_SHA }}
115125 PRODUCTION : ${{ steps.setup-variables.outputs.PRODUCTION }}
116126 WAZUH_DASHBOARD_SLIM : ${{ steps.setup-variables.outputs.WAZUH_DASHBOARD_SLIM }}
@@ -119,6 +129,7 @@ jobs:
119129 WAZUH_PLUGINS_CORE : ${{ steps.setup-variables.outputs.WAZUH_PLUGINS_CORE }}
120130 WAZUH_PLUGINS_CHECK_UPDATES : ${{ steps.setup-variables.outputs.WAZUH_PLUGINS_CHECK_UPDATES }}
121131 WAZUH_REPORT_PLUGIN : ${{ steps.setup-variables.outputs.WAZUH_REPORT_PLUGIN }}
132+ WAZUH_ML_COMMONS_PLUGIN : ${{ steps.setup-variables.outputs.WAZUH_ML_COMMONS_PLUGIN }}
122133 PACKAGE_NAME : ${{ steps.setup-variables.outputs.PACKAGE_NAME }}
123134 ARCHITECTURE_FLAG : ${{ steps.setup-variables.outputs.ARCHITECTURE_FLAG }}
124135 steps :
@@ -149,6 +160,12 @@ jobs:
149160 git clone -b ${{ inputs.reference_report_plugins }} --single-branch https://github.com/wazuh/wazuh-dashboard-reporting.git wzrp
150161 cd wzrp
151162 echo "WAZUH_REPORTING_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
163+ - name : Get SHA of wazuh-dashboard-ml-commons plugin
164+ id : get-ml-commons-sha
165+ run : |
166+ git clone -b ${{ inputs.reference_ml_commons_plugins }} --single-branch https://github.com/wazuh/wazuh-dashboard-ml-commons.git wzml
167+ cd wzml
168+ echo "WAZUH_ML_COMMONS_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
152169
153170 - name : Setup Node
154171 uses : actions/setup-node@v4
@@ -180,6 +197,7 @@ jobs:
180197 COMMIT_SHA=$(git rev-parse --short HEAD)
181198 PLUGINS_SHA=${{steps.get-plugins-sha.outputs.WAZUH_PLUGINS_SHA}}
182199 SECURITY_SHA=${{steps.get-security-sha.outputs.WAZUH_SECURITY_SHA}}
200+ ML_COMMONS_SHA=${{ steps.get-ml-commons-sha.outputs.WAZUH_ML_COMMONS_SHA }}
183201 REPORTING_SHA=${{steps.get-reporting-sha.outputs.WAZUH_REPORTING_SHA}}
184202 if [ "${{ inputs.is_stage }}" = "true" ]; then
185203 PRODUCTION=--production
@@ -189,6 +207,7 @@ jobs:
189207 WAZUH_DASHBOARD_SLIM=wazuh-dashboard_${VERSION}-${REVISION}_${{ (inputs.ARCHITECTURE == 'x86_64' || inputs.ARCHITECTURE == 'amd64') && 'x64' || 'arm64' }}.tar.gz
190208 WAZUH_SECURITY_PLUGIN=wazuh-security-dashboards-plugin_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_security_plugins }} | sed 's/\//-/g').zip
191209 WAZUH_REPORT_PLUGIN=reports-dashboards_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_report_plugins }} | sed 's/\//-/g').zip
210+ WAZUH_ML_COMMONS_PLUGIN=wazuh-ml-commons-plugin_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_ml_commons_plugins }} | sed 's/\//-/g').zip
192211 WAZUH_PLUGINS_WAZUH=wazuh-dashboard-plugins_wazuh_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_wazuh_plugins }} | sed 's/\//-/g').zip
193212 WAZUH_PLUGINS_CORE=wazuh-dashboard-plugins_wazuh-core_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_wazuh_plugins }} | sed 's/\//-/g').zip
194213 WAZUH_PLUGINS_CHECK_UPDATES=wazuh-dashboard-plugins_wazuh-check-updates_${VERSION}-${REVISION}_$(echo ${{ inputs.reference_wazuh_plugins }} | sed 's/\//-/g').zip
@@ -217,6 +236,7 @@ jobs:
217236 echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_OUTPUT
218237 echo "PLUGINS_SHA=$PLUGINS_SHA" >> $GITHUB_OUTPUT
219238 echo "SECURITY_SHA=$SECURITY_SHA" >> $GITHUB_OUTPUT
239+ echo "ML_COMMONS_SHA=$ML_COMMONS_SHA" >> $GITHUB_OUTPUT
220240 echo "REPORTING_SHA=$REPORTING_SHA" >> $GITHUB_OUTPUT
221241 echo "PRODUCTION=$PRODUCTION" >> $GITHUB_OUTPUT
222242 echo "WAZUH_DASHBOARD_SLIM=$WAZUH_DASHBOARD_SLIM" >> $GITHUB_OUTPUT
@@ -277,6 +297,15 @@ jobs:
277297 with :
278298 reference : ${{ inputs.reference_security_plugins }}
279299
300+ build-ml-commons-plugin :
301+ needs : [validate-job]
302+ name : Build ml commons plugin
303+ permissions :
304+ pull-requests : write
305+ uses : wazuh/wazuh-dashboard-ml-commons/.github/workflows/5_builderpackage_ml_commons_plugin.yml@main
306+ with :
307+ reference : ${{ inputs.reference_ml_commons_plugins }}
308+
280309 build-report-plugin :
281310 needs : [validate-job]
282311 name : Build reporting plugin
@@ -287,7 +316,15 @@ jobs:
287316 reference : ${{ inputs.reference_report_plugins }}
288317
289318 build-package :
290- needs : [setup-variables, build-main-plugins, build-base, build-security-plugin, build-report-plugin]
319+ needs :
320+ [
321+ setup-variables,
322+ build-main-plugins,
323+ build-base,
324+ build-security-plugin,
325+ build-ml-commons-plugin,
326+ build-report-plugin,
327+ ]
291328 runs-on : ${{ (inputs.architecture == 'arm64' || inputs.architecture == 'aarch64') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
292329 name : Generate packages
293330 steps :
@@ -327,6 +364,12 @@ jobs:
327364 with :
328365 name : ${{ needs.setup-variables.outputs.WAZUH_PLUGINS_CHECK_UPDATES }}
329366 path : ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/plugins
367+ - name : Download ml commons plugin artifact
368+ uses : actions/download-artifact@v4
369+ with :
370+ name : ${{ needs.setup-variables.outputs.WAZUH_ML_COMMONS_PLUGIN }}
371+ path : ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/ml-commons-plugin
372+
330373 - name : Download report plugin artifact
331374 uses : actions/download-artifact@v4
332375 with :
@@ -337,6 +380,7 @@ jobs:
337380 run : |
338381 zip -r -j ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/wazuh-package.zip ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/plugins
339382 zip -r -j ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/security-package.zip ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/security-plugin
383+ zip -r -j ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/ml-commons-package.zip ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/ml-commons-plugin
340384 zip -r -j ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/report-package.zip ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/report-plugin
341385 zip -r -j ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/dashboard-package.zip ${{ needs.setup-variables.outputs.CURRENT_DIR }}/artifacts/dashboard/${{ needs.setup-variables.outputs.WAZUH_DASHBOARD_SLIM }}
342386
@@ -347,9 +391,10 @@ jobs:
347391 -r ${{ inputs.revision }} ${{ needs.setup-variables.outputs.ARCHITECTURE_FLAG }} \
348392 -a file://${{needs.setup-variables.outputs.CURRENT_DIR}}/artifacts/wazuh-package.zip \
349393 -s file://${{needs.setup-variables.outputs.CURRENT_DIR}}/artifacts/security-package.zip \
394+ -ml file://${{needs.setup-variables.outputs.CURRENT_DIR}}/artifacts/ml-commons-package.zip \
350395 -b file://${{needs.setup-variables.outputs.CURRENT_DIR}}/artifacts/dashboard-package.zip \
351396 -rp file://${{needs.setup-variables.outputs.CURRENT_DIR}}/artifacts/report-package.zip \
352- --commit-sha ${{needs.setup-variables.outputs.COMMIT_SHA}}-${{needs.setup-variables.outputs.PLUGINS_SHA}}-${{needs.setup-variables.outputs.SECURITY_SHA}}-${{needs.setup-variables.outputs.REPORTING_SHA}} \
397+ --commit-sha ${{needs.setup-variables.outputs.COMMIT_SHA}}-${{needs.setup-variables.outputs.PLUGINS_SHA}}-${{needs.setup-variables.outputs.SECURITY_SHA}}-${{needs.setup-variables.outputs.REPORTING_SHA}}-${{needs.setup-variables.outputs.ML_COMMONS_SHA}} \
353398 --${{ inputs.system }} ${{ needs.setup-variables.outputs.PRODUCTION }} --debug
354399
355400 - name : Upload artifact
0 commit comments