-
-
Notifications
You must be signed in to change notification settings - Fork 782
Add support for compressing payloads sent over the message bus #5241
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
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
4eab14d
Add micro benchmarks for benchmarking publisher performance with and
Kami 56f3acf
Add support for compressing pickled payloads which are sent over the
Kami 919d366
Add tests for message bus payload compression.
Kami af98456
Fix typo, re-generate mock config.
Kami 6984a05
Update changelog.
Kami a628574
Add a fix for occasional integration tests race.
Kami bee9972
Add new GHA workflow for running micro benchmarks on nightly basis and
Kami 0d185b2
Use auto calibration module, update wf.
Kami edbda80
Update .gitignore.
Kami 4adcafa
We don't need to use custom rabbitmq image + reconfigure step for
Kami 9134b1b
Print more lines to make troubleshooting easier.
Kami 908539c
Remove steps we don't need.
Kami ae53c54
Add TODO note.
Kami 2910298
Run some less benchmarks on CI since some of the runs are very slow due
Kami 3aa60ba
Update workflow, add back missing param.
Kami 16e9b34
Remove testing changes, fix method name.
Kami 241853a
Add new micro benchmark measuring overhead of MongoDB transport level
Kami 0575c38
Ensure we perform eventlet monkey patching in all the micro benchmarks.
Kami afa4c87
Hook it up to make target.
Kami 2d49912
Fix invalid license headers - all those files were added by me in 2021
Kami 2875669
Move common and duplicated code in a new common module and reference
Kami 0aaca43
Test a change.
Kami 1552953
Fix race in configgen.
Kami 7b74593
Test a change.
Kami f36c014
Fix typo.
Kami 91a61a2
Fix typo.
Kami fa6b842
Add additional assertions.
Kami d22c4ae
Merge branch 'master' into message_bus_compression_support
Kami File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| # Workflow which runs micro benchmarks on nightly basis | ||
| # We run it nightly instead on every PR / merge to master since some of those benchmarks take quite a while. | ||
| name: Micro Benchmarks | ||
|
|
||
| on: | ||
| pull_request: | ||
| type: [opened, reopened, edited] | ||
| branches: | ||
| # Only for PRs targeting those branches | ||
| - master | ||
| - v[0-9]+.[0-9]+ | ||
| schedule: | ||
| - cron: '30 3 * * *' | ||
|
|
||
| jobs: | ||
| # Special job which automatically cancels old runs for the same branch, prevents runs for the | ||
| # same file set which has already passed, etc. | ||
| pre_job: | ||
| name: Skip Duplicate Jobs Pre Job | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
| steps: | ||
| - id: skip_check | ||
| uses: fkirc/skip-duplicate-actions@4c656bbdb6906310fa6213604828008bc28fe55d # v3.3.0 | ||
| with: | ||
| cancel_others: 'true' | ||
| github_token: ${{ github.token }} | ||
|
|
||
| micro-benchmarks: | ||
| needs: pre_job | ||
| # NOTE: We always want to run job on master since we run some additional checks there (code | ||
| # coverage, etc) | ||
| if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/master' }} | ||
| name: '${{ matrix.name }} - Python ${{ matrix.python-version }}' | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - name: 'Microbenchmarks' | ||
| task: 'micro-benchmarks' | ||
| nosetests_node_total: 1 | ||
| nosetests_node_index: 0 | ||
| python-version: '3.6' | ||
| services: | ||
| mongo: | ||
| image: mongo:4.4 | ||
| ports: | ||
| - 27017:27017 | ||
|
|
||
| rabbitmq: | ||
| image: rabbitmq:3.8-management | ||
| options: >- | ||
| --name rabbitmq | ||
| ports: | ||
| - 5671:5671/tcp # AMQP SSL port | ||
| - 5672:5672/tcp # AMQP standard port | ||
| - 15672:15672/tcp # Management: HTTP, CLI | ||
|
|
||
| env: | ||
| TASK: '${{ matrix.task }}' | ||
|
|
||
| NODE_TOTAL: '${{ matrix.nosetests_node_total }}' | ||
| NODE_INDEX: '${{ matrix.nosetests_node_index }}' | ||
|
|
||
| COLUMNS: '120' | ||
| ST2_CI: 'true' | ||
|
|
||
| # GitHub is juggling how to set vars for multiple shells. Protect our PATH assumptions. | ||
| PATH: /home/runner/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
| - name: 'Set up Python (${{ matrix.python-version }})' | ||
| uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: '${{ matrix.python-version }}' | ||
| - name: Cache Python Dependencies | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: | | ||
| ~/.cache/pip | ||
| virtualenv | ||
| ~/virtualenv | ||
| key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'test-requirements.txt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-python-${{ matrix.python }}- | ||
| - name: Cache APT Dependencies | ||
| id: cache-apt-deps | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: | | ||
| ~/apt_cache | ||
| key: ${{ runner.os }}-apt-v5-${{ hashFiles('scripts/github/apt-packages.txt') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-apt-v5- | ||
| - name: Install APT Dependencies | ||
| env: | ||
| CACHE_HIT: ${{steps.cache-apt-deps.outputs.cache-hit}} | ||
| run: | | ||
| ./scripts/github/install-apt-packages-use-cache.sh | ||
| - name: Install virtualenv | ||
| run: | | ||
| ./scripts/github/install-virtualenv.sh | ||
| - name: Install requirements | ||
| run: | | ||
| ./scripts/ci/install-requirements.sh | ||
| - name: Print versions | ||
| run: | | ||
| ./scripts/ci/print-versions.sh | ||
| - name: Run Micro Benchmarks | ||
| timeout-minutes: 30 | ||
| # use: script -e -c to print colors | ||
| run: | | ||
| script -e -c "make ${TASK}" && exit 0 | ||
| - name: Upload Histograms | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: benchmark_histograms | ||
| path: benchmark_histograms/ | ||
| retention-days: 30 | ||
|
|
||
| slack-notification: | ||
| name: Slack notification for failed builds | ||
| if: always() | ||
| needs: | ||
| - micro-benchmarks | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Workflow conclusion | ||
| # this step creates an environment variable WORKFLOW_CONCLUSION and is the most reliable way to check the status of previous jobs | ||
| uses: technote-space/workflow-conclusion-action@v2 | ||
| - name: CI Run Failure Slack Notification | ||
| if: ${{ env.WORKFLOW_CONCLUSION == 'failure' }} | ||
| env: | ||
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
| uses: voxmedia/github-action-slack-notify-build@v1 | ||
| with: | ||
| channel: development | ||
| status: FAILED | ||
| color: danger |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,7 @@ coverage*.xml | |
| .tox | ||
| nosetests.xml | ||
| htmlcov | ||
| benchmark_histograms/ | ||
|
|
||
| # Mr Developer | ||
| .idea | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # Copyright 2021 The StackStorm Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| import os | ||
|
|
||
| import pytest | ||
|
|
||
| BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
| FIXTURES_DIR = os.path.abspath(os.path.join(BASE_DIR, "../fixtures/json")) | ||
|
|
||
|
|
||
| PYTEST_FIXTURE_FILE_PARAM_NO_8MB_DECORATOR = pytest.mark.parametrize( | ||
| "fixture_file", | ||
| [ | ||
| "tiny_1.json", | ||
| "json_61kb.json", | ||
| "json_647kb.json", | ||
| "json_4mb.json", | ||
| "json_4mb_single_large_field.json", | ||
| ], | ||
| ids=[ | ||
| "tiny_1", | ||
| "json_61kb", | ||
| "json_647kb", | ||
| "json_4mb", | ||
| "json_4mb_single_large_field", | ||
| ], | ||
| ) | ||
|
|
||
| # NOTE: On CI we skip 8 MB fixture file since it's very slow and substantially slows down that | ||
| # workflow. | ||
| ST2_CI = os.environ.get("ST2_CI", "false").lower() == "true" | ||
|
|
||
| if ST2_CI: | ||
| PYTEST_FIXTURE_FILE_PARAM_DECORATOR = PYTEST_FIXTURE_FILE_PARAM_NO_8MB_DECORATOR | ||
| else: | ||
| PYTEST_FIXTURE_FILE_PARAM_DECORATOR = pytest.mark.parametrize( | ||
| "fixture_file", | ||
| [ | ||
| "tiny_1.json", | ||
| "json_61kb.json", | ||
| "json_647kb.json", | ||
| "json_4mb.json", | ||
| "json_8mb.json", | ||
| "json_4mb_single_large_field.json", | ||
| ], | ||
| ids=[ | ||
| "tiny_1", | ||
| "json_61kb", | ||
| "json_647kb", | ||
| "json_4mb", | ||
| "json_8mb", | ||
| "json_4mb_single_large_field", | ||
| ], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need extra libraries when using the various compression algorithms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only for zstandard, but we bundle that with the StackStorm virtual environment inside the deb and rpm packages.