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

Unify wazuh-indexer build process #522

Open
7 tasks done
Tracked by #485
AlexRuiz7 opened this issue Nov 6, 2024 · 1 comment · May be fixed by #560 or wazuh/wazuh-documentation#7988
Open
7 tasks done
Tracked by #485

Unify wazuh-indexer build process #522

AlexRuiz7 opened this issue Nov 6, 2024 · 1 comment · May be fixed by #560 or wazuh/wazuh-documentation#7988
Assignees
Labels
level/task Task issue request/operational Operational requests type/enhancement Enhancement issue

Comments

@AlexRuiz7
Copy link
Member

AlexRuiz7 commented Nov 6, 2024

Description

Currently, the process to generate wazuh-indexer packages is split in two phases, build and assembly. While the build process consists of compiling the Java source code of indexer and bundling it alone into a package (deb, rpm or tar), the assembly process takes this bundle as input, extracts it, includes plugins and configurations and bundles it back as the final package ready to deliver.

The goal of this issue is to unify the process into a single step by using a Dockerfile that wraps both processes, making it transparent to the final user.

Although this is of great interest for bundling wazuh-indexer packages locally, I think our current process in GitHub Actions already fits this use case as it's all done in one run, so we can leave that untouched.

To summarize, the process to build packages locally must be improved to reduce user interaction as much as possible.

Functional requirements

  • The build process clones and builds our plugins before building indexer.
  • The build process clones and build wazuh-indexer.
  • Packages are assembled with plugins, indexer and configuration files.

Implementation restrictions

  • Use Docker to wrap all the process to build packages.
  • Apart from Docker, no additional dependencies are required.
  • Packages can be built using a one-line command: docker run <image> <args>

Plan

Take https://github.com/wazuh/wazuh/actions as reference.

@AlexRuiz7 AlexRuiz7 added level/task Task issue request/operational Operational requests type/enhancement Enhancement issue labels Nov 6, 2024
@wazuhci wazuhci moved this to Triage in Release 5.0.0 Nov 6, 2024
@wazuhci wazuhci moved this from Triage to Backlog in Release 5.0.0 Nov 11, 2024
@wazuhci wazuhci moved this from Backlog to In progress in Release 5.0.0 Nov 13, 2024
@QU3B1M QU3B1M linked a pull request Nov 21, 2024 that will close this issue
3 tasks
@QU3B1M
Copy link
Member

QU3B1M commented Nov 26, 2024

Completed an initial working version of the build process Dockerfile. The build process requires two different steps, the image building, and the container execution.
There are two reasons for this approach, one is to make the image more lightweight by separating the system setup and provision from the build process execution, and the other is to be able to use volume that can be externally defined at the run stage, in which the resulting package will be stored.

Example usage:

  1. Build Docker image
    cd docker/builder && docker build -t wazuh-indexer-builder . && cd ../..

    If the command is being executed from another directory, such as the repository root, it should be ran this: docker build -t builder -f docker/builder/image/Dockerfile docker/builder/image/

  2. Execute the builder container
    docker run --rm -v ./artifacts/dist:/home/indexer/artifacts wazuh-indexer-builder

    Optional variables INDEXER_BRANCH, INDEXER_PLUGINS_BRANCH, INDEXER_REPORTING_BRANCH, REVISION, IS_STAGE, DISTRIBUTION, ARCHITECTURE

@wazuhci wazuhci moved this from In progress to Pending review in Release 5.0.0 Nov 26, 2024
@QU3B1M QU3B1M linked a pull request Nov 26, 2024 that will close this issue
7 tasks
@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
@wazuhci wazuhci moved this from On hold to In progress in Release 5.0.0 Dec 5, 2024
@wazuhci wazuhci moved this from In progress to On hold in Release 5.0.0 Dec 6, 2024
@wazuhci wazuhci moved this from On hold to In progress in Release 5.0.0 Dec 9, 2024
@wazuhci wazuhci moved this from In progress to On hold in Release 5.0.0 Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue request/operational Operational requests type/enhancement Enhancement issue
Projects
Status: On hold
3 participants