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

Include package provision for system test docker environment #3966

Merged
merged 12 commits into from
May 24, 2023

Conversation

Rebits
Copy link
Member

@Rebits Rebits commented Feb 16, 2023

Related issue
#3965

Description

Include package support for system tests.

Added

  • Package support for system tests

Testing performed

Environment provision: #3966 (comment)

@Rebits Rebits changed the title feat(#3965): include package support for system tests Include package provision for system test docker environment Feb 16, 2023
@Rebits
Copy link
Member Author

Rebits commented Feb 21, 2023

Testing

agentless_cluster
LAY RECAP **************************************************************************************************************************************************************************************************************************
localhost                  : ok=7    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
wazuh-master               : ok=10   changed=8    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   
wazuh-worker1              : ok=10   changed=9    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   
wazuh-worker2              : ok=10   changed=9    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   
basic_cluster
PLAY RECAP *********************************************************************************************************************************************
localhost                  : ok=13   changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
wazuh-agent1               : ok=10   changed=8    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   
wazuh-agent2               : ok=10   changed=9    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   
wazuh-agent3               : ok=10   changed=9    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   
wazuh-master               : ok=16   changed=9    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   
wazuh-worker1              : ok=12   changed=7    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0   
wazuh-worker2              : ok=12   changed=7    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0   

Tuesday 21 February 2023  17:12:01 +0000 (0:00:07.474)       0:04:41.590 ****** 
=============================================================================== 
roles/agent-role : Installing dependencies using apt ------------------------------------------------------------------------------------------- 16.93s
roles/agent-role : Installing dependencies using apt ------------------------------------------------------------------------------------------- 15.91s
roles/worker-role : Restart Wazuh -------------------------------------------------------------------------------------------------------------- 15.65s
roles/worker-role : Restart Wazuh -------------------------------------------------------------------------------------------------------------- 14.00s
roles/master-role : Start Wazuh ---------------------------------------------------------------------------------------------------------------- 12.97s
roles/master-role : Clone wazuh-qa repository --------------------------------------------------------------------------------------------------
one_manager_agent
PLAY RECAP *********************************************************************************************************************************************
localhost                  : ok=5    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
wazuh-agent1               : ok=9    changed=7    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   
wazuh-manager              : ok=11   changed=4    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   

Rebits added a commit that referenced this pull request Feb 21, 2023
@Rebits Rebits force-pushed the 3965-include-system-package-provision branch from 90e8d62 to bfde2bf Compare February 21, 2023 18:15
@juliamagan juliamagan self-requested a review April 4, 2023 09:21
@juliamagan juliamagan linked an issue Apr 4, 2023 that may be closed by this pull request
Copy link
Member

@juliamagan juliamagan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will the new parameters be set? Can you update the system README with the instructions for provisioning with packages?

@Rebits Rebits force-pushed the 3965-include-system-package-provision branch from b84558f to 7e9b5ed Compare April 4, 2023 14:12
@Rebits
Copy link
Member Author

Rebits commented Apr 4, 2023

To provide a system environment using the built package, it is required to use the package_repository, repository, package_version, package_revision
parameters. For example, to provision a production environment we will use the following command:

ansible-playbook -i inventory.yml playbook.yml --extra-vars='{"package_repository":"packages", "repository": "4.x", "package_version": "4.4.0", "package_revision": "1"}'

Note
This example was included in the system README documentation

The decision to specify the package using those multiple parameters instead of a single one with the full package URL was motivated by the following conditions:

  • System tests currently only support the deb system, so it is not necessary to include architecture or OS information in the path
  • Full package path could be not intuitive
  • It would be necessary to include agent and manager URLs
  • It is consistent with Jenkins pipelines.

Also, it has tested the improvement of speed in environment provision. For this example, it has been used the basic_cluster environment. For this environment, the use of packages for system test provisioning is significantly faster compared to using sources. While the sources take around 23 minutes, the packages take only 9 minutes to complete the provisioning process. Therefore, I recommend shifting to using packages for system test provisioning when possible.

@Rebits
Copy link
Member Author

Rebits commented May 23, 2023

Evidences

Evidences.zip

@damarisg damarisg dismissed juliamagan’s stale review May 24, 2023 12:24

Tests have been found to be stable with this change.

@damarisg damarisg merged commit b20f574 into 4.4 May 24, 2023
@damarisg damarisg deleted the 3965-include-system-package-provision branch May 24, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include package provision for system test docker environment
3 participants