Skip to content

CI: Improve caching to avoid unnecessary builds#84

Merged
pniedzielski merged 8 commits into
bloomberg:mainfrom
pniedzielski:chore/bump-blazingmq-ci-cache
Jun 26, 2026
Merged

CI: Improve caching to avoid unnecessary builds#84
pniedzielski merged 8 commits into
bloomberg:mainfrom
pniedzielski:chore/bump-blazingmq-ci-cache

Conversation

@pniedzielski

Copy link
Copy Markdown
Collaborator

When we added an explicit tag to pin libbmq to in CI, we didn’t update the caching logic in CI. As such, every time the BlazingMQ’s repo’s main branch changes, the Python SDK’s CI rebuilds its dependencies, even if we’ve already built all dependencies at their pinned tags. This patch uses a hash of the bin/clone-dependencies.sh script as the cache key to avoid these unnecessary builds.

@pniedzielski pniedzielski requested a review from a team as a code owner May 20, 2026 17:21
@pniedzielski pniedzielski force-pushed the chore/bump-blazingmq-ci-cache branch 2 times, most recently from 1c3ffd1 to 63699dd Compare May 20, 2026 18:25
@pniedzielski pniedzielski added the skip news No news entry is required label May 20, 2026
@pniedzielski pniedzielski force-pushed the chore/bump-blazingmq-ci-cache branch 2 times, most recently from 06a3509 to e190755 Compare May 20, 2026 21:33
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
`git clone --depth 1` can fail to fetch an annotated tag (which has a
different SHA than the object it points to).  This patch performs the
the real solution, to not do a shallow clone.  A full clone is a
little more expensive than a shallow clone, but not by much, and we
only need to do this when we update our dependencies.

Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
When we added an explicit tag to pin libbmq to in CI, we didn’t update
the caching logic in CI.  As such, every time the BlazingMQ’s repo’s
`main` branch changes, the Python SDK’s CI rebuilds its dependencies,
even if we’ve already built all dependencies at their pinned tags.
This patch uses a hash of the `bin/clone-dependencies.sh` script as
the cache key to avoid these unnecessary builds.

Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
@pniedzielski pniedzielski force-pushed the chore/bump-blazingmq-ci-cache branch 4 times, most recently from 32ad7ec to 93d46f7 Compare June 22, 2026 17:42
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
@pniedzielski pniedzielski force-pushed the chore/bump-blazingmq-ci-cache branch from 93d46f7 to 4b0f488 Compare June 22, 2026 18:38
@pniedzielski pniedzielski requested a review from 678098 June 22, 2026 19:35
Comment thread bin/clone-dependencies.sh
--branch ${BDE_TOOLS_TAG} \
https://github.com/bloomberg/bde-tools \
"${DIR_THIRDPARTY}/bde-tools"
git -C "${DIR_THIRDPARTY}/bde-tools" checkout ${BDE_TOOLS_TAG}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The original git clone was a targeted shallow clone. It is not shallow anymore, more work is done, and it might take some time when cloning huge repos.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is intentional. We need to do this to clone annotated tags.

Comment thread bin/build-manylinux.sh
git clone --depth 1 https://github.com/google/benchmark.git "${DIR_THIRDPARTY}/google-benchmark"
fi
if [ ! -d "${DIR_THIRDPARTY}/googletest" ]; then
git clone --depth 1 https://github.com/google/googletest.git "${DIR_THIRDPARTY}/googletest"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Might be good to pin 3rd party revisions.
I am not that concerned about bde/ntf etc

@678098 678098 assigned pniedzielski and unassigned 678098 Jun 22, 2026
@pniedzielski pniedzielski merged commit 54965fb into bloomberg:main Jun 26, 2026
11 checks passed
@pniedzielski pniedzielski deleted the chore/bump-blazingmq-ci-cache branch June 26, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news No news entry is required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants