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

Add Docker development environments #27102

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

GGP1
Copy link
Member

@GGP1 GGP1 commented Nov 28, 2024

Related issue
Closes #26820

Description

Adds the Docker 5.0.0 and 4.x development environments

Tests

5.0.0

Manager logs
root@wazuh-manager:/# cat /var/log/wazuh-server/cluster.log 
2024/11/29 08:56:39 DEBUG: [Cluster] [Main] Removing '/run/wazuh-server/cluster/'.
2024/11/29 08:56:39 DEBUG: [Cluster] [Main] Removed '/run/wazuh-server/cluster/'.
2024/11/29 08:56:39 INFO: [Cluster] [Main] Generating JWT signing key pair
2024/11/29 08:56:40 INFO: [Local Server] [Main] Starting wazuh-engined
2024/11/29 08:56:42 INFO: [Local Server] [Main] Started wazuh-engined (pid: 23)
2024/11/29 08:56:42 INFO: [Local Server] [Main] Starting wazuh-comms-apid
2024/11/29 08:56:46 INFO: [Local Server] [Main] Started wazuh-comms-apid (pid: 473)
2024/11/29 08:56:46 INFO: [Local Server] [Main] Starting wazuh-apid
2024/11/29 08:56:49 INFO: [Local Server] [Main] Started wazuh-apid (pid: 535)
2024/11/29 08:56:50 INFO: [Local Server] [Main] Serving on /run/wazuh-server/socket/local-server.sock
2024/11/29 08:56:50 DEBUG: [Local Server] [Keep alive] Calculating.
2024/11/29 08:56:50 DEBUG: [Local Server] [Keep alive] Calculated.
2024/11/29 08:56:50 INFO: [Master] [Main] Serving on ('0.0.0.0', 1516)
2024/11/29 08:56:50 DEBUG: [Master] [Keep alive] Calculating.
2024/11/29 08:56:50 DEBUG: [Master] [Keep alive] Calculated.
2024/11/29 08:56:50 INFO: [Master] [Local integrity] Starting.
2024/11/29 08:56:50 INFO: [Worker] [Main] Connection from ('172.18.0.5', 42798)
2024/11/29 08:56:50 DEBUG: [Worker] [Main] Command received: b'hello'
2024/11/29 08:56:50 INFO: [Worker] [Main] Connection from ('172.18.0.3', 56094)
2024/11/29 08:56:50 DEBUG: [Worker] [Main] Command received: b'hello'
2024/11/29 08:56:51 INFO: [Master] [Local integrity] Finished in 0.411s. Calculated metadata of 2 files.
2024/11/29 08:56:59 INFO: [Master] [Local integrity] Starting.
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Main] Command received: b'syn_i_w_m_p'
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Main] Command received: b'syn_i_w_m_p'
2024/11/29 08:56:59 INFO: [Master] [Local integrity] Finished in 0.636s. Calculated metadata of 2 files.
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Main] Command received: b'syn_i_w_m'
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Main] Command received: b'syn_i_w_m'
2024/11/29 08:56:59 INFO: [Worker worker2] [Integrity check] Starting.
2024/11/29 08:56:59 INFO: [Worker worker1] [Integrity check] Starting.
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Main] Command received: b'new_file'
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Main] Command received: b'new_file'
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Main] Command received: b'file_upd'
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Main] Command received: b'file_upd'
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Main] Command received: b'file_end'
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Main] Command received: b'file_end'
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Main] Command received: b'syn_i_w_m_e'
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Main] Command received: b'syn_i_w_m_e'
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Integrity check] Received file from worker: '/run/wazuh-server/cluster/worker2/worker2-1732888619.867688-b2e130ae98c946748dd6fedcafcbcf7d.zip'
2024/11/29 08:56:59 INFO: [Worker worker2] [Integrity check] Finished in 0.003s. Received metadata of 0 files. Sync required.
2024/11/29 08:56:59 INFO: [Worker worker2] [Integrity sync] Starting.
2024/11/29 08:56:59 INFO: [Worker worker2] [Integrity sync] Files to create in worker: 2 | Files to update in worker: 0 | Files to delete in worker: 0
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Integrity sync] Compressing files and 'files_metadata.json' of 2 files.
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Integrity check] Received file from worker: '/run/wazuh-server/cluster/worker1/worker1-1732888619.867545-5e5579bb6ff241cc8b0f56c6ce6e6968.zip'
2024/11/29 08:56:59 INFO: [Worker worker1] [Integrity check] Finished in 0.004s. Received metadata of 0 files. Sync required.
2024/11/29 08:56:59 INFO: [Worker worker1] [Integrity sync] Starting.
2024/11/29 08:56:59 INFO: [Worker worker1] [Integrity sync] Files to create in worker: 2 | Files to update in worker: 0 | Files to delete in worker: 0
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Integrity sync] Compressing files and 'files_metadata.json' of 2 files.
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Integrity sync] Sending zip file.
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Integrity sync] Sending zip file.
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Integrity sync] Zip file sent.
2024/11/29 08:56:59 INFO: [Worker worker2] [Integrity sync] Finished in 0.039s.
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Integrity sync] Zip file sent.
2024/11/29 08:56:59 INFO: [Worker worker1] [Integrity sync] Finished in 0.039s.
Worker1 logs
gasti@gasti:~/work/wazuh/apis/tools/env/5.0$ docker logs wazuh-worker1
2024/11/29 08:56:40 DEBUG: [Cluster] [Main] Removing '/run/wazuh-server/cluster/'.
2024/11/29 08:56:40 DEBUG: [Cluster] [Main] Removed '/run/wazuh-server/cluster/'.
2024/11/29 08:56:40 INFO: [Local Server] [Main] Starting wazuh-engined
2024/11/29 08:56:42 INFO: [Local Server] [Main] Started wazuh-engined (pid: 23)
2024/11/29 08:56:42 INFO: [Local Server] [Main] Starting wazuh-comms-apid
2024/11/29 08:56:46 INFO: [Local Server] [Main] Started wazuh-comms-apid (pid: 456)
2024/11/29 08:56:46 INFO: [Local Server] [Main] Starting wazuh-apid
2024/11/29 08:56:49 INFO: [Local Server] [Main] Started wazuh-apid (pid: 518)
2024/11/29 08:56:50 INFO: [Local Server] [Main] Serving on /run/wazuh-server/socket/local-server.sock
2024/11/29 08:56:50 DEBUG: [Local Server] [Keep alive] Calculating.
2024/11/29 08:56:50 DEBUG: [Local Server] [Keep alive] Calculated.
2024/11/29 08:56:50 INFO: [Worker worker1] [Main] Successfully connected to master.
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Integrity check] Permission to synchronize granted.
2024/11/29 08:56:59 INFO: [Worker worker1] [Integrity check] Starting.
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Integrity check] Compressing 'files_metadata.json' of 0 files.
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Integrity check] Sending zip file.
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Integrity check] Zip file sent.
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Main] Command received: 'b'syn_m_c''
2024/11/29 08:56:59 INFO: [Worker worker1] [Integrity check] Finished in 0.051s. Sync required.
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Main] Command received: 'b'new_file''
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Main] Command received: 'b'file_upd''
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Main] Command received: 'b'file_end''
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Main] Command received: 'b'syn_m_c_e''
2024/11/29 08:56:59 INFO: [Worker worker1] [Integrity sync] Starting.
2024/11/29 08:56:59 INFO: [Worker worker1] [Integrity sync] Files to create: 2 | Files to update: 0 | Files to delete: 0
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Integrity sync] Worker does not meet integrity checks. Actions required.
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Integrity sync] Updating local files: Start.
2024/11/29 08:56:59 TRACE: [Worker worker1] [Integrity sync] {'./private_key.pem': ['Processing file ./private_key.pem'], './public_key.pem': ['Processing file ./public_key.pem']}
2024/11/29 08:56:59 DEBUG: [Worker worker1] [Integrity sync] Updating local files: End.
Worker2 logs
gasti@gasti:~/work/wazuh/apis/tools/env/5.0$ docker logs wazuh-worker2
2024/11/29 08:56:40 DEBUG: [Cluster] [Main] Removing '/run/wazuh-server/cluster/'.
2024/11/29 08:56:40 DEBUG: [Cluster] [Main] Removed '/run/wazuh-server/cluster/'.
2024/11/29 08:56:40 INFO: [Local Server] [Main] Starting wazuh-engined
2024/11/29 08:56:42 INFO: [Local Server] [Main] Started wazuh-engined (pid: 23)
2024/11/29 08:56:42 INFO: [Local Server] [Main] Starting wazuh-comms-apid
2024/11/29 08:56:46 INFO: [Local Server] [Main] Started wazuh-comms-apid (pid: 456)
2024/11/29 08:56:46 INFO: [Local Server] [Main] Starting wazuh-apid
2024/11/29 08:56:49 INFO: [Local Server] [Main] Started wazuh-apid (pid: 518)
2024/11/29 08:56:50 INFO: [Local Server] [Main] Serving on /run/wazuh-server/socket/local-server.sock
2024/11/29 08:56:50 DEBUG: [Local Server] [Keep alive] Calculating.
2024/11/29 08:56:50 DEBUG: [Local Server] [Keep alive] Calculated.
2024/11/29 08:56:50 INFO: [Worker worker2] [Main] Successfully connected to master.
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Integrity check] Permission to synchronize granted.
2024/11/29 08:56:59 INFO: [Worker worker2] [Integrity check] Starting.
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Integrity check] Compressing 'files_metadata.json' of 0 files.
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Integrity check] Sending zip file.
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Integrity check] Zip file sent.
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Main] Command received: 'b'syn_m_c''
2024/11/29 08:56:59 INFO: [Worker worker2] [Integrity check] Finished in 0.044s. Sync required.
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Main] Command received: 'b'new_file''
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Main] Command received: 'b'file_upd''
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Main] Command received: 'b'file_end''
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Main] Command received: 'b'syn_m_c_e''
2024/11/29 08:56:59 INFO: [Worker worker2] [Integrity sync] Starting.
2024/11/29 08:56:59 INFO: [Worker worker2] [Integrity sync] Files to create: 2 | Files to update: 0 | Files to delete: 0
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Integrity sync] Worker does not meet integrity checks. Actions required.
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Integrity sync] Updating local files: Start.
2024/11/29 08:56:59 TRACE: [Worker worker2] [Integrity sync] {'./private_key.pem': ['Processing file ./private_key.pem'], './public_key.pem': ['Processing file ./public_key.pem']}
2024/11/29 08:56:59 DEBUG: [Worker worker2] [Integrity sync] Updating local files: End.
docker images
gasti@gasti:~/work/wazuh/apis/tools/env/5.0$ docker images
REPOSITORY             TAG       IMAGE ID       CREATED          SIZE
dev-nginx-lb           latest    12d2b12ecba6   6 minutes ago    192MB
dev-wazuh-manager      latest    0c1c5439e7ef   6 minutes ago    2.3GB
wazuh-server-builder   latest    0757a247661c   6 minutes ago    2.26GB
dev-wazuh-indexer      latest    0572af5c2cb0   25 minutes ago   1.36GB
docker ps -a
gasti@gasti:~/work/wazuh/apis/tools/env/5.0$ docker ps -a
CONTAINER ID   IMAGE                  COMMAND                  CREATED         STATUS                       PORTS                                                                                                      NAMES
05ef07449324   dev-nginx-lb           "/scripts/entrypoint…"   4 minutes ago   Up 3 minutes                 80/tcp                                                                                                     nginx-lb
5073fed10104   dev-wazuh-manager      "/scripts/entrypoint…"   4 minutes ago   Up 3 minutes (healthy)       22/tcp, 0.0.0.0:27002->27000/tcp, [::]:27002->27000/tcp, 0.0.0.0:55002->55000/tcp, [::]:55002->55000/tcp   wazuh-worker2
32379231c009   dev-wazuh-manager      "/scripts/entrypoint…"   4 minutes ago   Up 3 minutes (healthy)       22/tcp, 0.0.0.0:27001->27000/tcp, [::]:27001->27000/tcp, 0.0.0.0:55001->55000/tcp, [::]:55001->55000/tcp   wazuh-worker1
61ba9bab3acd   dev-wazuh-manager      "/scripts/entrypoint…"   4 minutes ago   Up 3 minutes (healthy)       0.0.0.0:27000->27000/tcp, :::27000->27000/tcp, 22/tcp, 0.0.0.0:55000->55000/tcp, :::55000->55000/tcp       wazuh-manager
e559795d44b5   dev-wazuh-indexer      "./opensearch-docker…"   4 minutes ago   Up 3 minutes                 9300/tcp, 9600/tcp, 0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 9650/tcp                                    wazuh-indexer
8fbfab34ee92   wazuh-server-builder   "/usr/bin/EntryPoint…"   4 minutes ago   Exited (127) 3 minutes ago                                                                                                              wazuh-server-builder

@GGP1 GGP1 self-assigned this Nov 28, 2024
Copy link

Coverage reports

The coverage report can be downloaded from here

@wazuh wazuh deleted a comment from github-actions bot Nov 29, 2024
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 the PyServer 5.0 development environment
1 participant