Skip to content

Adding support for Redisson #23

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ A prototype for generating and running ctests. Below are the projects we current
- Hbase 2.2.2: `hbase-server`.
- ZooKeeper 3.5.6: `zookeeper-server`.
- Alluxio 2.1.0: `core`.

- Redisson 3.18.0: `redisson`.
We also provided our instrumented versions of the above projects:

- Hadoop 2.8.5: https://github.com/xlab-uiuc/hadoop
- Hbase 2.2.2: https://github.com/xlab-uiuc/hbase
- ZooKeeper 3.5.6: https://github.com/xlab-uiuc/zookeeper
- Alluxio 2.1.0: https://github.com/xlab-uiuc/alluxio
- Redisson 3.18.0: https://github.com/kfadillah/redisson

Our instrumented version projects have two branches:
- `ctest-injection`: branch with "Intercept Configuration API" instrumentation (See `ADDING_NEW_PROJECT.md`). This branch is used by `generate_ctest` and `run_ctest`.
Expand Down Expand Up @@ -59,7 +60,7 @@ To generate ctests or run ctest, you need to first clone the target project.
1. In `openctest/core`, run `./add_project.sh <main project>` to clone the project, switch to and build the branch `ctest-injection`. This branch will be later used by `generate_ctest` and `run_ctest`.
2. In `openctest/core/identify_param`, run `./add_project.sh <main project>` to clone the project, switch to and build the branch `ctest-logging`. This branch will be later used by `identify_param`.

`<main project>` can be `hadoop`, `hbase`, `zookeeper` or `alluxio`.
`<main project>` can be `hadoop`, `hbase`, `zookeeper`, `redisson` or `alluxio`.

## Usage

Expand Down
10 changes: 9 additions & 1 deletion core/add_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ function setup_alluxio() {
mvn clean install -DskipTests -Dcheckstyle.skip -Dlicense.skip -Dfindbugs.skip -Dmaven.javadoc.skip=true
}

function setup_redisson() {
[ ! -d "app/ctest-redissonredisson" ] && git clone https://github.com/kfadillah/redisson.git app/ctest-redisson
cd app/ctest-redisson
git fetch && git checkout ctest-injection
mvn clean install -pl redisson -am -DskipTests
}

function usage() {
echo "Usage: add_project.sh <main project>"
exit 1
Expand All @@ -64,7 +71,8 @@ function main() {
hbase) setup_hbase ;;
zookeeper) setup_zookeeper ;;
alluxio) setup_alluxio ;;
*) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper and alluxio." ;;
redisson) setup_redisson ;;
*) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper, redisson and alluxio." ;;
esac
fi
}
Expand Down
1 change: 1 addition & 0 deletions core/app/ctest-redisson
Submodule ctest-redisson added at 1aeb96
14 changes: 11 additions & 3 deletions core/ctest_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@
HBASE = "hbase-server"
ZOOKEEPER = "zookeeper-server"
ALLUXIO = "alluxio-core"
REDISSON = "redisson"

CTEST_HADOOP_DIR = os.path.join(APP_DIR, "ctest-hadoop")
CTEST_HBASE_DIR = os.path.join(APP_DIR, "ctest-hbase")
CTEST_ZK_DIR = os.path.join(APP_DIR, "ctest-zookeeper")
CTEST_ALLUXIO_DIR = os.path.join(APP_DIR, "ctest-alluxio")
CTEST_REDISSON_DIR = os.path.join(APP_DIR, "ctest-redisson")

PROJECT_DIR = {
HCOMMON: CTEST_HADOOP_DIR,
HDFS: CTEST_HADOOP_DIR,
HBASE: CTEST_HBASE_DIR,
ZOOKEEPER: CTEST_ZK_DIR,
ALLUXIO: CTEST_ALLUXIO_DIR,
REDISSON: CTEST_REDISSON_DIR
}


Expand All @@ -34,6 +37,7 @@
HBASE: "hbase-server",
ZOOKEEPER: "zookeeper-server",
ALLUXIO: "core",
REDISSON: "redisson"
}


Expand All @@ -58,6 +62,7 @@
os.path.join(CTEST_ALLUXIO_DIR, MODULE_SUBDIR[ALLUXIO], "server/worker", SUREFIRE_SUBDIR),
os.path.join(CTEST_ALLUXIO_DIR, MODULE_SUBDIR[ALLUXIO], "server/master", SUREFIRE_SUBDIR),
],
REDISSON: [os.path.join(CTEST_REDISSON_DIR, MODULE_SUBDIR[REDISSON], SUREFIRE_SUBDIR)],
}

# default or deprecate conf path
Expand All @@ -74,10 +79,10 @@
HDFS: os.path.join(DEFAULT_CONF_DIR, HDFS + "-default.tsv"),
HBASE: os.path.join(DEFAULT_CONF_DIR, HBASE + "-default.tsv"),
ALLUXIO: os.path.join(DEFAULT_CONF_DIR, ALLUXIO + "-default.tsv"),
ZOOKEEPER: os.path.join(DEFAULT_CONF_DIR, ZOOKEEPER + "-default.tsv")
ZOOKEEPER: os.path.join(DEFAULT_CONF_DIR, ZOOKEEPER + "-default.tsv"),
REDISSON: os.path.join(DEFAULT_CONF_DIR, REDISSON + "-default.tsv"),
}


# injecting config file location
INJECTION_PATH = {
HCOMMON: [
Expand All @@ -96,6 +101,9 @@
],
ALLUXIO: [
os.path.join(CTEST_ALLUXIO_DIR, "core/alluxio-ctest.properties")
],
REDISSON: [
os.path.join(CTEST_REDISSON_DIR, MODULE_SUBDIR[REDISSON],"src/test/resources/org/redisson/ctest-injection.yaml")
]
}

Expand All @@ -108,9 +116,9 @@
FAIL = "f" # test failed
PASS = "p" # test passed
GOOD_VAL = "GOOD"

BAD_VAL = "BAD"
SKIP_VAL = "SKIP"

CTESTS_DIR = os.path.join(GEN_CTEST_DIR, "ctest_mapping")
os.makedirs(CTESTS_DIR, exist_ok=True)
CTESTS_FILE = "ctests-{project}.json"
Expand Down
11 changes: 11 additions & 0 deletions core/default_configs/redisson-default.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
nettythreads 16 32
referenceEnabled true false
lockWatchdogTimeout 30000 35000
checkLockSyncedSlaves true false
reliableTopicWatchdogTimeout 0.05 1.0
keepPubSubOrder true false
useScriptCache true false
minCleanUpDelay 5 10
maxCleanUpDelay 1800 1000
cleanUpKeysAmount 100 50
useThreadClassLoader true false
12 changes: 12 additions & 0 deletions core/generate_ctest/inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ def inject_config(param_value_pairs):
file.write(str.encode("<?xml version=\"1.0\"?>\n<?xml-stylesheet type=\"text/xsl\" href=\"configuration.xsl\"?>\n"))
file.write(ET.tostring(conf))
file.close()
elif project == 'redisson':
for inject_path in INJECTION_PATH[project]:
print(">>>>[ctest_core] injecting into file: {}".format(inject_path))
file = open(inject_path, "w")
for p, v in param_value_pairs.items():
file.write(p + ": " + v + "\n")
file.close()
else:
sys.exit(">>>>[ctest_core] value injection for {} is not supported yet".format(project))

Expand All @@ -53,5 +60,10 @@ def clean_conf_file(project):
file.write(str.encode("<?xml version=\"1.0\"?>\n<?xml-stylesheet type=\"text/xsl\" href=\"configuration.xsl\"?>\n"))
file.write(ET.tostring(conf))
file.close()
elif project == 'redisson':
for inject_path in INJECTION_PATH[project]:
file = open(inject_path, "w")
file.write("\n")
file.close()
else:
sys.exit(">>>>[ctest_core] value injection for {} is not supported yet".format(project))
4 changes: 3 additions & 1 deletion core/generate_ctest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def test_value_pair(test_input):
for param, values in test_input.items():
tr_file = open(os.path.join(GENCTEST_TR_DIR, project, TR_FILE.format(id=param)), "w")
mt_file = open(os.path.join(GENCTEST_TR_DIR, project, MT_FILE.format(id=param)), "w")

if param not in mapping:
print(">>>>[ctest_core] param not in mapping" + param)
continue
associated_tests = mapping[param] if param in mapping else []
if len(mapping[param]) != 0:
for value in values:
Expand Down
8 changes: 4 additions & 4 deletions core/generate_ctest/program_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
# run mode
"run_mode": "generate_ctest", # string
# name of the project, i.e. hadoop-common, hadoop-hdfs, see constant.py
"project": "hadoop-common", # string
"project": "redisson", # string
# path to param -> tests json mapping
"mapping_path": "../../data/ctest_mapping/opensource-hadoop-common.json", # string
"mapping_path": "../../data/ctest_mapping/opensource-redisson.json", # string
# good values of params tests will be run against
"param_value_tsv": "sample-hadoop-common.tsv", # string
"param_value_tsv": "../default_configs/redisson-default.tsv", # string
# display the terminal output live, without saving any results
"display_mode": False, # bool
# whether to use mvn test or mvn surefire:test
"use_surefire": True, # bool
# additional maven options to pass to `mvn surefire:test -Dtest=...`
"maven_args": [], # list of strings, each element is an option
"maven_args": ["-DredisBinary=/usr/bin/redis-server"], # list of strings, each element is an option
# timeout on the mvn test command
"cmd_timeout": None, # int
}
Expand Down
5 changes: 5 additions & 0 deletions core/generate_value/value_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def read_tsv(module):
if module == "zookeeper-server":
assert len(params) == 32
return 32
elif module == "redisson":
assert len(params) == 11
return 32
else:
assert len(params) == 90
return 90
Expand Down Expand Up @@ -105,6 +108,8 @@ def print_params(module):
f = open(module + output, "w")
if module == "zookeeper-server":
assert len(params) == 32
elif module == "redisson":
assert len(params) == 11
else:
assert len(params) >= 90
for param in params:
Expand Down
10 changes: 9 additions & 1 deletion core/identify_param/add_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ function setup_alluxio() {
mvn clean install -DskipTests -Dcheckstyle.skip -Dlicense.skip -Dfindbugs.skip -Dmaven.javadoc.skip=true
}

function setup_redisson() {
[ ! -d "app/ctest-redissonredisson" ] && git clone https://github.com/kfadillah/redisson.git app/ctest-redisson
cd app/ctest-redisson
git fetch && git checkout ctest-logging
mvn clean install -pl redisson -am -DskipTests
}

function usage() {
echo "Usage: add_project.sh <main project>"
exit 1
Expand All @@ -63,7 +70,8 @@ function main() {
hbase) setup_hbase ;;
zookeeper) setup_zookeeper ;;
alluxio) setup_alluxio ;;
*) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper and alluxio." ;;
redisson) setup_redisson ;;
*) echo "Unexpected project: $project - only support hadoop, hbase, zookeeper, redisson and alluxio." ;;
esac
fi
}
Expand Down
1 change: 1 addition & 0 deletions core/identify_param/app/ctest-redisson
Submodule ctest-redisson added at e9fd31
20 changes: 15 additions & 5 deletions core/identify_param/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@
CTEST_HBASE_DIR = os.path.join(APP_DIR, "ctest-hbase")
CTEST_ZOOKEEPER_DIR = os.path.join(APP_DIR, "ctest-zookeeper")
CTEST_ALLUXIO_DIR = os.path.join(APP_DIR, "ctest-alluxio")

CTEST_REDISSON_DIR = os.path.join(APP_DIR, "ctest-redisson")
MODULE_PATH = {
"hadoop-common": CTEST_HADOOP_DIR,
"hadoop-hdfs": CTEST_HADOOP_DIR,
"hbase-server": CTEST_HBASE_DIR,
"alluxio-core": CTEST_ALLUXIO_DIR
"alluxio-core": CTEST_ALLUXIO_DIR,
"redisson": CTEST_REDISSON_DIR
}

SRC_SUBDIR = {
"hadoop-common": "hadoop-common-project/hadoop-common",
"hadoop-hdfs": "hadoop-hdfs-project/hadoop-hdfs",
"hbase-server": "hbase-server",
"zookeeper-server": "zookeeper-server",
"alluxio-core": "core"
"alluxio-core": "core",
"redisson": "redisson"
}

MVN_TEST_PATH = {
Expand All @@ -29,14 +31,16 @@
"hbase-server": os.path.join(CTEST_HBASE_DIR, SRC_SUBDIR["hbase-server"]),
"zookeeper-server": os.path.join(CTEST_ZOOKEEPER_DIR, SRC_SUBDIR["zookeeper-server"]),
"alluxio-core": os.path.join(CTEST_ALLUXIO_DIR, SRC_SUBDIR["alluxio-core"]),
"redisson": os.path.join(CTEST_REDISSON_DIR, SRC_SUBDIR["redisson"]),
}

LOCAL_CONF_PATH = {
"hadoop-common": "results/hadoop-common/conf_params.txt",
"hadoop-hdfs": "results/hadoop-hdfs/conf_params.txt",
"hbase-server": "results/hbase-server/conf_params.txt",
"zookeeper-server": "results/zookeeper-server/conf_params.txt",
"alluxio-core": "results/alluxio-core/conf_params.txt"
"alluxio-core": "results/alluxio-core/conf_params.txt",
"redisson": "results/redisson/conf_params.txt"
}

SUREFIRE_SUBDIR = "target/surefire-reports/*"
Expand All @@ -63,7 +67,10 @@
os.path.join(CTEST_ALLUXIO_DIR, "core/server/proxy", SUREFIRE_SUBDIR),
os.path.join(CTEST_ALLUXIO_DIR, "core/server/worker", SUREFIRE_SUBDIR),
os.path.join(CTEST_ALLUXIO_DIR, "core/server/master", SUREFIRE_SUBDIR)
]
],
"redisson": [
os.path.join(CTEST_REDISSON_DIR, "redisson", SUREFIRE_SUBDIR)
],
}

LOCAL_SUREFIRE_SUFFIX = "surefire-reports/*"
Expand All @@ -83,5 +90,8 @@
],
"alluxio-core": [
os.path.join("surefire-reports/alluxio-core", LOCAL_SUREFIRE_SUFFIX)
],
"redisson": [
os.path.join("surefire-reports/redisson", LOCAL_SUREFIRE_SUFFIX)
]
}
4 changes: 2 additions & 2 deletions core/identify_param/identify_param.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ function main() {
usage
else
case $project in
hadoop-common | hadoop-hdfs | hbase-server | zookeeper-server | alluxio-core) python3 runner.py $project; python3 collector.py $project ;;
hadoop-common | hadoop-hdfs | hbase-server | zookeeper-server | alluxio-core | redisson) python3 runner.py $project; python3 collector.py $project ;;
-h | --help) usage ;;
*) echo "Unexpected project: $project - only support hadoop-common, hadoop-hdfs, hbase-server, zookeeper-server and alluxio-core." ;;
*) echo "Unexpected project: $project - only support hadoop-common, hadoop-hdfs, hbase-server, redisson, zookeeper-server and alluxio-core." ;;
esac
fi
}
Expand Down
Loading