ucsb icon indicating copy to clipboard operation
ucsb copied to clipboard

./run.py problem

Open zjthappy opened this issue 2 years ago • 20 comments

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ ./run.py Traceback (most recent call last): File "./run.py", line 164, in def main(db_names: Optional[list[str]] = supported_db_names, TypeError: 'type' object is not subscriptable

zjthappy avatar Jul 12 '23 14:07 zjthappy

@zjthappy thanks for the feedback! @DarvinHarutyunyan and @mgevor, please take a look at this 🤗

ashvardanian avatar Jul 12 '23 14:07 ashvardanian

@zjthappy thanks for the feedback! @DarvinHarutyunyan and @mgevor, please take a look at this hugs

it seems beacuse of the version of python,i use python3.9 instead but a new problem appear:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ sudo python3.9 run.py Cleanup... Traceback (most recent call last): File "/home/zjt/ycsb/ucsb/run.py", line 221, in fire.Fire(main) File "/usr/local/lib/python3.9/site-packages/fire/core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/usr/local/lib/python3.9/site-packages/fire/core.py", line 475, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/usr/local/lib/python3.9/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/home/zjt/ycsb/ucsb/run.py", line 217, in main run(db_name, size, workload_names, main_dir_path, storage_disk_paths, transactional, drop_caches, run_docker_image, threads_count) File "/home/zjt/ycsb/ucsb/run.py", line 131, in run process = pexpect.spawn(f'{runner}
File "/usr/local/lib/python3.9/site-packages/pexpect/pty_spawn.py", line 205, in init self._spawn(command, args, preexec_fn, dimensions) File "/usr/local/lib/python3.9/site-packages/pexpect/pty_spawn.py", line 276, in _spawn raise ExceptionPexpect('The command was not found or was not ' + pexpect.exceptions.ExceptionPexpect: The command was not found or was not executable: ./build_release/build/bin/ucsb_bench.

zjthappy avatar Jul 13 '23 01:07 zjthappy

Hi @zjthappy, please pull main-dev branch. There are some fixes there which haven't been merged into main yet.

mgevor avatar Jul 13 '23 05:07 mgevor

Is there any requirement for the compiler version when compiling?

zjthappy avatar Jul 13 '23 07:07 zjthappy

Both gcc-10 and gcc-11 are tested and compile fine.

mgevor avatar Jul 13 '23 07:07 mgevor

Is there a detailed tutorial, such as how to set parameters. I want to test the performance of redis

zjthappy avatar Jul 13 '23 08:07 zjthappy

I have merged a bunch of updates into main. As for Redis, @davvard may be the most experienced person on our side. Any specific recommendations on how to run the benchmarks?

ashvardanian avatar Jul 13 '23 08:07 ashvardanian

@zjthappy, you are able to change the benchmark's parameters in the run.py script, or you can pass the parameters in the terminal. e.g. sudo ./run.py -db redis -sz 100MB -wl Init Read See the script for more options.

mgevor avatar Jul 13 '23 08:07 mgevor

Thank you for your answers. I ran the instructions and there seems to be something wrong. The output is as follows:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ sudo python3.9 run.py -db redis -sz 100MB -wl Init,Read Failed to load workloads. path: ./bench/workloads/1.json Failed to load workloads. path: ./bench/workloads/1.json Failed to load workloads. path: ./bench/workloads/1.json Failed to load workloads. path: ./bench/workloads/1.json [✱] Dropping system caches...

And I am a bit confused, how to specify the address and port of redis

zjthappy avatar Jul 13 '23 09:07 zjthappy

I'm sorry, it had a bug, now you can pull the fix from main-dev.

Please follow the instruction:

  1. Enable database in CMakeList.txt if it isn't enabled by default: set flag ON here: option(UCSB_BUILD_REDIS "Build Redis for the benchmark" OFF)
  2. Build benchmark: ./build_release.sh
  3. Run: sudo ./run.py -db redis -sz 100MB -wl Init Read BatchRead

mgevor avatar Jul 13 '23 09:07 mgevor

@zjthappy When you run run.py with "-sz 100MB" argument, Redis is using ./bench/configs/redis/100MB.cfg config file where you can change the port.

davvard avatar Jul 13 '23 11:07 davvard

ok Thank you all

I'll give it another try and I'll give feedback if I have any problems with it

zjthappy avatar Jul 13 '23 11:07 zjthappy

Hey, @zjthappy ! Is it resolved now? Can we close the issue?

ashvardanian avatar Jul 20 '23 08:07 ashvardanian

Hello! I pull main branch.

  1. I Enable Redis in CMakeList.txt

option(UCSB_BUILD_USTORE "Build USTORE for the benchmark" ON) option(UCSB_BUILD_ROCKSDB "Build RocksDB for the benchmark" ON) option(UCSB_BUILD_LEVELDB "Build LevelDB for the benchmark" ON) option(UCSB_BUILD_WIREDTIGER "Build WiredTiger for the benchmark" ON) option(UCSB_BUILD_MONGODB "Build MongoDB for the benchmark" OFF) option(UCSB_BUILD_REDIS "Build Redis for the benchmark" ON) option(UCSB_BUILD_LMDB "Build LMDB for the benchmark" OFF)

  1. I Build benchmark: ./build_release.sh
  2. Run:

zjt@zjt-ThinkBook-16-G4-IAP:~/ucsb$ sudo python3.9 ./run.py -db redis -sz 100MB -wl Init Read BatchRead Failed to create DB: redis (probably it's disabled in CMaleLists.txt)

I don't know why it fails...... my operating environment: ubuntu-20.04 gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04) Python 3.9.15

zjthappy avatar Aug 15 '23 06:08 zjthappy

CMake caches older configs. Any chance you have previously run without Redis and hasn't cleaned the caches since?

ashvardanian avatar Aug 15 '23 06:08 ashvardanian

CMake caches older configs. Any chance you have previously run without Redis and hasn't cleaned the caches since?

I tried deleting cmake's output directory build_release, and then to speed up compilation only selected redis, but it still fails

option(UCSB_BUILD_USTORE "Build USTORE for the benchmark" OFF) option(UCSB_BUILD_ROCKSDB "Build RocksDB for the benchmark" OFF) option(UCSB_BUILD_LEVELDB "Build LevelDB for the benchmark" OFF) option(UCSB_BUILD_WIREDTIGER "Build WiredTiger for the benchmark" OFF) option(UCSB_BUILD_MONGODB "Build MongoDB for the benchmark" OFF) option(UCSB_BUILD_REDIS "Build Redis for the benchmark" ON) option(UCSB_BUILD_LMDB "Build LMDB for the benchmark" OFF)

zjt@zjt-ThinkBook-16-G4-IAP:~/ucsb$ sudo python3.9 ./run.py -db redis -sz 100MB -wl Init Read BatchRead Failed to create DB: redis (probably it's disabled in CMaleLists.txt)

Then I used the compiled binary build_release/build/bin/ucsb_bench directly,another problem appears:

zjt@zjt-ThinkBook-16-G4-IAP:~/ucsb$ sudo build_release/build/bin/ucsb_bench -db redis -cfg bench/configs/redis/100MB.cfg -md ./db_main/redis/100MB/ -wl ./bench/workloads/100MB.json -res bench/results/transactional/cores_15/disks_1/redis/ +------------------------------------------------------------------------------------------------------------------------------------------------+ | Database: redis | Workload size: 97.66MB | Threads: 1 | Disks: 1 | +------------------------------------------------------------------------------------------------------------------------------------------------+ sh: 1: redis-server: not found sh: 1: redis-cli: not found std exception: Failed to connect to Redis: No such file or directory

but my redis is ok:

zjt@zjt-ThinkBook-16-G4-IAP:~$ ps -ef | grep redis zjt 7401 1987 0 09:42 ? 00:00:59 ./src/redis-server 127.0.0.1:6379

zjthappy avatar Aug 15 '23 08:08 zjthappy

I'm sorry, it had a bug, now you can pull the fix from main-dev.

Please follow the instruction:

  1. Enable database in CMakeList.txt if it isn't enabled by default: set flag ON here: option(UCSB_BUILD_REDIS "Build Redis for the benchmark" OFF)
  2. Build benchmark: ./build_release.sh
  3. Run: sudo ./run.py -db redis -sz 100MB -wl Init Read BatchRead

Update: When you make changes in the ./CMakeList.txt you need to delete ./build_release/CMakeCache.txt cache file before running ./build_release.sh script, so you don't need to delete the whole ./build_release/ folder

mgevor avatar Aug 29 '23 05:08 mgevor

CMake caches older configs. Any chance you have previously run without Redis and hasn't cleaned the caches since?

I tried deleting cmake's output directory build_release, and then to speed up compilation only selected redis, but it still fails

option(UCSB_BUILD_USTORE "Build USTORE for the benchmark" OFF) option(UCSB_BUILD_ROCKSDB "Build RocksDB for the benchmark" OFF) option(UCSB_BUILD_LEVELDB "Build LevelDB for the benchmark" OFF) option(UCSB_BUILD_WIREDTIGER "Build WiredTiger for the benchmark" OFF) option(UCSB_BUILD_MONGODB "Build MongoDB for the benchmark" OFF) option(UCSB_BUILD_REDIS "Build Redis for the benchmark" ON) option(UCSB_BUILD_LMDB "Build LMDB for the benchmark" OFF)

zjt@zjt-ThinkBook-16-G4-IAP:~/ucsb$ sudo python3.9 ./run.py -db redis -sz 100MB -wl Init Read BatchRead Failed to create DB: redis (probably it's disabled in CMaleLists.txt)

Then I used the compiled binary build_release/build/bin/ucsb_bench directly,another problem appears:

zjt@zjt-ThinkBook-16-G4-IAP:~/ucsb$ sudo build_release/build/bin/ucsb_bench -db redis -cfg bench/configs/redis/100MB.cfg -md ./db_main/redis/100MB/ -wl ./bench/workloads/100MB.json -res bench/results/transactional/cores_15/disks_1/redis/ +------------------------------------------------------------------------------------------------------------------------------------------------+ | Database: redis | Workload size: 97.66MB | Threads: 1 | Disks: 1 | +------------------------------------------------------------------------------------------------------------------------------------------------+ sh: 1: redis-server: not found sh: 1: redis-cli: not found std exception: Failed to connect to Redis: No such file or directory

but my redis is ok:

zjt@zjt-ThinkBook-16-G4-IAP:~$ ps -ef | grep redis zjt 7401 1987 0 09:42 ? 00:00:59 ./src/redis-server 127.0.0.1:6379

@davvard could you please help @zjthappy to setup redis?

mgevor avatar Aug 29 '23 05:08 mgevor

Hi @zjthappy! Can you please kill the redis-server process, run the "redis-server" command in your terminal, and check if it works?

davvard avatar Aug 29 '23 06:08 davvard

Hi @zjthappy! Can you please kill the redis-server process, run the "redis-server" command in your terminal, and check if it works?

@davvard First I started redis:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ redis-server ~/redis-5.0.5/redis.conf

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ ps -ef | grep redis zjt 4370 1986 0 11:48 ? 00:00:00 redis-server *:6379 zjt 4454 2924 0 11:50 pts/2 00:00:00 grep --color=auto redis

I also modified the ucsb-redis connection configuration:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ cat ./bench/configs/redis/100MB.cfg { "connection_type": "UNIX", "path": "./db_main/redis/100MB/redis.sock", "host": "127.0.0.1", "port": 6379, "pool_size": 64, "wait_timeout": 10 }

Then I run ucsb,it fails:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ sudo python3.9 ./run.py -db redis -sz 100MB -wl Init Read BatchRead +------------------------------------------------------------------------------------------------------------------------------------------------+ | Database: redis | Workload size: 97.66MB | Threads: 1 | Disks: 1 | +------------------------------------------------------------------------------------------------------------------------------------------------+ sh: 1: redis-server: not found sh: 1: redis-cli: not found std exception: Failed to connect to Redis: No such file or directory

I try to kill redis process,and start redis again:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ kill -9 4370

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ ps -ef | grep redis zjt 4764 2924 0 11:57 pts/2 00:00:00 grep --color=auto redis

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ redis-server ~/redis-5.0.5/redis.conf

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ ps -ef | grep redis zjt 4771 1986 0 11:57 ? 00:00:00 redis-server 127.0.0.1:6379 zjt 4789 2924 0 11:57 pts/2 00:00:00 grep --color=auto redis

then try ucsb again,it still fails:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ sudo python3.9 ./run.py -db redis -sz 100MB -wl Init Read BatchRead +------------------------------------------------------------------------------------------------------------------------------------------------+ | Database: redis | Workload size: 97.66MB | Threads: 1 | Disks: 1 | +------------------------------------------------------------------------------------------------------------------------------------------------+ sh: 1: redis-server: not found sh: 1: redis-cli: not found std exception: Failed to connect to Redis: No such file or directory

zjthappy avatar Sep 04 '23 04:09 zjthappy