Skip to content

Commit ac25d32

Browse files
authored
Add serverless support to the extension (#1539)
## Changes - Cluster quick-pick now has a new "Serverless" option - Connection manager now has a new `serverless` mode - EnvironmentDependenciesVerifier doesn't force a cluster if serverless mode is enabled - But if now requires a higher Databricks Connect version - EnvironmentDependenciesInstaller is also updated to install a more appropriate dbconnect version - We now inject DATABRICKS_SERVERLESS_COMPUTE_ID env var when serverless is enabled - Run file as Workflow command automatically - The run logic was moved from Cluster to WorkflowRun - Updated workflow output panel UI to show serverless when it's enabled - Upload and run file command is disabled in the serverless mode - Fix for the python wrapper to avoid exceptions when .venv folder is removed at runtime Follow ups: - Automatically enable serverless mode if the selected .databrickscfg profile has `serverless_compute_id = auto` - Figure out if we can check if a workspace has serverless enabled before offering to use it - Integ tests in a serverless-enabled environment (and we should finally cover dbconnect logic) <!-- Summary of your changes that are easy to understand --> ## Tests Manual, a few new unit tests, integ tests will be in a follow-up
1 parent 0360025 commit ac25d32

33 files changed

+420
-240
lines changed

.github/workflows/create-build-artifacts.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
shell: bash
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818

1919
- name: Use Node.js 18
20-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2121
with:
2222
node-version: 18
2323
cache: "yarn"
@@ -30,7 +30,7 @@ jobs:
3030
GH_TOKEN: ${{ github.token }}
3131
BUILD_PLATFORM_ARCH: linux_amd64
3232

33-
- uses: actions/upload-artifact@v3
33+
- uses: actions/upload-artifact@v4
3434
with:
3535
name: databricks
3636
path: "packages/databricks-vscode/*.vsix"

.github/workflows/create-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
labels: ubuntu-latest-deco
2222

2323
steps:
24-
- uses: actions/checkout@v3
25-
- uses: actions/download-artifact@v3
24+
- uses: actions/checkout@v4
25+
- uses: actions/download-artifact@v4
2626
id: download
2727
with:
2828
path: build

.github/workflows/nightly-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
labels: ubuntu-latest-deco
1919

2020
steps:
21-
- uses: actions/download-artifact@v3
21+
- uses: actions/download-artifact@v4
2222
with:
2323
path: packages/databricks-vscode
2424

.github/workflows/publish-to-openvsx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Use Node.js 18.x
24-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v4
2525
with:
2626
node-version: 18.x
2727

.github/workflows/publish-to-vscode.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Use Node.js 18.x
24-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v4
2525
with:
2626
node-version: 18.x
2727

.github/workflows/push.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
name: Package Arm64 VSIX
1212
runs-on: "macos-latest"
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515

16-
- name: Use Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v3
16+
- name: Use Node.js 18.x
17+
uses: actions/setup-node@v4
1818
with:
19-
node-version: ${{ matrix.node-version }}
19+
node-version: 18.x
2020
cache: "yarn"
2121

2222
- run: yarn install --immutable
@@ -37,7 +37,7 @@ jobs:
3737
working-directory: packages/databricks-vscode
3838

3939
- name: Upload artifacts
40-
uses: actions/upload-artifact@v3
40+
uses: actions/upload-artifact@v4
4141
with:
4242
name: VSIX artifacts
4343
path: packages/databricks-vscode/artifacts

.github/workflows/release-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
matrix:
2626
node-version: [18.x]
2727
steps:
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2929
with:
3030
fetch-depth: 0
3131

@@ -39,7 +39,7 @@ jobs:
3939
git config --global user.email "[email protected]"
4040
4141
- name: Use Node.js ${{ matrix.node-version }}
42-
uses: actions/setup-node@v3
42+
uses: actions/setup-node@v4
4343
with:
4444
node-version: ${{ matrix.node-version }}
4545
cache: "yarn"

.github/workflows/unit-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ jobs:
2929
shell: bash
3030

3131
steps:
32-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v4
3333

3434
- name: Use Node.js ${{ matrix.node-version }}
35-
uses: actions/setup-node@v3
35+
uses: actions/setup-node@v4
3636
with:
3737
node-version: ${{ matrix.node-version }}
3838
cache: "yarn"
3939

4040
- name: Cache VSCode unit test runner
41-
uses: actions/cache@v3
41+
uses: actions/cache@v4
4242
with:
4343
path: /tmp/vscode-test-databricks
4444
key: ${{ matrix.arch.cli_arch }}-${{ matrix.vscode-version }}-vscode-test

.github/workflows/update-cli-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
node-version: [18.x]
1919

2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0
2424

packages/databricks-vscode/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
"command": "databricks.run.runEditorContents",
125125
"title": "Upload and Run File",
126126
"category": "Databricks",
127-
"enablement": "!inDebugMode && databricks.context.activated && databricks.context.loggedIn",
127+
"enablement": "!inDebugMode && databricks.context.activated && databricks.context.loggedIn && !databricks.context.serverless",
128128
"icon": {
129129
"dark": "resources/dark/databricks-run-icon.svg",
130130
"light": "resources/light/databricks-run-icon.svg"
@@ -778,7 +778,7 @@
778778
},
779779
{
780780
"command": "databricks.run.runEditorContents",
781-
"when": "databricks.context.activated && resourceLangId == python",
781+
"when": "databricks.context.activated && resourceLangId == python && !databricks.context.serverless",
782782
"group": "2_remote@1"
783783
},
784784
{

0 commit comments

Comments
 (0)