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

In the middle of sct test on docker backend sct asks for sudo password #9028

Open
asias opened this issue Oct 23, 2024 · 3 comments · May be fixed by #9331
Open

In the middle of sct test on docker backend sct asks for sudo password #9028

asias opened this issue Oct 23, 2024 · 3 comments · May be fixed by #9331
Assignees

Comments

@asias
Copy link
Contributor

asias commented Oct 23, 2024

It is under docker images. The sudo password should not be needed.

$ export SCT_SCYLLA_VERSION=6.1.2
$ export SCT_ENABLE_ARGUS=False

$ hydra run-test performance_regression_test.PerformanceRegressionTest.test_latency_write_with_nemesis --backend docker --config test-cases/performance/perf-regression-latency-650gb-with-nemesis.yaml  --config configurations/tablets_disabled.yaml --config configurations/disable_kms.yaml

< t:2024-10-23 06:33:25,998 f:cluster.py      l:2203 c:sdcm.cluster         p:INFO  > Node perf-latency-nemesis-asias-db-node-fbe408ba-0 [172.18.0.2 | 172.18.0.2]: Found ScyllaDB version: 6.1.2
< t:2024-10-23 06:34:27,865 f:cluster.py      l:1998 c:sdcm.cluster_docker  p:INFO  > Node perf-latency-nemesis-asias-monitor-node-fbe408ba-0 [127.0.0.1 | 127.0.0.1]: Installing Scylla...

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.
@asias asias removed their assignment Oct 24, 2024
@asias
Copy link
Contributor Author

asias commented Nov 21, 2024

I think it is related to monitor. Monitor is not supported in the docker backend. It tries to do something on host that is the reason it asks for password. After I disable monitor, no password is asked for.

@dimakr
Copy link
Contributor

dimakr commented Nov 21, 2024

Seems like the test here was trying to perform the action - scylla-manager server installation - that is not yet supported on the docker backend. Raised an issue / feature request for that - #9323.
For now we disable scylla-manager usage when running tests on docker backend, by adding use_mgmt: false to a test config, or setting SCT_USE_MGMT=false env var.

But this still don't justify the original problem of asking password when executing command with sudo. For instance in my system, even when running the test without manager disabled, I'm failing on a code

        if self.is_docker():
            self.remoter.sudo(
                "yum remove -y scylla scylla-jmx scylla-tools scylla-tools-core scylla-server scylla-conf")

with the error:

< t:2024-11-21 11:39:24,751 f:tester.py       l:196  c:sdcm.tester          p:ERROR > Command: 'sudo yum remove -y scylla scylla-jmx scylla-tools scylla-tools-core scylla-server scylla-conf'                      │
...
< t:2024-11-21 11:39:24,751 f:tester.py       l:196  c:sdcm.tester          p:ERROR > Stderr:                                                                                                                       │
< t:2024-11-21 11:39:24,751 f:tester.py       l:196  c:sdcm.tester          p:ERROR >                                                                                                                               │
< t:2024-11-21 11:39:24,751 f:tester.py       l:196  c:sdcm.tester          p:ERROR > sudo: yum: command not found 

I.e. it was ok with the sudo..

@dimakr
Copy link
Contributor

dimakr commented Nov 21, 2024

But this still don't justify the original problem of asking password when executing command with sudo. For instance in my system, even when running the test without manager disabled, I'm failing on a code

        if self.is_docker():
            self.remoter.sudo(
                "yum remove -y scylla scylla-jmx scylla-tools scylla-tools-core scylla-server scylla-conf")

So the reason of asking sudo password in the place above is simply due to the fact that self.remoter is the host machine here (as for docker backend the monitoring stack is installed into host machine, not on a dedicated docker instance).

self
Out[2]: <sdcm.cluster_docker.DockerMonitoringNode at 0x7f42b9759600>
self.remoter
Out[3]: <sdcm.remote.local_cmd_runner.LocalCmdRunner at 0x7f42c9cd6d40>
...
self.remoter.run('hostname').stdout
Out[6]: 'dmitriy-d3581\n'

So depending on whether passwordless sudo is configured on a dev machine or not, the password can be asked or not.
We probably need to add a check, so that we fail fast if docker backend is used and use_mgmt/SCT_USE_MGMT config parameter is not set to false.

dimakr added a commit to dimakr/scylla-cluster-tests that referenced this issue Nov 21, 2024
If scylla-manager is not disabled in a test config when running a test on docker
backend, the test will try to install the manager and eventually fail (this is
due to the fact that SCT installs scylla-manager server on monitor node and docker
backend doesn't support dedicated monitoring node docker instance).

The change adds a check for this situation, to be able to fail fast and
do not continue with manager installation od docker backend.

Closes: scylladb#9028
@dimakr dimakr linked a pull request Nov 21, 2024 that will close this issue
4 tasks
dimakr added a commit to dimakr/scylla-cluster-tests that referenced this issue Nov 22, 2024
If scylla-manager is not disabled in a test config when running a test on docker
backend, the test will try to install the manager and eventually fail (this is
due to the fact that SCT installs scylla-manager server on monitor node and docker
backend doesn't support dedicated monitoring node docker instance).

The change adds a check for this situation, to be able to fail fast and
do not continue uch a test configuration on docker backend.

Closes: scylladb#9028
dimakr added a commit to dimakr/scylla-cluster-tests that referenced this issue Nov 22, 2024
If scylla-manager is not disabled in a test config when running a test on docker
backend, the test will try to install the manager and eventually fail (this is
due to the fact that SCT installs scylla-manager server on monitor node and docker
backend doesn't support dedicated monitoring node docker instance).

The change adds a check for this situation, to be able to fail fast and
do not continue uch a test configuration on docker backend.

Closes: scylladb#9028
dimakr added a commit to dimakr/scylla-cluster-tests that referenced this issue Nov 22, 2024
If scylla-manager is not disabled in a test config when running a test on docker
backend, the test will try to install the manager and eventually fail (this is
due to the fact that SCT installs scylla-manager server on monitor node and docker
backend doesn't support dedicated monitoring node docker instance).

The change adds a check for this situation, to be able to fail fast and
do not continue uch a test configuration on docker backend.

Closes: scylladb#9028
dimakr added a commit to dimakr/scylla-cluster-tests that referenced this issue Nov 22, 2024
If scylla-manager is not disabled in a test config when running a test on docker
backend, the test will try to install the manager and eventually fail (this is
due to the fact that SCT installs scylla-manager server on monitor node and docker
backend doesn't support dedicated monitoring node docker instance).

The change adds a check for this situation, to be able to fail fast and
do not continue uch a test configuration on docker backend.

Closes: scylladb#9028
dimakr added a commit to dimakr/scylla-cluster-tests that referenced this issue Nov 22, 2024
If scylla-manager is not disabled in a test config when running a test on docker
backend, the test will try to install the manager and eventually fail (this is
due to the fact that SCT installs scylla-manager server on monitor node and docker
backend doesn't support dedicated monitoring node docker instance).

The change adds a check for this situation, to be able to fail fast and
do not continue uch a test configuration on docker backend.

Closes: scylladb#9028
dimakr added a commit to dimakr/scylla-cluster-tests that referenced this issue Nov 23, 2024
If scylla-manager is not disabled in a test config when running a test on docker
backend, the test will try to install the manager and eventually fail (this is
due to the fact that SCT installs scylla-manager server on monitor node and docker
backend doesn't support dedicated monitoring node docker instance).

The change adds a check for this situation, to be able to fail fast and
do not continue uch a test configuration on docker backend.

Closes: scylladb#9028
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 a pull request may close this issue.

2 participants