Skip to content
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

windsock: add --load-cloud-resources-from-disk and --store-cloud-resources-to-disk #1453

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

rukai
Copy link
Member

@rukai rukai commented Feb 6, 2024

progress towards #1274

Usage of the new functionality

> # Create the resources required to run the benches specified in FILTER and then store the information required to access those instances to disk
> cargo windsock --store-cloud-resources-to-disk "name=kafka shotover=standard size=100KB topology=cluster3"
Creating AWS resources: CloudResourcesRequired {
    shotover_instance_count: 1,
    docker_instance_count: 3,
    include_shotover_in_docker_instance: false,
}
> # Run the benches once, using the instances created in the previous command.
> cargo windsock --load-cloud-resources-file "name=kafka shotover=standard size=100KB topology=cluster3"
Running "kafka,shotover=standard,size=100KB,topology=cluster3"
...
> # Run the benches a second time reusing the same instances
> cargo windsock --load-cloud-resources-file "name=kafka shotover=standard size=100KB topology=cluster3"
Running "kafka,shotover=standard,size=100KB,topology=cluster3"
...
> # Cleanup resources, also remove the resources-to-disk file to ensure that a `--use-cloud-resources-from-disk` command would fail early.
> cargo windsock --cleanup-cloud-resources
All AWS throwaway resources have been deleted

Why we need this?

  • improve time to run benchmarks
  • more stable results (or at the very least it eliminates a possible source of instability allowing us to more confidently check for other sources of instability)

Design decisions

I intentionally designed --store-cloud-resources-file to skip running the benches.
The benefit of this is it ensures that every time we actually run the bench it uses the same command.
This makes:

  • up arrow -> enter in a shell to rerun a bench run more likely to do what the user expects.
  • a shell script can loop over multiple benchruns without having to handle the first run differently.

What if we combined the two flags though?
We could just have a single flag --store-and-reload-cloud-resources-file that always writes the cloud resources to disk and loads if the cloud resources file exists.
However there are two problems with that:

  1. we need to clear the resource file sometimes when the developer changes the setup procedure for cloud instances therefore invalidating the cached instances.
  2. It may not be clear to the developer that cloud resources are left alive with that API. But splitting it up into seperate store and load commands makes it more obvious that it is kept alive and must be manually destroyed.

As such I think the best solution is two seperate commands to give the developer control over when they create and recreate these resources.

refreshing instances
When we reuse instances part of the instance setup should be reused and part should be recreated.
In this PR the shotover binary+config, and the bencher binary will be reuploaded.
However the rest of the setup will be reused as is.
If the developer changes anything else about the setup, say adds a new external dependency then they will have to recreate instances.
I think this is the sweet spot as it lets us iterate on shotover and the bencher performance wise while keeping retries fast and/or avoiding complexity for detecting when we need to recreate other parts of the setup.

@rukai rukai force-pushed the allow_reusing_instances branch 2 times, most recently from a2d1a02 to c73ead4 Compare February 6, 2024 04:24
@rukai rukai marked this pull request as draft February 6, 2024 07:01
@rukai rukai force-pushed the allow_reusing_instances branch 5 times, most recently from 39e2a40 to 755b4fb Compare February 7, 2024 00:43
@rukai rukai marked this pull request as ready for review February 7, 2024 00:46
@rukai rukai requested a review from conorbros February 7, 2024 03:10
@rukai rukai force-pushed the allow_reusing_instances branch 2 times, most recently from 89599ed to e8e669a Compare February 7, 2024 05:37
@rukai rukai force-pushed the allow_reusing_instances branch from 05b6dbc to 2efdbb1 Compare February 7, 2024 21:00
@conorbros conorbros merged commit 67795d0 into shotover:main Feb 8, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants