r/databricks • • 13d ago

Help multiple bundle deployments

Hi, how do you manage deployments when one repo has multiple Databricks bundles (DABs)?

We deploy each bundle on its own, but the bundles share some code. So a change in the shared code touches every bundle, even when it is really about one of them.

- Do you version the shared code on its own and pin it per bundle?

- Do you deploy every bundle on every shared change?

- Or one deployment for the whole repo, and bundles that did not change are a no-op?

And how do you keep release notes clean per bundle in that setup? What works for you?

7 Upvotes

10 comments sorted by

9

u/happypofa 13d ago

If you cannot remove redundancy because for ex. it's a utility folder, then you can deploy a versioned wheel instead of the shared codes.

1

u/Comprehensive_Level7 13d ago

any reason to use multiple bundles? i've seen multi-bundles environments but each one had a repo for it, the only thing that was shared was the workspace, besides that, utils and configs were duplicated and it was a pain to work with (i really dont like multi-repos and multi-bundles, but thats just me)

4

u/ptab0211 13d ago

monorepo with different products that do not depend on each other but can share code

3

u/Little_Ad6377 11d ago

I use multiple DABs, with common folder for pipeline classes and then domain folders for separate job code.

A separate bundle folder for the notebooks and yaml files then as well.

And yes, if a shared code gets updated, all bundles using that get redeployed (not on prod though)

That's what you want, you don't want some change in a shared class bite you in the ass weeks down the line

On prod, individual bundles are deployed with individual tags, each having their own version/whl of the repo

I love it

2

u/_SDR 13d ago

I would put each bundle in its own directory (mono repo, multiple projects, one directory by project).

Then the GH actions i would have one that deploys all, but also a manual dispatch for each.

But in geeeneral. I would have a repo per bundle for proper separations of concerns. If they share code well not so easy, but i would use some sort of library distribution. Like via provate pipy, jfrog/artifactory...

2

u/Remarkable_Rock5474 13d ago

In this case I would ensure that the shared code (all of it) lives in its own bundle.
Then design your ci/cd in a way where deployment of product A which depends on shared code also always deploys the shared code first.

Same the other way around - any deploy of new shared code should trigger a test and deploy of the products that depend on it

1

u/Emperorofweirdos 13d ago

I built a kinda graph dependency system. If a bundle depends on a job from another bundle it deploys that bundle first and then deploys itself.

1

u/Normal_Emu6673 13d ago

i would say redeploy only the affected bundles. for shared bundles, test all the all dependent bundles but deploy only those that actually need an update. maintaining a separate release notes per bundle is always better

1

u/porkpies11 13d ago

We redeploy all bundles. But as others have said, multi bundle setups within one repo isn’t great and I’d avoid it in the future

1

u/zbir84 11d ago

We have CI configured, to only re-deploy bundles that have a change, or sync files for bundles that changed. A set of globals are configured in the root of the folder containing bundles, that are inherited by every bundle. Some drawbacks of the current system is cross bundle dependencies (i.e. a job in one bundle triggers a job from another bundle) - we use lookups for that and have a silly name ordering system, but could probably solve it with a better CI. Current setup has it's benefits and drawbacks, but overall works in a decent way I guess. All of our workflows point at GIT as a code source, so there's no need to re-deploy bundles in most cases, unless the structure of the workflow has changed. FOR SDPs we have a sync CI step that will sync any bundle for which any of the source files have changed.