Skip to content

Commit 5b91982

Browse files
Add getting started documentation (#82)
Co-authored-by: Kartik Gupta <88345179+kartikgupta-db@users.noreply.github.com>
1 parent 79a6d65 commit 5b91982

File tree

13 files changed

+371
-237
lines changed

13 files changed

+371
-237
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
"homepage": "https://github.com/databricks/databricks-vscode#readme",
3030
"packageManager": "yarn@3.2.1",
3131
"devDependencies": {
32-
"@typescript-eslint/eslint-plugin": "^5.33.0",
33-
"@typescript-eslint/parser": "^5.33.0",
34-
"eslint": "^8.21.0",
32+
"@typescript-eslint/eslint-plugin": "^5.37.0",
33+
"@typescript-eslint/parser": "^5.37.0",
34+
"eslint": "^8.23.1",
3535
"eslint-config-prettier": "^8.5.0",
3636
"ts-mockito": "^2.6.1",
37-
"typescript": "^4.7.4"
37+
"typescript": "^4.8.3"
3838
}
3939
}

packages/databricks-sdk-js/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"test:integ:cov": "nyc --report-dir ./coverage/integration yarn run test:integ"
3030
},
3131
"dependencies": {
32-
"ini": "^3.0.0",
32+
"ini": "^3.0.1",
3333
"node-fetch": "^3.2.10"
3434
},
3535
"devDependencies": {
@@ -39,13 +39,13 @@
3939
"@types/chai-spies": "^1.0.3",
4040
"@types/ini": "^1.3.31",
4141
"@types/mocha": "^9.1.1",
42-
"@types/node": "^18.7.1",
42+
"@types/node": "^18.7.17",
4343
"@types/tmp": "^0.2.3",
4444
"@types/uuid": "^8.3.4",
4545
"chai": "^4.3.6",
4646
"chai-as-promised": "^7.1.1",
4747
"chai-spies": "^1.0.0",
48-
"eslint": "^8.20.0",
48+
"eslint": "^8.23.1",
4949
"mocha": "^10.0.0",
5050
"nyc": "^15.1.0",
5151
"prettier": "^2.7.1",
@@ -54,8 +54,8 @@
5454
"ts-mocha": "^10.0.0",
5555
"ts-mockito": "^2.6.1",
5656
"ts-node": "^10.9.1",
57-
"typescript": "^4.7.4",
58-
"uuid": "^8.3.2"
57+
"typescript": "^4.8.3",
58+
"uuid": "^9.0.0"
5959
},
6060
"nyc": {
6161
"extends": "@istanbuljs/nyc-config-typescript",

packages/databricks-vscode/.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dist/**
44
node_modules/**
55
src/**
66
.gitignore
7+
.prettierignore
78
.yarnrc
89
**/tsconfig.json
910
**/.eslintrc.json
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Databricks Extension for VSCode
2+
3+
The Databricks extension for VSCode allows you to develop for the Databricks Lakehouse platform from VSCode.
4+
5+
# Features
6+
7+
- Synchronize code to a Databricks workspace
8+
- Run Python files on a Databricks cluster
9+
- Run notebooks and Python files as Jobs
10+
11+
---
12+
13+
# <a id="setup-steps"></a>Getting Started
14+
15+
## Install extension
16+
17+
1. Download and install dbx: `pip install dbx`
18+
2. Download the nightly release matching your platform from https://github.com/databricks/databricks-vscode/releases
19+
3. Install the downloaded extension using the "Extensions: Install from VSIX..." command (Cmd-Shift-P)
20+
21+
## Configure Extension
22+
23+
1. Open the Databricks panel by clicking on the Databricks icon on the left
24+
2. Click the "Configure Databricks" button
25+
3. Follow the wizard to select or configure a CLI profile
26+
4. Click the "plug" icon in the clusters tree item to select an interactive cluster for running code on (you might have to create a cluster in the web UI first if none is available)
27+
5. Click the "plug" icon in the Repo tree item to select an repo to sync code to (you might have to create a repo in the web UI first if none is available. The repo doesn't need to have a git remote configured.)
28+
29+
![configure](./images/configure.gif)
30+
31+
## Running Code
32+
33+
Once you have your project configured you can sync your local code to the repo and run it on a cluster.
34+
35+
### Running PySpark code
36+
37+
1. Create python file
38+
2. Click the "Run" icon in the tab bar and select "Run File on Databricks"
39+
40+
This will run the active python file on a cluster using the command execution API. The result is printed in the "debug" output panel.
41+
42+
![configure](./images/run.gif)
43+
44+
### Running PySpark and notebooks as a Workflow
45+
46+
1. Create a python file or a python based notebook
47+
2. Click the "Run" icon in the tab bar and select "Run File as Workflow on Databricks"
48+
49+
This will run the file using the Jobs API on a cluster and render the result in a WebView.
50+
51+
### Running using custom run configurations
52+
53+
Both ways of running code on a cluster are also available in custom run configurations. In the "Run and Debug" panel you can click "Add configuration..." and select either "Databricks: Launch" or "Databricks: Launch as Workflow". Using run configuration you can also pass in command line arguments and run your code by simply pressing `F5`.
54+
55+
![configure](./images/custom-runner.gif)
969 KB
Loading
2.47 MB
Loading
963 KB
Loading

packages/databricks-vscode/package.json

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"onCommand:databricks.run.getProgramName",
5757
"onCommand:databricks.run.runEditorContentsAsWorkflow",
5858
"onCommand:databricks.run.runEditorContents",
59+
"onCommand:databricks.quickstart.open",
5960
"onView:configurationView",
6061
"onView:clusterView",
6162
"onTaskType:databricks",
@@ -156,6 +157,10 @@
156157
"category": "Databricks",
157158
"enablement": "!inDebugMode",
158159
"icon": "$(play)"
160+
},
161+
{
162+
"command": "databricks.quickstart.open",
163+
"title": "Databricks: Open Quickstart"
159164
}
160165
],
161166
"viewsContainers": {
@@ -457,30 +462,30 @@
457462
"dependencies": {
458463
"@databricks/databricks-sdk": "*",
459464
"@vscode/debugadapter": "^1.57.0",
460-
"@vscode/webview-ui-toolkit": "^1.0.0"
465+
"@vscode/webview-ui-toolkit": "^1.0.1"
461466
},
462467
"devDependencies": {
463468
"@istanbuljs/nyc-config-typescript": "^1.0.2",
464-
"@types/glob": "^7.2.0",
469+
"@types/glob": "^8.0.0",
465470
"@types/mocha": "^9.1.1",
466-
"@types/node": "^18.7.1",
471+
"@types/node": "^18.7.17",
467472
"@types/tmp": "^0.2.3",
468-
"@types/vscode": "^1.69.1",
469-
"@typescript-eslint/eslint-plugin": "^5.33.0",
470-
"@typescript-eslint/parser": "^5.33.0",
473+
"@types/vscode": "^1.69.0",
474+
"@typescript-eslint/eslint-plugin": "^5.37.0",
475+
"@typescript-eslint/parser": "^5.37.0",
471476
"@vscode/test-electron": "^2.1.5",
472-
"esbuild": "^0.15.1",
473-
"eslint": "^8.21.0",
477+
"esbuild": "^0.15.7",
478+
"eslint": "^8.23.1",
474479
"glob": "^8.0.3",
475480
"mocha": "^10.0.0",
476481
"nyc": "^15.1.0",
477482
"prettier": "^2.7.1",
478483
"tmp-promise": "^3.0.3",
479484
"ts-mockito": "^2.6.1",
480-
"typescript": "^4.7.4",
481-
"vsce": "^2.10.0",
485+
"typescript": "^4.8.3",
486+
"vsce": "^2.11.0",
482487
"vscode-extension-tester": "^4.4.1",
483-
"winston": "^3.8.1"
488+
"winston": "^3.8.2"
484489
},
485490
"nyc": {
486491
"extends": "@istanbuljs/nyc-config-typescript",

packages/databricks-vscode/src/configuration/ConfigurationDataProvider.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ describe(__filename, () => {
145145
color: undefined,
146146
id: "repo",
147147
},
148-
id: "WORKSPACE",
149-
label: 'Workspace - "None attached"',
148+
id: "REPO",
149+
label: 'Repo - "None attached"',
150150
},
151151
]);
152152
});

packages/databricks-vscode/src/configuration/ConfigurationDataProvider.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ export class ConfigurationDataProvider
9292

9393
if (syncDestination) {
9494
children.push({
95-
label: `Workspace`,
95+
label: `Repo`,
9696
iconPath: new ThemeIcon("repo"),
97-
id: "WORKSPACE",
97+
id: "REPO",
9898
collapsibleState: TreeItemCollapsibleState.Expanded,
9999
contextValue:
100100
this.sync.state === "RUNNING"
@@ -103,9 +103,9 @@ export class ConfigurationDataProvider
103103
});
104104
} else {
105105
children.push({
106-
label: `Workspace - "None attached"`,
106+
label: `Repo - "None attached"`,
107107
iconPath: new ThemeIcon("repo"),
108-
id: "WORKSPACE",
108+
id: "REPO",
109109
collapsibleState: TreeItemCollapsibleState.Expanded,
110110
contextValue: "syncDetached",
111111
});
@@ -139,7 +139,7 @@ export class ConfigurationDataProvider
139139
];
140140
}
141141

142-
if (element.id === "WORKSPACE" && syncDestination) {
142+
if (element.id === "REPO" && syncDestination) {
143143
return [
144144
{
145145
label: `Sync state:`,

0 commit comments

Comments
 (0)