Skip to content

Support serverless mode in default-python template - #2348

Closed
denik wants to merge 17 commits into
mainfrom
denik/serverless-template
Closed

Support serverless mode in default-python template#2348
denik wants to merge 17 commits into
mainfrom
denik/serverless-template

Conversation

@denik

@denikdenik commented Feb 12, 2025

Copy link
Copy Markdown
Contributor

Add 'serverless' setting to default-python template. Default is currently set "no" and the setting is not prompted for.

If set to "auto", it will call /settings-api/ to detect serverless support. It falls back to classic in case of errors on that API.

Depends on #2352.

Tests

  • Split default-python into two tests default-python/classic and default-python/serverless.
  • Add acceptance tests for 'auto' mode: returning yes/no/error.
  • Manually check that "bundle init default-python" does not prompt for serverless.
  • Manually check that "bundle init default-python" with serverless=auto can be deployed and run on dogfood.

denik added a commit that referenced this pull request Feb 12, 2025
This is needed for b.WorkspaceClient().CurrentWorkspaceID(ctx) which
is used by initialize_urls.go mutator ("bundle summary") (#2316).
It also also needed for to call serverless endpoint (#2348).
Builds on top of #2338
@denik
denikforce-pushed the denik/serverless-template branch from 7a261c9 to 5ac7251CompareFebruary 12, 2025 21:53
@denik
denik changed the base branch from main to denik/acc-x-databricks-orgFebruary 12, 2025 21:53
github-merge-queueBot pushed a commit that referenced this pull request Feb 13, 2025
This is needed for b.WorkspaceClient().CurrentWorkspaceID(ctx) which is
used by initialize_urls.go mutator ("bundle summary") #2316
It also also needed for to call serverless detection endpoint #2348
Builds on top of #2338
Base automatically changed from denik/acc-x-databricks-org to mainFebruary 13, 2025 07:31
denik added a commit that referenced this pull request Feb 13, 2025
diff.py is like "diff -r -U2" but it applies replacements first to the argument.
This allows comparing different output files and directories but ignore differences
that are going to be replaced by placeholders.
This is useful for tests that record large amount of files, specifically "bundle init" with
standard templates. In those tests, changing one parameter results in a small diff so recording
the full directory is not helpful, because it's hard to see what changed there.
I'm using it in implementation of serverless mode for templates that need it: #2348
Related small changes: add [TESTROOT] replacement for absolute path to acceptance directory in git repo.
Add $TESTDIR env var for absolute path to a given test in git repo.
@denik
denikforce-pushed the denik/serverless-template branch from fda87dd to 7d35ea0CompareFebruary 13, 2025 09:27
@denik
denik changed the base branch from main to denik/acc-diffFebruary 13, 2025 09:29
@denik
denikforce-pushed the denik/serverless-template branch from 7d35ea0 to d78d857CompareFebruary 13, 2025 10:09
@denik
denikforce-pushed the denik/serverless-template branch from 7c272e9 to ca39ceaCompareFebruary 14, 2025 10:16
@denik
denikforce-pushed the denik/serverless-template branch from 6a3a987 to 5a5b59cCompareFebruary 14, 2025 10:47
github-merge-queueBot pushed a commit that referenced this pull request Feb 14, 2025
## Changes
diff.py is like "diff -r -U2" but it applies replacements first to the
argument.
This allows comparing different output files and directories but ignore
differences that are going to be replaced by placeholders.
This is useful for tests that record large amount of files, specifically
"bundle init" with standard templates. In those tests, changing one
parameter results in a small diff so recording the full directory is not
helpful, because it's hard to see what changed there. I'm using it in
implementation of serverless mode for templates that need it: #2348 The
serverless templates are slightly different from classic, capturing the
diff helps to see exactly where.
Related small changes:
- Add [TESTROOT] replacement for absolute path to acceptance directory
in git repo.
- Add $TESTDIR env var for absolute path to a given test in git repo.
## Tests
- New test acceptance/selftest/diff to test the helper.
- Via #2348 which makes use of this feature.
Base automatically changed from denik/acc-diff to mainFebruary 14, 2025 11:08
@denik

Copy link
Copy Markdown
ContributorAuthor

We should rely on the serverless_jobs_ws_nb_enable settings name, see the slack thread I sent you in a DM

After offline discussion, these APIs may have edge cases so for now the safe thing to do is explicit prompt: #2377

@denikdenik closed this Feb 25, 2025
denik added a commit that referenced this pull request Feb 26, 2025
…2377)
## Changes
- Add 'serverless' prompt to default-python template (default is
currently set to "no").
- This is a simplified version of
#2348 with 'auto' functionality
removed.
## Tests
- Split default-python into default-python/classic,
default-python/serverless, default-python/serverless-customcatalog.
- Manually check that "bundle init default-python" with serverless=yes
can be deployed and run on dogfood and test env.
HariGS-DB pushed a commit to HariGS-DB/cli that referenced this pull request Feb 28, 2025
…atabricks#2377)
## Changes
- Add 'serverless' prompt to default-python template (default is
currently set to "no").
- This is a simplified version of
databricks#2348 with 'auto' functionality
removed.
## Tests
- Split default-python into default-python/classic,
default-python/serverless, default-python/serverless-customcatalog.
- Manually check that "bundle init default-python" with serverless=yes
can be deployed and run on dogfood and test env.
@pietern
pietern deleted the denik/serverless-template branch March 3, 2025 09:53
denik added a commit that referenced this pull request May 20, 2026
This is needed for b.WorkspaceClient().CurrentWorkspaceID(ctx) which is
used by initialize_urls.go mutator ("bundle summary") #2316
It also also needed for to call serverless detection endpoint #2348
Builds on top of #2338
denik added a commit that referenced this pull request May 20, 2026
## Changes
diff.py is like "diff -r -U2" but it applies replacements first to the
argument.
This allows comparing different output files and directories but ignore
differences that are going to be replaced by placeholders.
This is useful for tests that record large amount of files, specifically
"bundle init" with standard templates. In those tests, changing one
parameter results in a small diff so recording the full directory is not
helpful, because it's hard to see what changed there. I'm using it in
implementation of serverless mode for templates that need it: #2348 The
serverless templates are slightly different from classic, capturing the
diff helps to see exactly where.
Related small changes:
- Add [TESTROOT] replacement for absolute path to acceptance directory
in git repo.
- Add $TESTDIR env var for absolute path to a given test in git repo.
## Tests
- New test acceptance/selftest/diff to test the helper.
- Via #2348 which makes use of this feature.
denik added a commit that referenced this pull request May 20, 2026
…2377)
## Changes
- Add 'serverless' prompt to default-python template (default is
currently set to "no").
- This is a simplified version of
#2348 with 'auto' functionality
removed.
## Tests
- Split default-python into default-python/classic,
default-python/serverless, default-python/serverless-customcatalog.
- Manually check that "bundle init default-python" with serverless=yes
can be deployed and run on dogfood and test env.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@denik@lennartkats-db@ilia-db