GoogleCloudPlatform / PerfKitBenchmarker

PerfKit Benchmarker (PKB) contains a set of benchmarks to measure and compare cloud offerings. The benchmarks use default settings to reflect what most users will see. PerfKit Benchmarker is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.
https://googlecloudplatform.github.io/PerfKitBenchmarker/
Apache License 2.0
1.9k stars 510 forks source link

Question not an issue: How to skip"provisioning and prepare phase" but run "running phase" directly and only? #1100

Closed martinggww closed 8 years ago

martinggww commented 8 years ago

Hi guys:

Everytime I run the benchmark, ./pkg.py always do the provisioning, prepare, running and clean up phases.

For example, if I run iperf on gcloud: ./pkb.py --project=xxxx --benchmarks=iperf --machine_type=f1-micro, the benchmark failed for some reasons. But the virtual machines and networks are still available.

How do I restart the benchmark without setting up the environments, download dependencies on VMs, but run the ./iperf directly?

thanks!

noahl commented 8 years ago

There are two ways. You can use the --run_stage=... option to run the provision and prepare phase once and then run multiple times. You'll have to be sure to pass the same --run_uri=... to each stage of the benchmark so PKB will know where to find the machines. (You can let the provision stage pick its own run_uri and then pass that to the later stages.)

If you already have your own VMs sitting around, you can also create static VM files for them (see the manual) and tell PKB to use those.

I'll close this bug for now, but please reopen if the options above don't answer your question.

martinggww commented 8 years ago

Hi Noahl: Thanks a lot for your answers. I finished one benchmark and I search the run_uri in the log, its: 19673e88-6fc3fa80-290a-4caf-ac66-daf2419757d1

Then I RE-run my ./pkg.py like this:

./pkb.py --project=xxxxxx --machine_type=f1-micro --benchmarks=aerospike --run_stage=run,cleanup --run_uri=19673e88-6fc3fa80-290a-4caf-ac66-daf2419757d1

I want to only run "run and cleanup" phases, but there is an error: "ERROR run_uri must be alphanumeric and less than or equal to 8 characters in length. " What's wrong with it?

And I have VMs and Networks: pkb-a827d375-0 us-central1-a f1-micro 10.128.0.3 104.198.194.10 RUNNING pkb-a827d375-1 us-central1-a f1-micro 10.128.0.2 104.197.219.160 RUNNING pkb-ada18ec9-0 us-central1-a f1-micro 10.128.0.3 104.197.101.22 RUNNING pkb-ada18ec9-1 us-central1-a f1-micro 10.128.0.2 104.198.232.133 RUNNING

Will you please tell me how to port them into the static VM file and use it in the ./pkg.py command???

Thanks a lot!

noahl commented 8 years ago

Hi Martin,

Yes, the run_uri thing is a known issue in PKB. We use the name "run_uri" for two different things. Sorry!

In your example, you have two different run_uris of the kind we need: a827d375 and ada18ec9. Any time you run PKB with --run_stage set not to do teardown, it should print at the end of the benchmark exactly the --run_uri flag you need to use to continue with those VMs. It will look something like "to run other benchmarks with this setup, please use --run_uri=...", but it will give you the correct string.

To port them to static VM files, you'll need the IP addresses and information on how to login via SSH. PKB's README.md file will tell you how to do it. But since it looks like you are creating your VMs with PKB anyway, getting --run_uri working should be much easier for you, and I would recommend doing that.

martinggww commented 8 years ago

I use "--run_uri=ada18ec9", pkg works fine. But I don't understand your statements: "--run_stage set not to do teardown".

I run pkg with " --run_stage=provision --run_uri=ada18ec9", PKG continoulsy runs "Running: ssh -A -p 22 perfkit@104.197.101.22 -2 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -o PreferredAuthentications=publickey -o PasswordAuthentication=no -o ConnectTimeout=5 -o GSSAPIAuthentication=no -o ServerAliveInterval=30 -o ServerAliveCountMax=10 -i /tmp/perfkitbenchmarker/runs/ada18ec9/perfkitbenchmarker_keyfile hostname ", it repeated like forever.

I tried " ./pkb.py --project=local-catalyst-141222 --machine_type=f1-micro --benchmarks=aerospike --run_uri=ada18ec9" without --run_stage options, it happens the same.

noahl commented 8 years ago

Hi Martin,

The hostname loop you're seeing is how PKB checks whether it can ssh into a VM. It should repeat until either PKB gets a response from the VM or PKB gives up and stops benchmarking. Did PKB eventually do something different?

For the run_stage flag, PKB will only teardown (delete) your VMs in three cases: if you don't pass --run_stage, if you set --run_stage=all, or if --run_stage is a list that includes teardown. Otherwise, PKB will not delete the VMs it creates. That's what I meant. If it doesn't delete the VMs, then it should tell you what --run_uri you need to use to reuse those same VMs.