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

@denik denik 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 denik temporarily deployed to test-trigger-is February 12, 2025 21:48 — with GitHub Actions Inactive
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 denik force-pushed the denik/serverless-template branch from 7a261c9 to 5ac7251 Compare February 12, 2025 21:53
@denik denik temporarily deployed to test-trigger-is February 12, 2025 21:53 — with GitHub Actions Inactive
@denik denik changed the base branch from main to denik/acc-x-databricks-org February 12, 2025 21:53
@denik denik temporarily deployed to test-trigger-is February 12, 2025 21:58 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 12, 2025 22:08 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 12, 2025 22:10 — with GitHub Actions Inactive
github-merge-queue Bot 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 main February 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 denik force-pushed the denik/serverless-template branch from fda87dd to 7d35ea0 Compare February 13, 2025 09:27
@denik denik temporarily deployed to test-trigger-is February 13, 2025 09:27 — with GitHub Actions Inactive
@denik denik changed the base branch from main to denik/acc-diff February 13, 2025 09:29
@denik denik force-pushed the denik/serverless-template branch from 7d35ea0 to d78d857 Compare February 13, 2025 10:09
@denik denik temporarily deployed to test-trigger-is February 13, 2025 10:09 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 13, 2025 10:23 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 13, 2025 10:28 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 13, 2025 12:23 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 14, 2025 09:38 — with GitHub Actions Inactive
@denik denik force-pushed the denik/serverless-template branch from 7c272e9 to ca39cea Compare February 14, 2025 10:16
@denik denik temporarily deployed to test-trigger-is February 14, 2025 10:16 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 14, 2025 10:19 — with GitHub Actions Inactive
@denik denik force-pushed the denik/serverless-template branch from 6a3a987 to 5a5b59c Compare February 14, 2025 10:47
@denik denik temporarily deployed to test-trigger-is February 14, 2025 10:47 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 14, 2025 11:03 — with GitHub Actions Inactive
github-merge-queue Bot 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 main February 14, 2025 11:08
@denik denik temporarily deployed to test-trigger-is February 24, 2025 09:23 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is February 24, 2025 09:39 — with GitHub Actions Inactive
@denik

denik commented Feb 25, 2025

Copy link
Copy Markdown
Contributor Author

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

@denik denik 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 free to 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