xlab-uiuc / slooo

Slooo: A Fail-slow Fault Injection Testing Framework
11 stars 1 forks source link

Run through the tutorial #34

Closed tianyin closed 2 years ago

tianyin commented 2 years ago

@siyuanchai1999 We are going to release the Slooo tool to CS 598XU.

Before that, could you run through the tutorial and see whether everything works?

https://github.com/xlab-uiuc/slooo/blob/main/tutorial.md

siyuanchai1999 commented 2 years ago

I encountered two issues:

  1. After I followed the step 1-3 and run the xnoshcommand in step 4. It reports Command 'xonsh' not found, but can be installed with: sudo apt install xonsh. I think the xnosh package needs to be installed beforehand as well.

  2. After installing xnosh, I run the command in step 4 with path to workload and server config adjusted. However, it reports Python warning and error.

/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat
Traceback (most recent call last):
  File "/usr/bin/xonsh", line 4, in <module>
    main()
  File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 24019, in main
    _failback_to_other_shells(args, err)
  File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 23983, in _failback_to_other_shells
    raise err
  File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 24017, in main
    return main_xonsh(args)
  File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 24060, in main_xonsh
    run_script_with_cache(
  File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 3043, in run_script_with_cache
    run_compiled_code(ccode, glb, loc, mode)
  File "/usr/lib/python3/dist-packages/xonsh/__amalgam__.py", line 2948, in run_compiled_code
    func(code, glb, loc)
  File "run.xsh", line 4, in <module>
    from tests.mongodb.test_main import *
ModuleNotFoundError: No module named 'tests'

Let me know if I am doing anything wrong.

varshith15 commented 2 years ago

@siyuanchai1999 did you follow the reqs doc https://github.com/xlab-uiuc/slooo/blob/main/requirements.md

varshith15 commented 2 years ago

@siyuanchai1999 Please add the Slooo directory path to the PYTHONPATH as well, sorry it wasn't added to the reqs doc. @Essoz Please add it to the doc.

Essoz commented 2 years ago

Hi Siyuan,

For problem 1:

Can you check if your $PATH contains directory to the executable file of xonsh? If you followed the tutorial and executed pip3 install 'xonsh[full]', the executable is located at ~/.local/bin/xonsh (which is usually not in $PATH).

Update There is a document about installing xonsh using pip3 install 'xonsh[full]'. Sorry we forgot to include that in the tutorial.

For problem 2: Please see the answer from varshith.

siyuanchai1999 commented 2 years ago

@Essoz @varshith15 Thank you for the information! pip3 install 'xonsh[full]' works. I run the command and gets error xonsh run.xsh –system rethinkdb --workload ../YCSB/workloads/workloada --server-configs tests/rethink/server_configs_local.json --runtime 300 --exp-type follower --ex ps noslow,kill,1,5 --iters 5

usage: run.xsh [-h] [--system SYSTEM] [--iters ITERS] [--workload WORKLOAD] [--server-configs SERVER_CONFIGS] [--runtime RUNTIME] [--exps EXPS] [--exp-type EXP_TYPE] [--ondisk ONDISK] [--threads THREADS]
               [--output-path OUTPUT_PATH] [--cleanup]
run.xsh: error: unrecognized arguments: –system rethinkdb

Change the command to --system rethinkdb doesn't help.

Essoz commented 2 years ago

@siyuanchai1999

Hi Siyuan,

I ​do notice that there is a extra " " for the "exps" argument (the one before last one, can you recheck it). And "–" is actually different from a "-" (G doc must have automatically merged "--" to "–" and someone copied&pasted from that doc to tutorial).

Try this one to see if the issue is fixed :) (This one worked for me)

xonsh run.xsh --system rethinkdb --workload ../YCSB/workloads/workloada --server-configs tests/rethink/server_configs_local.json --runtime 300 --exp-type follower --exps noslow,kill,1,5 --iters 5
siyuanchai1999 commented 2 years ago

Thanks! Sorry for the dumb error. It runs but ask for password. I typed in my password but it doesn't seem to work.

schai@localhost's password:
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Essoz commented 2 years ago

Hi, the issue is mentioned in requirements.md (You can find this file in the repository). Sorry about that. I will update the information accordingly in the tutorial.

There are a lot of commands (like cgroup ones) that requires root privileges. So for local mode which requires a password for sudoers, the workaround is to switch to the root user before executing scripts (You might need to set path and pythonpath for root as well) or just use the docker image we provided.

tianyin commented 2 years ago

@Essoz See #36

tianyin commented 2 years ago

It's great that we have @siyuanchai1999 as a beta user!

tianyin commented 2 years ago

@siyuanchai1999 Can you continue fixing and trying? :)

siyuanchai1999 commented 2 years ago

@Essoz Running with sudo -s solves the problem before. but introduce the following

/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat
Traceback (most recent call last):
  File "/usr/local/bin/xonsh", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/xonsh/__amalgam__.py", line 21799, in main
    _failback_to_other_shells(args, err)
  File "/usr/local/lib/python3.8/dist-packages/xonsh/__amalgam__.py", line 21746, in _failback_to_other_shells
    raise err
  File "/usr/local/lib/python3.8/dist-packages/xonsh/__amalgam__.py", line 21797, in main
    sys.exit(main_xonsh(args))
  File "/usr/local/lib/python3.8/dist-packages/xonsh/__amalgam__.py", line 21853, in main_xonsh
    run_script_with_cache(
  File "/usr/local/lib/python3.8/dist-packages/xonsh/__amalgam__.py", line 3662, in run_script_with_cache
    run_compiled_code(ccode, glb, loc, mode)
  File "/usr/local/lib/python3.8/dist-packages/xonsh/__amalgam__.py", line 3563, in run_compiled_code
    func(code, glb, loc)
  File "run.xsh", line 5, in <module>
    from tests.rethink.test_main import *
  File "/home/schai/CS598XU/slooo/tests/rethink/test_main.xsh", line 7, in <module>
    from rethinkdb import r
ModuleNotFoundError: No module named 'rethinkdb'

Here's my PYTHONPATH /home/schai/CS598XU/slooo and here's my PATH /root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

Also, the –system in step four in the tutorial is wrong I think. it should be --system right?

tianyin commented 2 years ago

They renamed rethinkdb to rethink

NOW I'M REALLY CURIOUS -- DID YOU GUYS REALLY TESTED YOUR CODE?!!! @varshith15 @Essoz

varshith15 commented 2 years ago

@siyuanchai1999 you should have installed rethinkdb python package if you followed the tutorial. Please install it using pip.

varshith15 commented 2 years ago

@tianyin I did test the code myself. Multiple times actually just to be sure.

tianyin commented 2 years ago

haha I see. The rethinkdb is that rethinkdb which is not our rethinkdb

Essoz commented 2 years ago

They renamed rethinkdb to rethink

NOW I'M REALLY CURIOUS -- DID YOU GUYS REALLY TESTED YOUR CODE?!!! @varshith15 @Essoz

This happens if rethinkdb is not correctly installed. There's indeed a confusion about this because we have both rethink (our code) and rethinkdb (python package from RethinkDB).