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

improvement(artifacts): switch to syslog-ng logs transport #9924

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dimakr
Copy link
Contributor

@dimakr dimakr commented Jan 27, 2025

Switch artifacts tests from ssh to syslog-ng logs transport.

For most of the artifacts test cases simply changing logs transport from ssh to syslog-ng is enough.
But there are also few scenarios where additional adjustments were needed:

  • AWS backend: the SCT-sg-2 security group is added to the aws-sct-builders launch templates. This change allows syslog-ng communication to pass firewall and send logs
    from DB nodes to builder instances.
  • nonroot installation of scylla on CentOS/Rocky: syslog-ng configuration is adjusted to read scylla-server logs from file. Also SELinux policies are adjusted to allow
    nonroot syslog-ng process to send logs to remote log destination.
  • scylla installation with no-selinux-setup option: SELinux policy is added to allow syslog-ng to use the port of the remote log destination.

For artifacts-amazon2023-* configurations the ssh logs transport is still to be used due to amazonlinux/amazon-linux-2023#639.

Closes: https://github.com/scylladb/qa-tasks/issues/1848
Closes: #8532
Fixes: #9925

Testing

AWS jenkins builders were updated after this change in sdcm/utils/aws_builder.py (i.e. additional SG is used in launch template):

❯ ./sct.py configure-jenkins-builders -c aws -r us-east-1
logged in as arn:aws:sts::797456418907:assumed-role/DeveloperAccessRole/[email protected]
New directory created: /home/dmitriy/sct-results/20250127-223926-992009-configure-jenkins-builders
eu-west-1: create_launch_template
eu-west-1: checking if template needs update
eu-west-1: updating template
eu-west-1: create_auto_scaling_group
eu-west-1: add_scaling_group_to_jenkins
us-east-1: create_launch_template
us-east-1: checking if template needs update
us-east-1: updating template
us-east-1: create_auto_scaling_group
us-east-1: add_scaling_group_to_jenkins

Some artifacts tests on AWS backend:

Some artifacts tests on GCE backend:

Azure backend artifacts test:

Nonroot/selinux installation tests:

PR pre-checks (self review)

  • I added the relevant backport labels
  • I didn't leave commented-out/debugging code

Reminders

  • Add New configuration option and document them (in sdcm/sct_config.py)
  • Add unit tests to cover my changes (under unit-test/ folder)
  • Update the Readme/doc folder relevant to this change (if needed)

@dimakr dimakr added the backport/none Backport is not required label Jan 27, 2025
@dimakr dimakr requested review from fruch and roydahan January 27, 2025 22:36
@dimakr dimakr marked this pull request as ready for review January 27, 2025 23:11
fruch
fruch previously approved these changes Jan 28, 2025
@fruch
Copy link
Contributor

fruch commented Jan 28, 2025

@dimakr

lets test all of the affected artifact tests in the PR (since in previous PR, we missed a few)

@dimakr
Copy link
Contributor Author

dimakr commented Jan 28, 2025

@dimakr

lets test all of the affected artifact tests in the PR (since in previous PR, we missed a few)

Yes , i see that problem popped up for nonroot user cases.
And only on GCE, the AWS based nonroot user artifacts tests are OK..

@fruch
Copy link
Contributor

fruch commented Jan 28, 2025

@dimakr
lets test all of the affected artifact tests in the PR (since in previous PR, we missed a few)

Yes , i see that problem popped up for nonroot user cases. And only on GCE, the AWS based nonroot user artifacts tests are OK..

my guess, maybe we pass down the user-data for cloud-init a bit differently, if scylla is preinstalled or not

@dimakr
Copy link
Contributor Author

dimakr commented Jan 28, 2025

my guess, maybe we pass down the user-data for cloud-init a bit differently, if scylla is preinstalled or not

@fruch
Apparently the root cause is likely scylladb/scylladb#7131.
In the core the fix scylladb/scylladb#7326 introduced a workaround, for environments where writing to journal cannot be done under nonroot installation (e.g. on CentOS). So they introduced writing logs to a file.

For ssh logs transport we have some logic for this case, but not for syslog-ng:

return SSHNonRootScyllaSystemdLogger(node, target_log_file)

@dimakr dimakr marked this pull request as draft January 29, 2025 00:00
@dimakr dimakr force-pushed the use_sct_sg_for_aws_builders branch 2 times, most recently from 49a3579 to 0a2c17d Compare January 31, 2025 18:53
@dimakr dimakr changed the title fix(aws-builder): use SCT-sg-2 secgroup for SCT builders on AWS backend improvement(artifacts): switch to syslog-ng logs transport Jan 31, 2025
@dimakr dimakr force-pushed the use_sct_sg_for_aws_builders branch 4 times, most recently from e38417c to d66db5e Compare February 2, 2025 12:05
Switch artifacts tests from ssh to syslog-ng logs transport.
@dimakr dimakr force-pushed the use_sct_sg_for_aws_builders branch from d66db5e to b2a4f6f Compare February 2, 2025 15:31
@dimakr dimakr marked this pull request as ready for review February 2, 2025 18:33
@dimakr dimakr requested a review from fruch February 3, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/none Backport is not required
Projects
None yet
2 participants