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

Improve the Wazuh indexer package generation guide #419

Open
Tracked by #485
rauldpm opened this issue Sep 19, 2024 · 2 comments · May be fixed by wazuh/wazuh-documentation#7988
Open
Tracked by #485

Improve the Wazuh indexer package generation guide #419

rauldpm opened this issue Sep 19, 2024 · 2 comments · May be fixed by wazuh/wazuh-documentation#7988
Assignees
Labels
level/task Task issue type/enhancement Enhancement issue

Comments

@rauldpm
Copy link
Member

rauldpm commented Sep 19, 2024

Description

In the testing done in the issue wazuh/wazuh-qa#5753, I tried to generate an RPM and a DEB package using the Wazuh documentation for package generation https://documentation.wazuh.com/current/development/packaging/generate-indexer-package.html

First, I tried to follow the Docker guide as I do not want to install dependencies and the process is more agile, here I see that the documentation does not state which requirements are necessary to generate a Wazuh indexer package using the local package generation

Following the Docker guide, it states to use a provided Docker environment, which redirects to the master branch, this is wrong as the 4.9 documentation should point to the v4.9.0 tag (or the last patch of that minor)

That link redirected to a GitHub readme which stated as the first sentence to install Docker Desktop, which I didn't want to install, so I returned to the local package generation.

The local package generation states to run the following command bash packaging_scripts/build.sh -a x64 -d tar -n $(bash packaging_scripts/baptizer.sh -a x64 -d tar -m), which created a TAR file successfully, then I followed the Assembly stage and used the DEB tab

This tab does not specify any command to be executed or redirect to any documentation about how to generate the final package, it just explains what to the assemble.sh script works, the same happens for the RPM tab, but, in exchange, the TAR tab does specify a command to generate the TAR package

This is confusing because as a user, I want to generate a package, I do not want to learn what the scripts do, I want to know which command I need to execute and how, if I want more info, I will look at the code, the repositories README or the description of the documentation itself, but a step by step seems to be excessive for me

By intuition, I executed the TAR tab command with deb instead of tar, and it worked until I got an error about command not found: mvn, as I didn't install any dependencies I expected this to happen.

As I can't generate a package using that method, I changed again to the Docker Desktop guide and tried to install it, but I got errors related to the qemu process, finally, I skipped the requisites section and deployed two containers that I used to generate and assemble the final package, I want to remark that the Docker Desktop install is not marked as optional and there is no reference about deploy those containers in the Wazuh documentation itself

The Wazuh documentation guide for package generation should be simple and clear, and should not depend on users to investigate how to build a package looking on the GitHub repository without any indication, as other package generation guides, it should:

  1. Specify which requirements are needed to follow each method (docker or local)
  2. How to get the Wazuh indexer code cloning the repository and how to checkout to the desired branch (specified by the documentation version - tag)
  3. Which steps should the user follow to complete each method, instead of splitting methods, each method should say how to build and assemble it - One start, One end, No detours)
  4. Examples of commands
  5. Links references

Documentation should not

  • Reference to another GitHub branch version different from the documentation if any link is needed
  • Relay on the user to follow external guides on GitHub, those can be added as helpers instead
  • State a requirement in an external link as required if can be skipped (Docker Desktop)
  • Miss requirements
  • Miss commands
  • Miss examples

An example is the Wazuh manager/agent guide: https://documentation.wazuh.com/current/development/packaging/generate-deb-rpm-package.html

An example of this would be (where local generation has different tabs for each system [rpm/deb/tar])

- Requirements
  - Docker
    - Docker engine, etc
  - Local
    - Maven x.y.z
- Docker generation
  - Install requisites
  - Setup environment
    - ./dev.sh up
  - Build
    - docker exec -it wi-build_4.9.1 bash packaging_scripts/build.sh -a x64 -d deb
  - Assemble
    - docker exec -it wi-assemble_4.9.1 bash packaging_scripts/assemble.sh -a x64 -d deb
  - Destroy environment
    - ./dev.sh stop/down
- Local generation
  - Install requisites
  - Build
    - Scripts help
    - bash packaging_scripts/build.sh -a x64 -d deb -n $(bash packaging_scripts/baptizer.sh -a x64 -d deb -m)
  - Assemble
    - Scripts help
    - bash packaging_scripts/assemble.sh -a x64 -d deb -r 1
- References
  - Script info
  - Links
  - Repository

Actually, unless you have extensive knowledge about how the repository works, it is very difficult to generate a Wazuh indexer package following the official documentation, we should improve it

Related #419

@rauldpm rauldpm added level/task Task issue type/change Change performed in a resource or Wazuh Cloud environment labels Sep 19, 2024
@rauldpm rauldpm transferred this issue from wazuh/wazuh-qa Sep 19, 2024
@wazuhci wazuhci moved this to Triage in Release 4.9.1 Sep 20, 2024
@AlexRuiz7 AlexRuiz7 added type/enhancement Enhancement issue and removed type/change Change performed in a resource or Wazuh Cloud environment labels Sep 23, 2024
@wazuhci wazuhci moved this to Backlog in Release 5.0.0 Sep 23, 2024
@f-galland f-galland self-assigned this Nov 26, 2024
@f-galland
Copy link
Member

f-galland commented Nov 26, 2024

Tasks:

  • Include a requirements list for local package generation
  • Make links to github point to the right tag (4.9.x)
  • Remove references to docker-desktop
  • Provide commands for local (non-docker) package generation
  • Include a dependency list for local packages generation
  • Improve the general layout and flow of the page(s)

@wazuhci wazuhci moved this from Backlog to In progress in Release 5.0.0 Nov 26, 2024
@wazuhci wazuhci moved this from In progress to Pending review in Release 5.0.0 Nov 26, 2024
@AlexRuiz7
Copy link
Member

PR is subject to change due to #522

@wazuhci wazuhci moved this from Pending review to In progress in Release 5.0.0 Nov 27, 2024
@wazuhci wazuhci moved this from In progress to On hold in Release 5.0.0 Nov 28, 2024
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: On hold
Development

Successfully merging a pull request may close this issue.

4 participants