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

scylla_node: ignore scylla-tools config files if scylla-tools is missing #619

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

tchaikov
Copy link
Contributor

this change is created in the same spirit of 3a88640, so that we don't assume the existence of scylla-tools. otherwise we could have following failure:

07:51:05  Traceback (most recent call last):
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/bin/ccm", line 74, in <module>
07:51:05      cmd.run()
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/cmds/cluster_cmds.py", line 269, in run
07:51:05      cluster.populate(self.nodes, self.options.debug, use_vnodes=self.options.vnodes, ipprefix=self.options.ipprefix, ipformat=self.options.ipformat)
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/cluster.py", line 330, in populate
07:51:05      self.new_node(i, debug=debug, initial_token=tk, data_center=dc, rack=rack)
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/cluster.py", line 337, in new_node
07:51:05      node = self.create_node(name=f'node{i}',
07:51:05             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/scylla_cluster.py", line 94, in create_node
07:51:05      return ScyllaNode(name, self, auto_bootstrap, None,
07:51:05             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/scylla_node.py", line 53, in __init__
07:51:05      super().__init__(name, cluster, auto_bootstrap,
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/node.py", line 128, in __init__
07:51:05      self.import_config_files()
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/scylla_node.py", line 979, in import_config_files
07:51:05      self.__copy_logback_files()
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/scylla_node.py", line 1003, in __copy_logback_files
07:51:05      shutil.copy(os.path.join(self.get_tools_java_dir(), 'conf', 'logback-tools.xml'),

Fixes #617
Signed-off-by: Kefu Chai [email protected]

@tchaikov
Copy link
Contributor Author

tchaikov commented Sep 29, 2024

@tchaikov tchaikov force-pushed the node-sans-java-tools branch 2 times, most recently from 410050c to 3482f3d Compare September 29, 2024 12:03
@tchaikov
Copy link
Contributor Author

tchaikov commented Sep 29, 2024

@fruch @syuu1228 @yaronkaikov hii everyone, i'd appreciate a review of this change. There are still failing tests in the Jenkins build . however, I believe this change addresses some aspects of the issue and brings us closer to resolving the failing tests.

@fruch
Copy link
Contributor

fruch commented Sep 29, 2024

@fruch @syuu1228 @yaronkaikov hii everyone, i'd appreciate a review of this change. There are still failing tests in the Jenkins build . however, I believe this change addresses some aspects of the issue and brings us closer to resolving the failing tests.

we are still left with ~500 tests failing with that removal change.
merging this one doesn't really get scylladb/scylla-cluster-tests#8799 and closer to being finalized

@tchaikov
Copy link
Contributor Author

as you put, there are two issues.

but i i don't think the later is a dependency of the fix of #617.

@fruch
Copy link
Contributor

fruch commented Sep 29, 2024

as you put, there are two issues.

but i i don't think the later is a dependency of the fix of #617.

it was a mistake copying the wrong item scylladb/scylladb#20740 is still breaking 500 dtests, so having this in doesn't address all of those.

@tchaikov
Copy link
Contributor Author

fair enough. i explained this change does not address all of them.

@tchaikov tchaikov closed this Sep 29, 2024
@tchaikov tchaikov deleted the node-sans-java-tools branch September 29, 2024 16:00
@fruch
Copy link
Contributor

fruch commented Sep 29, 2024

fair enough. i explained this change does not address all of them.

I don't know if we should give it up, but we are probably gonna have more changes needed for this effort.

@tchaikov
Copy link
Contributor Author

tchaikov commented Sep 30, 2024

fair enough. i explained this change does not address all of them.

I don't know if we should give it up, but we are probably gonna have more changes needed for this effort.

i asked for review , and explained why this change should be included. but failed to get the review or the acknowledgment or any comment regarding the change made in this PR, so that i could improve it. what i have is

having this in doesn't address all of those.

in my opinion, it's was a "NO". and it was not constructive. so i didn't know what else i can do, but to close it.

@fruch
Copy link
Contributor

fruch commented Sep 30, 2024

fair enough. i explained this change does not address all of them.

I don't know if we should give it up, but we are probably gonna have more changes needed for this effort.

i asked for review , and explained why this change should be included. but failed to get the review or the acknowledgment or any comment regarding the change made in this PR, so that i could improve it. what i have is

having this in doesn't address all of those.

in my opinion, it's was a "NO". and it was not constructive. so i didn't know what else i can do, but to close it.

You got a review, and a question about it. not the review you wanted.

My concern is putting in multiple changes that we can't later track for backporting into pushing forward a change that can't be merged.

I.e. that doesn't seem to be the last of it, if there are 500 failing tests.

@tchaikov
Copy link
Contributor Author

tchaikov commented Sep 30, 2024

@fruch what was the question? i am confused. i read all your comments again. but cannot find a question. and if you have concern on tracking multiple changes. how is it related to the change i proposed? i never claim that this change is the last one. but i wanted to limit the scope of a certain change.

@fruch
Copy link
Contributor

fruch commented Sep 30, 2024

@fruch what was the question? i am confused. i read all your comments again. but cannot find a question. and if you have concern on tracking multiple changes. how is it related to the change i proposed? i never claim that this change is the last one. but i wanted to limit the scope of a certain change.

#618

Was to limit the scope as well wasn't it, but was solving all of what it's intended.

If there are changes needed for a PR to come into scylla, I would rather collect all what is required from one repo or other, then have a long long list of small changes.

Regardless, at any point I didn't decline this PR, I was asking questions, even if you didn't find the question marks.

@roydahan
Copy link
Contributor

roydahan commented Oct 6, 2024

It seems like this PR is a step in the correct direction.
Most (or even all) of the failing tests are failing for 3 main tools that are missing:

  • sstableloader
  • sstabledump
  • cqlsh (which shouldn't be taken from scylla-tools anyway).

@fruch
Copy link
Contributor

fruch commented Oct 6, 2024

also look like the cqlsh related tests were missing cause of of using os.path.join with None, and this should fix it:

diff --git a/ccmlib/scylla_node.py b/ccmlib/scylla_node.py
index 96fc5d6..7627c4b 100644
--- a/ccmlib/scylla_node.py
+++ b/ccmlib/scylla_node.py
@@ -153,9 +153,9 @@ class ScyllaNode(Node):
             os.path.join(self.node_install_dir, 'share', 'cassandra', BIN_DIR),
             os.path.join(self.get_cqlsh_dir(), BIN_DIR),
         ]
-        tools_java_dir = os.path.join(self.get_tools_java_dir(), BIN_DIR),
+        tools_java_dir = self.get_tools_java_dir()
         if tools_java_dir:
-            candidate_dirs.append(tools_java_dir)
+            candidate_dirs.append( os.path.join(tools_java_dir, BIN_DIR))
         for candidate_dir in candidate_dirs:
             candidate = shutil.which(toolname, path=candidate_dir)
             if candidate:

@roydahan
Copy link
Contributor

roydahan commented Nov 4, 2024

@tchaikov Can you please resubmit this PR?
I think it's needed.

@tchaikov tchaikov restored the node-sans-java-tools branch November 5, 2024 10:42
@tchaikov tchaikov reopened this Nov 5, 2024
@tchaikov
Copy link
Contributor Author

tchaikov commented Nov 5, 2024

@tchaikov Can you please resubmit this PR? I think it's needed.

@roydahan hi Roy, reopened.

@fruch
Copy link
Contributor

fruch commented Nov 5, 2024

also look like the cqlsh related tests were missing cause of of using os.path.join with None, and this should fix it:

diff --git a/ccmlib/scylla_node.py b/ccmlib/scylla_node.py
index 96fc5d6..7627c4b 100644
--- a/ccmlib/scylla_node.py
+++ b/ccmlib/scylla_node.py
@@ -153,9 +153,9 @@ class ScyllaNode(Node):
             os.path.join(self.node_install_dir, 'share', 'cassandra', BIN_DIR),
             os.path.join(self.get_cqlsh_dir(), BIN_DIR),
         ]
-        tools_java_dir = os.path.join(self.get_tools_java_dir(), BIN_DIR),
+        tools_java_dir = self.get_tools_java_dir()
         if tools_java_dir:
-            candidate_dirs.append(tools_java_dir)
+            candidate_dirs.append( os.path.join(tools_java_dir, BIN_DIR))
         for candidate_dir in candidate_dirs:
             candidate = shutil.which(toolname, path=candidate_dir)
             if candidate:

@tchaikov check this part, I think it's missing for cqlsh related tests to work

this change is created in the same spirit of 3a88640, so that we don't
assume the existence of scylla-tools. otherwise we could have following
failure:

```
07:51:05  Traceback (most recent call last):
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/bin/ccm", line 74, in <module>
07:51:05      cmd.run()
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/cmds/cluster_cmds.py", line 269, in run
07:51:05      cluster.populate(self.nodes, self.options.debug, use_vnodes=self.options.vnodes, ipprefix=self.options.ipprefix, ipformat=self.options.ipformat)
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/cluster.py", line 330, in populate
07:51:05      self.new_node(i, debug=debug, initial_token=tk, data_center=dc, rack=rack)
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/cluster.py", line 337, in new_node
07:51:05      node = self.create_node(name=f'node{i}',
07:51:05             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/scylla_cluster.py", line 94, in create_node
07:51:05      return ScyllaNode(name, self, auto_bootstrap, None,
07:51:05             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/scylla_node.py", line 53, in __init__
07:51:05      super().__init__(name, cluster, auto_bootstrap,
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/node.py", line 128, in __init__
07:51:05      self.import_config_files()
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/scylla_node.py", line 979, in import_config_files
07:51:05      self.__copy_logback_files()
07:51:05    File "/jenkins/workspace/scylla-master/gating-dtest-release/scylla/.local/lib/python3.12/site-packages/ccmlib/scylla_node.py", line 1003, in __copy_logback_files
07:51:05      shutil.copy(os.path.join(self.get_tools_java_dir(), 'conf', 'logback-tools.xml'),
```

Fixes scylladb#617
Signed-off-by: Kefu Chai <[email protected]>
@tchaikov tchaikov force-pushed the node-sans-java-tools branch from 3482f3d to 0ef455c Compare November 6, 2024 00:40
@tchaikov
Copy link
Contributor Author

tchaikov commented Nov 6, 2024

tools_java_dir = self.get_tools_java_dir()

incorporated.

@fruch
Copy link
Contributor

fruch commented Nov 6, 2024

@syuu1228 want to take it for a ride with you PR ?

@fruch fruch requested a review from denesb November 6, 2024 10:50
Copy link
Contributor

@fruch fruch left a comment

Choose a reason for hiding this comment

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

LGTM

and passed the gating dtests

@fruch fruch merged commit 202ac92 into scylladb:next Nov 6, 2024
4 checks passed
denesb added a commit to denesb/scylla-ccm that referenced this pull request Nov 6, 2024
This is a follow-up to scylladb#619.
Patch scylla_node.py so every access to java tools dir is conditional on
the dir existing in the first place. With this PR, tests are passing
with the java tools dropped form the unified package
(scylladb/scylladb#20740).

Refs: scylladb/scylladb#14856
@tchaikov tchaikov deleted the node-sans-java-tools branch November 7, 2024 00:57
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.

ccmlib should work when scylla-tools not installed
3 participants