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

Add recreate benchmark script #8473

Merged
2 commits merged into from
Dec 24, 2021
Merged

Add recreate benchmark script #8473

2 commits merged into from
Dec 24, 2021

Conversation

korthout
Copy link
Member

@korthout korthout commented Dec 23, 2021

Description

One of the steps in the daily release process is to check whether there are new commits on the release branch. If there are any, the benchmark must be restarted. There did not exist any script for this yet, and the manual steps are not straight forward (e.g. newBenchmark will fail because the namespace is already in use).

To avoid these problems, a new recreateBenchmark.sh script is introduced that:

  • checks whether the namespace already exists and if not suggests solutions
  • rebuilds the project and the docker images
  • redeploys the benchmark

This uses a special check for the benchmark name to be a valid DNS label. See #8455 for more details

Related issues

NA

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/0.25) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • New content is added to the release announcement

No need to spend time on running the checks. We also don't run the
tests. That's what we have CI for.
Copy link
Contributor

@deepthidevaki deepthidevaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Some minor comments.

recreateBenchmark.sh Outdated Show resolved Hide resolved
docker build --build-arg DISTBALL=dist/target/camunda-cloud-zeebe-*.tar.gz --build-arg APP_ENV=dev -t "gcr.io/zeebe-io/zeebe:$benchmark" .
docker push "gcr.io/zeebe-io/zeebe:$benchmark"

cd "benchmarks/setup/$benchmark"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This folder may not exists, right? I don't think we commit release benchmark setup anywhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. We should commit those somewhere, and this reminds me that it should also rebuild the benchmark project. So we should check that the folder exists

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebuilding the benchmark project also doesn't require this folder specifically. So no need for the check.

I've update the script to rebuild the benchmark project.

@korthout korthout force-pushed the korthout-recreate-benchmark branch 3 times, most recently from d1340a5 to f633e3a Compare December 23, 2021 16:23
This script allows you to easily recreate an existing benchmark that was
created with createBenchmark.sh. It simply builds the docker images and
updates the deployment.

An additional check that the k8s namespace is available is added to
this, as a quick check that you're using the correct namespace and are
on the correct context. Or perhaps the user was actually intending to
run ./createBenchmark.sh instead.

Sadly, the make update does not restart the pods. We should consider
solutions for that. However, as soon as the pods restart, the pods are
updated because the pullPolicy is set to always. Therefore this applies
a hard delete of all the broker and gateway pods to force the update.
This is not a rolling update.
@korthout
Copy link
Member Author

Thanks for the review @deepthidevaki. Can you have another look?

Copy link
Contributor

@deepthidevaki deepthidevaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🚀

Comment on lines +57 to +63
cd "$pwd/benchmarks/project"
sed_inplace "s/:SNAPSHOT/:$benchmark/" docker-compose.yml
# Use --no-cache to force rebuild the image for the benchmark application. Without this changes to zeebe-client were not picked up. This can take longer to build.
docker-compose build --no-cache
docker-compose push
git restore -- docker-compose.yml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most cases there won't be any need to re-build the starters and workers. But it make sense to do it always incase there are some changes. 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. If it bothers us we could spend some time adding a flag for this, so it can be turned on and off at will. But I didn't want to spend too much time on it now. Perhaps another time.

@korthout
Copy link
Member Author

bors merge

ghost pushed a commit that referenced this pull request Dec 24, 2021
8473: Add recreate benchmark script r=korthout a=korthout

## Description

<!-- Please explain the changes you made here. -->
One of the steps in the daily release process is to check whether there are new commits on the release branch. If there are any, the benchmark must be restarted. There did not exist any script for this yet, and the manual steps are not straight forward (e.g. `newBenchmark` will fail because the namespace is already in use).

To avoid these problems, a new `recreateBenchmark.sh` script is introduced that:
- checks whether the namespace already exists and if not suggests solutions
- rebuilds the project and the docker images
- redeploys the benchmark

This uses a special check for the benchmark name to be a valid DNS label. See #8455 for more details

## Related issues

<!-- Which issues are closed by this PR or are related -->

NA



Co-authored-by: Nico Korthout <nico.korthout@camunda.com>
@ghost
Copy link

ghost commented Dec 24, 2021

Build failed:

@korthout
Copy link
Member Author

Flaky test ExporterDirectorDistributionTest.shouldDistributeExporterPositions. I'll open an issue.

bors merge

@korthout
Copy link
Member Author

Opened #8475 for the flaky test

@ghost ghost merged commit 1561ff3 into develop Dec 24, 2021
@ghost ghost deleted the korthout-recreate-benchmark branch December 24, 2021 10:09
@github-actions
Copy link
Contributor

Successfully created backport PR #8476 for stable/1.1.

@github-actions
Copy link
Contributor

Successfully created backport PR #8477 for stable/1.2.

@github-actions
Copy link
Contributor

Successfully created backport PR #8478 for release-1.3.0.

ghost pushed a commit that referenced this pull request Dec 24, 2021
8478: [Backport release-1.3.0] Add recreate benchmark script r=korthout a=github-actions[bot]

# Description
Backport of #8473 to `release-1.3.0`.

relates to #8455

Co-authored-by: Nico Korthout <nico.korthout@camunda.com>
ghost pushed a commit that referenced this pull request Dec 24, 2021
8477: [Backport stable/1.2] Add recreate benchmark script r=korthout a=github-actions[bot]

# Description
Backport of #8473 to `stable/1.2`.

relates to #8455

Co-authored-by: Nico Korthout <nico.korthout@camunda.com>
ghost pushed a commit that referenced this pull request Dec 24, 2021
8476: [Backport stable/1.1] Add recreate benchmark script r=korthout a=github-actions[bot]

# Description
Backport of #8473 to `stable/1.1`.

relates to #8455

Co-authored-by: Nico Korthout <nico.korthout@camunda.com>
ghost pushed a commit that referenced this pull request Dec 24, 2021
8477: [Backport stable/1.2] Add recreate benchmark script r=korthout a=github-actions[bot]

# Description
Backport of #8473 to `stable/1.2`.

relates to #8455

Co-authored-by: Nico Korthout <nico.korthout@camunda.com>
@korthout korthout added the version:1.3.0 Marks an issue as being completely or in parts released in 1.3.0 label Jan 4, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version:1.3.0 Marks an issue as being completely or in parts released in 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants