Skip to content

Conversation

@guidomodarelli
Copy link
Member

@guidomodarelli guidomodarelli commented Nov 13, 2025

Description

  • Added dev-tools/build-packages/common/run-with-retry.sh as a reusable helper to tolerate transient failures, configurable via RETRY_MAX_ATTEMPTS and RETRY_DELAY_SECONDS, and now consumed by build-packages.sh, which copies it into Docker contexts, exports it to the environment, and uses it when invoking docker run.
  • dev-tools/build-packages/base/base-builder.sh loads the helper installed under /usr/local/lib/wazuh/run-with-retry.sh and uses it to wrap plugin installation, while the base Dockerfile exposes this helper to the image.
  • The base-packages-to-base pipeline also copies the helper to /usr/local/lib/wazuh, adjusts the docker-compose.yml context, and adapts all plugin cloning/installation/compilation scripts to invoke run_with_retry on critical git/yarn operations, including clone-plugins.sh.

Issues Resolved

closes #990

Testing the changes

Action: https://github.com/wazuh/wazuh-dashboard/actions/runs/19337918274/job/55320744476 🟢

Changelog

  • skip

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

This commit introduces a retry mechanism for various commands in the package building scripts to enhance resilience against transient failures. A new script, «run-with-retry.sh», is added to encapsulate the retry logic, which is then utilized in multiple scripts including «wazuh-dashboard.sh», «wazuh-dashboard-plugins.sh», and others.

Additionally, the Dockerfile and related scripts are updated to ensure that the retry logic is consistently applied across the package building process, improving the overall reliability of the build system.
Removed hardcoded retry parameters from the scripts and replaced them with environment variables «RETRY_MAX_ATTEMPTS» and «RETRY_DELAY_SECONDS». This change allows for more flexible configuration of retry behavior during package building, enhancing error handling and making the scripts more adaptable to different environments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the temporary error handling in the package building process

2 participants