This is an automated email from the ASF dual-hosted git repository.
ivandasch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new a86e0c867b4 IGNITE-23196 [ducktests] Change JVM options to JDK11 ones
(#11536)
a86e0c867b4 is described below
commit a86e0c867b461ed0e6f94416703b9e0ff55b0f49
Author: okreda1 <[email protected]>
AuthorDate: Mon Sep 23 22:05:30 2024 +0300
IGNITE-23196 [ducktests] Change JVM options to JDK11 ones (#11536)
---
modules/ducktests/README.md | 92 ++++++++++++++++++++--
.../tests/checks/utils/check_ignite_spec.py | 22 +++---
.../tests/ignitetest/services/utils/ignite_spec.py | 10 ++-
.../tests/ignitetest/services/utils/jvm_utils.py | 2 +-
.../tests/ignitetest/utils/ignite_test.py | 1 +
5 files changed, 108 insertions(+), 19 deletions(-)
diff --git a/modules/ducktests/README.md b/modules/ducktests/README.md
index 028b4e06e64..96c7708e69b 100644
--- a/modules/ducktests/README.md
+++ b/modules/ducktests/README.md
@@ -3,7 +3,7 @@ The `ignitetest` framework provides basic functionality and
services
to write integration tests for Apache Ignite. This framework bases on
the `ducktape` test framework, for information about it check the links:
- https://github.com/confluentinc/ducktape - source code of the `ducktape`.
-- http://ducktape-docs.readthedocs.io - documentation to the `ducktape`.
+- https://ducktape.readthedocs.io/en/latest/index.html - documentation to the
`ducktape`.
Structure of the `tests` directory is:
- `./ignitetest/services` contains basic services functionality.
@@ -77,11 +77,11 @@ You may set versions (products) using `@ignite_versions`
decorator at code
```
or passing versions set via globals during the execution
```
---globals-json, eg: {"ignite_versions":["2.8.1", "dev"]}
+--global-json, eg: {"ignite_versions":["2.8.1", "dev"]}
```
You may also specify product prefix by `project` param at globals, for example:
```
---globals-json, eg: {"project": "fork" ,"ignite_versions": ["ignite-2.8.1",
"2.8.1", "dev"]}
+--global-json, eg: {"project": "fork" ,"ignite_versions": ["ignite-2.8.1",
"2.8.1", "dev"]}
```
will execute tests on `ignite-2.8.1, fork-2.8.1, fork-dev`
@@ -89,12 +89,94 @@ will execute tests on `ignite-2.8.1, fork-2.8.1, fork-dev`
TBD
# Special runs
+## Run with FlightRecorder (JFR)
+To run ignite with flight recorder you should enable `jfr_enabled` through
globals, for example:
+```
+--global-json, eg: {"jfr_enabled":true}
+```
+## Run with safepoints logging
+Safepoint logging is disabled by default, to enable it, you need to pass
`true` for `safepoint_log_enabled` for example:
+```
+--global-json, eg: {"safepoint_log_enabled":true}
+```
## Run with enabled security
### Run with SSL enabled
-TBD
+To enable ssl it is only required to pass `enabled` for `ssl` in globals:
+```
+--global-json, eg: {"ssl":{"enabled":true}}
+```
+In this case, all ssl params will be set to default values, and will be
written to ignite config.
+These values correspond to the keystores that are generated (and you shouldn't
worry about it).
+Default keystores for these services are generated automatically on creating
environment.
+
+If you want, you could override these values through globals, for example:
+```
+ {"ssl": {
+ "enabled": true,
+ "params": {
+ "server": {
+ "key_store_jks": "server.jks",
+ "key_store_password": "123456",
+ "trust_store_jks": "truststore.jks",
+ "trust_store_password": "123456"
+ },
+ "client": {
+ "key_store_jks": "client.jks",
+ "key_store_password": "123456",
+ "trust_store_jks": "truststore.jks",
+ "trust_store_password": "123456"
+ },
+ "admin": {
+ "key_store_jks": "admin.jks",
+ "key_store_password": "123456",
+ "trust_store_jks": "truststore.jks",
+ "trust_store_password": "123456"
+ }
+ }
+ }
+ }
+```
+Where:
+
+Server, client and admin are three possible interactions with a cluster in a
ducktape, each of them has its own alias,
+which corresponds to keystore:
+* Ignite(clientMode = False) - server
+* Ignite(clientMode = True) - client
+* ControlUtility - admin
+
+And options `key_store_jks` and `trust_store_jks` are paths to keys.
+If you start it with `/` it will be used as an absolute path.
+Otherwise, it will be a relative path that starts from `/mnt/service/shared/`.
+
+And if you need to specify values only for one configuration, you can skip
other configurations, for example:
+
+```
+ {"ssl": {
+ "enabled": true,
+ "params": {
+ "server": {
+ "key_store_jks": "server.jks",
+ "key_store_password": "123456",
+ "trust_store_jks": "truststore.jks",
+ "trust_store_password": "123456"
+ }
+ }
+ }
+ }
+```
+
+For more information about ssl in ignite you can check this link: [SSL in
ignite](https://ignite.apache.org/docs/latest/security/ssl-tls)
### Run with build-in authentication enabled
-TBD
+Via this option you could overwrite default login and password options in
tests with authentication.
+```
+ {"authentication":{
+ "enabled": true,
+ "username": "username",
+ "password": "password"
+ }
+ }
+```
## Run with metrics export enabled
diff --git a/modules/ducktests/tests/checks/utils/check_ignite_spec.py
b/modules/ducktests/tests/checks/utils/check_ignite_spec.py
index 0dd8cb4515f..a3c8e521049 100644
--- a/modules/ducktests/tests/checks/utils/check_ignite_spec.py
+++ b/modules/ducktests/tests/checks/utils/check_ignite_spec.py
@@ -81,17 +81,19 @@ def
check_default_jvm_options__are_not_used__if_merge_with_default_is_false(serv
def
check_boolean_options__go_after_default_ones_and_overwrite_them__if_passed_via_jvm_opt(service):
service.context.globals[JFR_ENABLED] = True
- spec = IgniteApplicationSpec(service,
jvm_opts="-XX:-UnlockCommercialFeatures")
- assert "-XX:-UnlockCommercialFeatures" in spec.jvm_opts
- assert "-XX:-UnlockCommercialFeatures" in spec.jvm_opts
- assert spec.jvm_opts.index("-XX:-UnlockCommercialFeatures") >\
- spec.jvm_opts.index("-XX:+UnlockCommercialFeatures")
+ spec = IgniteApplicationSpec(service, jvm_opts="-XX:-FlightRecorder")
+ assert "-XX:-FlightRecorder" in spec.jvm_opts
+ assert "-XX:+FlightRecorder" in spec.jvm_opts
+ assert spec.jvm_opts.index("-XX:-FlightRecorder") >\
+ spec.jvm_opts.index("-XX:+FlightRecorder")
def
check_colon_options__go_after_default_ones_and_overwrite_them__if_passed_via_jvm_opt(service):
service.log_dir = "/default-path"
- spec = IgniteApplicationSpec(service,
jvm_opts=["-Xloggc:/some-non-default-path/gc.log"])
- assert "-Xloggc:/some-non-default-path/gc.log" in spec.jvm_opts
- assert "-Xloggc:/default-path/gc.log" in spec.jvm_opts
- assert spec.jvm_opts.index("-Xloggc:/some-non-default-path/gc.log") > \
- spec.jvm_opts.index("-Xloggc:/default-path/gc.log")
+ spec = IgniteApplicationSpec(service,
jvm_opts=["-Xlog:gc:/some-non-default-path/gc.log"])
+ assert "-Xlog:gc:/some-non-default-path/gc.log" in spec.jvm_opts
+ assert
"-Xlog:gc*=debug,gc+stats*=debug,gc+ergo*=debug:/default-path/gc.log:uptime,time,level,tags"
\
+ in spec.jvm_opts
+ assert spec.jvm_opts.index("-Xlog:gc:/some-non-default-path/gc.log") > \
+ spec.jvm_opts.index(
+
"-Xlog:gc*=debug,gc+stats*=debug,gc+ergo*=debug:/default-path/gc.log:uptime,time,level,tags")
diff --git a/modules/ducktests/tests/ignitetest/services/utils/ignite_spec.py
b/modules/ducktests/tests/ignitetest/services/utils/ignite_spec.py
index 7cb60371a04..70bacf587e1 100644
--- a/modules/ducktests/tests/ignitetest/services/utils/ignite_spec.py
+++ b/modules/ducktests/tests/ignitetest/services/utils/ignite_spec.py
@@ -36,7 +36,7 @@ from ignitetest.services.utils.ssl.ssl_params import
is_ssl_enabled
from ignitetest.services.utils.metrics.metrics import
is_opencensus_metrics_enabled, configure_opencensus_metrics,\
is_jmx_metrics_enabled, configure_jmx_metrics
from ignitetest.services.utils.jmx_remote.jmx_remote_params import
get_jmx_remote_params
-from ignitetest.utils.ignite_test import JFR_ENABLED
+from ignitetest.utils.ignite_test import JFR_ENABLED, SAFEPOINT_LOGS_ENABLED
from ignitetest.utils.version import DEV_BRANCH
SHARED_PREPARED_FILE = ".ignite_prepared"
@@ -102,6 +102,11 @@ class IgniteSpec(metaclass=ABCMeta):
oom_path=os.path.join(self.service.log_dir, "out_of_mem.hprof"),
vm_error_path=os.path.join(self.service.log_dir, "hs_err_pid%p.log"))
+ if self.service.context.globals.get(SAFEPOINT_LOGS_ENABLED, False):
+ default_jvm_opts = merge_jvm_settings(
+ default_jvm_opts, ["-Xlog:safepoint*=debug:file=" +
os.path.join(self.service.log_dir, "safepoint.log")
+ + ":time,uptime,level,tags"])
+
default_jvm_opts = merge_jvm_settings(
default_jvm_opts, ["-DIGNITE_SUCCESS_FILE=" +
os.path.join(self.service.persistent_root, "success_file"),
"-Dlog4j.configDebug=true"])
@@ -112,8 +117,7 @@ class IgniteSpec(metaclass=ABCMeta):
if self.service.context.globals.get(JFR_ENABLED, False):
default_jvm_opts = merge_jvm_settings(default_jvm_opts,
-
["-XX:+UnlockCommercialFeatures",
- "-XX:+FlightRecorder",
+ ["-XX:+FlightRecorder",
"-XX:StartFlightRecording=dumponexit=true," +
f"filename={self.service.jfr_dir}/recording.jfr"])
diff --git a/modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
b/modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
index eaab8566285..b67c0a471bc 100644
--- a/modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
+++ b/modules/ducktests/tests/ignitetest/services/utils/jvm_utils.py
@@ -38,7 +38,7 @@ def create_jvm_settings(heap_size=DEFAULT_HEAP,
gc_settings=JVM_PARAMS_GC_G1, ge
"""
gc_dump = ""
if gc_dump_path:
- gc_dump = "-verbose:gc -Xloggc:" + gc_dump_path
+ gc_dump = "-Xlog:gc*=debug,gc+stats*=debug,gc+ergo*=debug:" +
gc_dump_path + ":uptime,time,level,tags"
out_of_mem_dump = ""
if oom_path:
diff --git a/modules/ducktests/tests/ignitetest/utils/ignite_test.py
b/modules/ducktests/tests/ignitetest/utils/ignite_test.py
index 5eb7dd669fe..67b205f0006 100644
--- a/modules/ducktests/tests/ignitetest/utils/ignite_test.py
+++ b/modules/ducktests/tests/ignitetest/utils/ignite_test.py
@@ -27,6 +27,7 @@ from ignitetest.services.utils.ducktests_service import
DucktestsService
# globals:
JFR_ENABLED = "jfr_enabled"
IGNITE_TEST_CONTEXT_CLASS_KEY_NAME = "IgniteTestContext"
+SAFEPOINT_LOGS_ENABLED = "safepoint_log_enabled"
class IgniteTestContext(TestContext):