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

Build and include the Reporting plugin to the wazuh-indexer packages #423

Closed
AlexRuiz7 opened this issue Sep 20, 2024 · 1 comment · Fixed by #431
Closed

Build and include the Reporting plugin to the wazuh-indexer packages #423

AlexRuiz7 opened this issue Sep 20, 2024 · 1 comment · Fixed by #431
Assignees
Labels
level/task Task issue type/enhancement Enhancement issue

Comments

@AlexRuiz7
Copy link
Member

AlexRuiz7 commented Sep 20, 2024

Description

We need to update the GH Workflow to build packages of the wazuh-indexer to build and include the new Reporting plugin.

In this case, as the wazuh-indexer-reports-scheduler plugin is a fork of the Opensearch's reporting plugin, we need no only to include our version of the plugin, but remove the installation of Opensearch's reporting plugin, effectively replacing theirs with ours.

There are several places where we need to swap the plugins (opensearch-reports-schedulerwazuh-indexer-reports-scheduler):

14 results - 5 files

wazuh-indexer/.github/workflows/poc-checklist.yml:
  36                  - [ ] opensearch-performance-analyzer
  37:                 - [ ] opensearch-reports-scheduler
  38                  - [ ] opensearch-security

wazuh-indexer/distribution/packages/src/deb/debmake_install.sh:
  71  
  72: if [ -e "${buildroot}/${config_dir}/opensearch-reports-scheduler/reports-scheduler.yml" ]; then
  73: 	chmod -c 660 "${buildroot}/${config_dir}/opensearch-reports-scheduler/reports-scheduler.yml"
  74  fi

wazuh-indexer/distribution/packages/src/rpm/wazuh-indexer.cicd.spec:
  380  %attr(640, %{USER}, %{GROUP}) %{INSTALL_DIR}/plugins/opensearch-geospatial/*.policy
  381: %dir %attr(750, %{USER}, %{GROUP}) %{INSTALL_DIR}/plugins/opensearch-reports-scheduler/
  382: %attr(640, %{USER}, %{GROUP}) %{INSTALL_DIR}/plugins/opensearch-reports-scheduler/*.jar
  383: %attr(640, %{USER}, %{GROUP}) %{INSTALL_DIR}/plugins/opensearch-reports-scheduler/*.policy
  384: %attr(640, %{USER}, %{GROUP}) %{INSTALL_DIR}/plugins/opensearch-reports-scheduler/*.properties
  385  %dir %attr(750, %{USER}, %{GROUP}) %{INSTALL_DIR}/plugins/opensearch-cross-cluster-replication/

  646  %dir %attr(750, %{USER}, %{GROUP}) %{CONFIG_DIR}/jvm.options.d/
  647: %dir %attr(750, %{USER}, %{GROUP}) %{CONFIG_DIR}/opensearch-reports-scheduler/
  648: %attr(660, %{USER}, %{GROUP}) %{CONFIG_DIR}/opensearch-reports-scheduler/*.yml
  649  %config(noreplace) %attr(660, %{USER}, %{GROUP}) %{CONFIG_DIR}/*.properties

wazuh-indexer/distribution/packages/src/rpm/wazuh-indexer.rpm.spec:
   59  %define observability_plugin %( if [ -f %{_topdir}/etc/wazuh-indexer/opensearch-observability/observability.yml ]; then echo "1" ; else echo "0"; fi )
   60: %define reportsscheduler_plugin %( if [ -f %{_topdir}/etc/wazuh-indexer/opensearch-reports-scheduler/reports-scheduler.yml ]; then echo "1" ; else echo "0"; fi )
   61  

   79  mkdir -p %{buildroot}%{config_dir}/opensearch-observability
   80: mkdir -p %{buildroot}%{config_dir}/opensearch-reports-scheduler
   81  mkdir -p %{buildroot}%{product_dir}/performance-analyzer-rca

  146  if [ %reportsscheduler_plugin -eq 1 ]; then
  147:     set -- "$@" "%{config_dir}/opensearch-reports-scheduler/reports-scheduler.yml"
  148  fi

  254  %if %reportsscheduler_plugin
  255: %config(noreplace) %attr(660, %{name}, %{name}) %{config_dir}/opensearch-reports-scheduler/reports-scheduler.yml
  256  %endif

wazuh-indexer/packaging_scripts/assemble.sh:
  37          "performance-analyzer" # "opensearch-performance-analyzer"
  38:         "opensearch-reports-scheduler"
  39          "opensearch-security"
@AlexRuiz7 AlexRuiz7 added level/task Task issue type/enhancement Enhancement issue labels Sep 20, 2024
@f-galland f-galland self-assigned this Sep 23, 2024
@AlexRuiz7 AlexRuiz7 assigned AlexRuiz7 and unassigned f-galland Sep 25, 2024
@AlexRuiz7 AlexRuiz7 linked a pull request Sep 25, 2024 that will close this issue
8 tasks
@AlexRuiz7
Copy link
Member Author

AlexRuiz7 commented Sep 25, 2024

References in files

  • wazuh-indexer/.github/workflows/poc-checklist.yml (no action)
  • wazuh-indexer/distribution/packages/src/deb/debmake_install.sh (replaced)
  • wazuh-indexer/distribution/packages/src/rpm/wazuh-indexer.cicd.spec (no action)
  • wazuh-indexer/distribution/packages/src/rpm/wazuh-indexer.rpm.spec (replaced)
  • wazuh-indexer/packaging_scripts/assemble.sh (replaced)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue type/enhancement Enhancement issue
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants