-
Notifications
You must be signed in to change notification settings - Fork 142
CI: New Manual workflow for testing 2 builds #744
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
Open
bbpetukhov
wants to merge
115
commits into
bloomberg:main
Choose a base branch
from
bbpetukhov:manual-ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
115 commits
Select commit
Hold shift + click to select a range
0486786
Can checkout 2 refs
bbpetukhov dfa7952
Refactor manual ci
bbpetukhov fa35a1b
Can run ITs for 2 broker versions
bbpetukhov ba83d72
fix manual ci
bbpetukhov a072147
Fix build; fix run UTs
bbpetukhov 9e10a81
Fix ITs in manual ci
bbpetukhov 7d88fa7
Add cache_key_suffix
bbpetukhov 7e69525
Cancel build if cache exists
bbpetukhov b25e133
Fix more typos
bbpetukhov 59132b4
Do not use global variables
bbpetukhov b38e548
CI Manual fail-on-cache-miss: true
bbpetukhov 918724a
Save build to artifact instead of cache
bbpetukhov 59ffde8
Fix ITs run script location
bbpetukhov 842a065
Add some ls cmds for testsing
bbpetukhov dcc90c9
do not save to aftifacts /opt/bb/include
bbpetukhov fd14240
Add chmod +x for broker
bbpetukhov edc9725
Add +x for all .tsk
bbpetukhov 487fd49
Fix path in download-artifact include
bbpetukhov 60629d0
Can preset leader via env var BLAZINGMQ_LEADER_NAME
bbpetukhov 1974f2b
Refactor manual workflow; fix prometheus build job
bbpetukhov 1ec3a9f
Refactor manual wf
bbpetukhov 507efe2
fix cache restore
bbpetukhov 4bd649e
Fix fuzz tests
bbpetukhov 8c06d38
Load build from cache for fuzztest
bbpetukhov cbe39fa
Can cleaun up artifacts after manual run
bbpetukhov 61a360f
Run cleanup always
bbpetukhov 255d6e8
Fix artifacts cleanup
bbpetukhov 37a9f9b
Customize build_ubuntu workflow
bbpetukhov c18b839
Update passing cache_key
bbpetukhov 94a7a80
Swtich from cache to artifacts
bbpetukhov 85d1f15
Fix include artifact name
bbpetukhov 6717e79
Fix permission in fuzztest
bbpetukhov 747505f
Fix fuzztests
bbpetukhov 7187fb3
wip
bbpetukhov 4464d69
Configure tests to update broker binary
bbpetukhov a1a25d2
merge with upstream main
bbpetukhov 7247f5e
Do not remove build artifacts
bbpetukhov dbd5755
Do not assert and crash python wrapper if BLAZINGMQ_BROKER_NEW_VERSIO…
bbpetukhov b613225
Add comments
bbpetukhov dd8b7e1
refactor pixtures - remove redundant variables
bbpetukhov abf1233
Add more test for broker binary update
bbpetukhov 748080c
cache build
bbpetukhov 4472acb
fix redeploy IT
bbpetukhov e4ac608
Update build_ubuntu cache
bbpetukhov 60fda0e
Fix redeploy tests
bbpetukhov 6ac7feb
Make sure cluster is ready before running test
bbpetukhov e068bd1
BLAZINGMQ_LEADER_NAME can be empty for default behavior
bbpetukhov d31a4d5
Do not delete build artifacts after manual wf
bbpetukhov 4f210f5
Remove redundant code
bbpetukhov aa7e628
Merge remote-tracking branch 'upstream/main' into manual-ci
bbpetukhov 87f0fbd
Run existing multi ITs on manual workflow run
bbpetukhov 96df93e
Fix pylint errors
bbpetukhov 612133c
Disable UTs as part of all target
bbpetukhov 0aed40a
Fix more pylint errors
bbpetukhov fe2a444
Suppress pylint import error for cluster fixture
bbpetukhov ae84f13
Install tproxy for all ITs
bbpetukhov 5dd94ec
Merge branch 'main' into manual-ci
bbpetukhov 5c42fcd
Get ITs from current branch
bbpetukhov ae7bf92
Change build cache key to avoid incorret fallbacks
bbpetukhov a44d16a
Enable all ITs combinations
bbpetukhov c9be25a
Fix paths for proxy nodes
bbpetukhov 8090b57
Set bmq tool path
bbpetukhov ff62f18
Merge remote-tracking branch 'upstream/main' into manual-ci
bbpetukhov 1f33d59
Clean up build.yaml
bbpetukhov 37a0f30
Reenable all.t target in CMakeLists
bbpetukhov ca62f4f
Build target "bmqbrkr bmqtool" instead of "all"
bbpetukhov de41065
Remove default all build target in build-ubuntu workflow
bbpetukhov b0a5e4c
Add description section for the workflows
bbpetukhov 5038309
Raname brokers param
bbpetukhov a793683
Update src/integration-tests/test_redeploy.py
bbpetukhov 6fc5ef3
Update .github/workflows/manual.yaml - add "legacy_mode"
bbpetukhov 6b60faf
Update .github/workflows/manual.yaml - add "eventual_consistency"
bbpetukhov 09ee916
Add explicit comments for groups of brokers per binary
bbpetukhov 911beb1
Merge branch 'main' into manual-ci
bbpetukhov 4ed6adf
Extend redeploy test - post message after each node redeploy; impleme…
bbpetukhov baf55c2
Add explicit params save_build_as_artifacts and run_unit_tests for bu…
bbpetukhov 3b2fc46
Run ruff format
bbpetukhov e18bb7c
Add comments explaining using deps in build_and_test_bmqprometheus_pl…
bbpetukhov a8fd418
Fix input vars types, add comments
bbpetukhov 90ae7b0
Merge branch 'main' into manual-ci
bbpetukhov 6f53c68
Use correct build artifact for storagetool ITs
bbpetukhov e5253da
Add +x permissions for binaries in storagetool tests
bbpetukhov 65b626c
Update .github/workflows/build-ubuntu.yaml
bbpetukhov 4fad4e0
Update .github/workflows/build-ubuntu.yaml
bbpetukhov 1859f1c
Change conditions from =="all.t" to contains
bbpetukhov 45de1ac
Update .github/workflows/build-ubuntu.yaml
bbpetukhov 3472b08
Update .github/workflows/build-ubuntu.yaml
bbpetukhov 2442142
Update .github/workflows/manual.yaml
bbpetukhov 51db816
Update .github/workflows/manual.yaml
bbpetukhov 491d03d
Update .github/workflows/build-ubuntu.yaml
bbpetukhov ea3d9c1
Merge branch 'main' into manual-ci
bbpetukhov 6ceb6f4
Migrate multi3 to multi7 fixture
bbpetukhov 8b3b471
Optimize: do not cache build results if they are not to be saved as a…
bbpetukhov 1b0097b
Merge branch 'bloomberg:main' into manual-ci
bbpetukhov d8825c2
Fix artifact name collision for when same ref is used for both builds…
bbpetukhov 939c577
For new ITs it is enough to specify BLAZINGMQ_BROKER for old broker v…
bbpetukhov 3ef77aa
Merge branch 'main' into manual-ci
bbpetukhov b3e7f83
Do not check exist code on cluster shutdown in legacy mode
bbpetukhov 0e4fb90
Disable parallel pytest execution for multi 7-node cluster fixture
bbpetukhov 75506bf
Increased timeout for 7-node cluster running on CI 4-cpu machine
bbpetukhov c7dce91
New redeploy test - restart node one by one
bbpetukhov 7c07369
Lint format
bbpetukhov bf5cf79
Merge branch 'main' into manual-ci
bbpetukhov ae8c98a
Fix stop_some_nodes method
bbpetukhov c890091
Fix redeploy tests -- do not check for leader ready when replica is u…
bbpetukhov 78b0530
Merge branch 'bloomberg:main' into manual-ci
bbpetukhov 2418a76
Use correct broker entity in redeploy IT
bbpetukhov fc6bd52
Restrict leader change in whole cluster restart test
bbpetukhov 799fbed
Refactor cluster python class: remove redundant functionality to mana…
bbpetukhov 21365a6
Merge branch 'main' into manual-ci
bbpetukhov a9f85d4
Merge branch 'main' into manual-ci
bbpetukhov 32eb383
Merge branch 'main' into manual-ci
bbpetukhov d65a577
Fix merge conflicts
bbpetukhov b9ed2b0
Remove reverse_proxy for multi7 cluster it fixture
bbpetukhov bf5db2d
Merge branch 'main' into manual-ci
bbpetukhov 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,163 @@ | ||
name: Build Ubuntu | ||
|
||
description: | | ||
This is a reusable workflow to build BlazingMQ on Ubuntu. | ||
Optionally run unit tests if the target is "all.t". | ||
Given a ref and a target, this workflow will build the project and will save the build results both as artifact and in cache. | ||
The cache key is generated based on the ref and the target, and is returned via workflow output. | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: "Branch name, tag, or commit SHA to build" | ||
required: true | ||
type: string | ||
target: | ||
description: "Build targets, space-delimited" | ||
required: true | ||
type: string | ||
save_build_as_artifacts: | ||
description: "Whether to save the build as artifacts" | ||
required: true | ||
type: boolean | ||
default: true | ||
run_unit_tests: | ||
description: "Whether to run unit tests. Can only be set to true if `all.t` is one of the build targets" | ||
required: true | ||
type: boolean | ||
default: false | ||
name: | ||
description: "Name of the workflow run, used for artifacts" | ||
required: false | ||
type: string | ||
default: "build-ubuntu" | ||
outputs: | ||
artifact_key: | ||
description: "GH Actions Cache key associated with the built dependencies" | ||
value: ${{ jobs.build_ubuntu.outputs.artifact_key }} | ||
|
||
jobs: | ||
get_dependencies: | ||
name: "Dependencies" | ||
uses: ./.github/workflows/dependencies.yaml | ||
|
||
build_ubuntu: | ||
name: Build [ubuntu] ${{ inputs.ref }} ${{ inputs.target }} | ||
runs-on: ubuntu-latest | ||
needs: get_dependencies | ||
outputs: | ||
artifact_key: ${{ steps.get_cache_key.outputs.artifact_key }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
fetch-depth: 0 | ||
|
||
# Since input.ref can be a branch, tag or commit SHA, | ||
# we need to get the commit SHA to use it in the cache key. | ||
- name: Generate cache key from commit SHA | ||
id: get_cache_key | ||
bbpetukhov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if: inputs.save_build_as_artifacts == true # Variable type is boolean, thus no quotes | ||
# When restoring from cache fails, it searches for other keys to fall back to. | ||
# If the given key is a prefix of another key, it will be used. | ||
# E.g. "...-all" can fallback to "...-all.t" | ||
# Thus do not put the target at the end of the key. | ||
run: | | ||
COMMIT_SHA=$(git rev-parse HEAD) | ||
echo "cache_key=cache-${{ inputs.target }}-${COMMIT_SHA}" >> $GITHUB_OUTPUT | ||
echo "artifact_key=${{ inputs.name }}-${{ inputs.target }}-${COMMIT_SHA}" >> $GITHUB_OUTPUT | ||
- uses: actions/cache/restore@v4 | ||
id: build-cache-restore-step | ||
if: inputs.save_build_as_artifacts == true # Variable type is boolean, thus no quotes | ||
with: | ||
path: | | ||
build/blazingmq | ||
deps | ||
key: ${{ steps.get_cache_key.outputs.cache_key }} | ||
|
||
# The following steps restore cached deps | ||
# If the cache is not hit, it will build and install the dependencies | ||
# If the cache is hit, building deps is skipped, only make install is run | ||
- uses: actions/cache/restore@v4 | ||
if: steps.build-cache-restore-step.outputs.cache-hit != 'true' # Variable type is string, thus using quotes | ||
with: | ||
path: deps | ||
key: ${{ needs.get_dependencies.outputs.cache_key }} | ||
- name: Set up dependencies | ||
if: steps.build-cache-restore-step.outputs.cache-hit != 'true' # Variable type is string, thus using quotes | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -qy build-essential \ | ||
gdb \ | ||
curl \ | ||
python3.10 \ | ||
python3-pip \ | ||
cmake \ | ||
ninja-build \ | ||
pkg-config \ | ||
bison \ | ||
libfl-dev \ | ||
libbenchmark-dev \ | ||
libgmock-dev \ | ||
libz-dev | ||
- name: Install cached non packaged dependencies | ||
if: steps.build-cache-restore-step.outputs.cache-hit != 'true' # Variable type is string, thus using quotes | ||
working-directory: deps | ||
run: ../docker/build_deps.sh | ||
|
||
# Build BlazingMQ | ||
- name: Build BlazingMQ | ||
if: steps.build-cache-restore-step.outputs.cache-hit != 'true' # Variable type is string, thus using quotes | ||
env: | ||
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig | ||
run: | | ||
cmake -S . -B build/blazingmq -G Ninja \ | ||
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem/toolchains/linux/gcc-default.cmake \ | ||
-DCMAKE_BUILD_TYPE=Debug \ | ||
-DBDE_BUILD_TARGET_SAFE=ON \ | ||
-DBDE_BUILD_TARGET_64=ON \ | ||
-DBDE_BUILD_TARGET_CPP17=ON \ | ||
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem \ | ||
-DCMAKE_INSTALL_LIBDIR=lib64 | ||
cmake --build build/blazingmq --parallel 8 --target ${{ inputs.target }} | ||
|
||
- name: Clean-up build directories before caching | ||
if: steps.build-cache-restore-step.outputs.cache-hit != 'true' # Variable type is string, thus using quotes | ||
run: | | ||
find . -name "*.o" -type f -delete | ||
find . -name "*.a" -type f -delete | ||
|
||
- name: Run UT [c++] | ||
if: contains(inputs.target, 'all.t') && inputs.run_unit_tests == true # Variable type is boolean, thus no quotes | ||
run: | | ||
cd ${{ github.workspace }}/build/blazingmq | ||
ctest --output-on-failure -L \^unit\$ | ||
|
||
- name: Fail if requrested to run UTs, they were not built | ||
if: contains(inputs.target, 'all.t') == false && inputs.run_unit_tests == true # Variable type is boolean, thus no quotes | ||
run: | | ||
echo "Unit tests were requested to run, but the target does not include 'all.t'." | ||
echo "Please set the target to include 'all.t' to build unit tests." | ||
exit 1 | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: inputs.save_build_as_artifacts == true # Variable type is boolean, thus no quotes | ||
with: | ||
path: | | ||
build/blazingmq | ||
deps | ||
name: ${{ steps.get_cache_key.outputs.artifact_key }} | ||
retention-days: 1 | ||
|
||
- name: Build Cache Save | ||
# Type of "save_build_as_artifacts" variable is boolean, thus no quotes | ||
# Type of "cache-hit" variable is string, thus using quotes | ||
if: inputs.save_build_as_artifacts == true && steps.build-cache-restore-step.outputs.cache-hit != 'true' | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
build/blazingmq | ||
deps | ||
key: ${{ steps.get_cache_key.outputs.cache_key }} |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.