Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions acceptance/bundle/generate/pipeline_and_deploy/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bundle:
name: pipeline_and_deploy
2 changes: 2 additions & 0 deletions acceptance/bundle/generate/pipeline_and_deploy/notebook.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Databricks notebook source
print("Hello world!")
3 changes: 3 additions & 0 deletions acceptance/bundle/generate/pipeline_and_deploy/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions acceptance/bundle/generate/pipeline_and_deploy/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

=== Upload files to workspace
>>> [CLI] workspace import /Workspace/Users/[USERNAME]/notebook.py --file notebook.py --format AUTO --overwrite

>>> [CLI] workspace import /Workspace/Users/[USERNAME]/test.py --file test.py --format AUTO --overwrite

=== Create a pipeline that references the filesCreated pipeline

=== Generate bundle config from the pipelineFile successfully saved to src/notebook.py
File successfully saved to src/test.py
Pipeline configuration successfully saved to resources/out.pipeline.yml

=== Verify generated yaml has expected fields
=== Deploy the generated bundle
>>> [CLI] bundle deploy
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/pipeline_and_deploy/default/files...
Deploying resources...
Deployment complete!

=== Destroy the deployed bundle
>>> [CLI] bundle destroy --auto-approve
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/pipeline_and_deploy/default

Deleting files...
Destroy complete!

=== Cleanup: delete the original pipeline and files
>>> errcode [CLI] pipelines delete [PIPELINE_ID]

>>> errcode [CLI] workspace delete /Workspace/Users/[USERNAME]/notebook

>>> errcode [CLI] workspace delete /Workspace/Users/[USERNAME]/test.py
42 changes: 42 additions & 0 deletions acceptance/bundle/generate/pipeline_and_deploy/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
title "Upload files to workspace"
trace $CLI workspace import "/Workspace/Users/${CURRENT_USER_NAME}/notebook.py" --file notebook.py --format AUTO --overwrite
trace $CLI workspace import "/Workspace/Users/${CURRENT_USER_NAME}/test.py" --file test.py --format AUTO --overwrite

title "Create a pipeline that references the files"
PIPELINE_ID=$($CLI pipelines create --json '{
"name": "test-pipeline",
"libraries": [
{
"notebook": {
"path": "/Workspace/Users/'${CURRENT_USER_NAME}'/notebook"
}
},
{
"file": {
"path": "/Workspace/Users/'${CURRENT_USER_NAME}'/test.py"
}
}
]
}' | jq -r '.pipeline_id')
echo "Created pipeline"
add_repl.py "$PIPELINE_ID" PIPELINE_ID

cleanup() {
title "Cleanup: delete the original pipeline and files"
trace errcode $CLI pipelines delete "$PIPELINE_ID"
trace errcode $CLI workspace delete "/Workspace/Users/${CURRENT_USER_NAME}/notebook"
trace errcode $CLI workspace delete "/Workspace/Users/${CURRENT_USER_NAME}/test.py"
}
trap cleanup EXIT

title "Generate bundle config from the pipeline"
$CLI bundle generate pipeline --existing-pipeline-id "$PIPELINE_ID" --key out --config-dir resources --source-dir src --force 2>&1 | sort

title "Verify generated yaml has expected fields"
cat resources/out.pipeline.yml | contains.py "libraries:" "- notebook:" "path: ../src/notebook.py" "- file:" "path: ../src/test.py" > /dev/null

title "Deploy the generated bundle"
trace $CLI bundle deploy

title "Destroy the deployed bundle"
trace $CLI bundle destroy --auto-approve
1 change: 1 addition & 0 deletions acceptance/bundle/generate/pipeline_and_deploy/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Hello!")
13 changes: 13 additions & 0 deletions acceptance/bundle/generate/pipeline_and_deploy/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Local = true
Cloud = true

Ignore = [
"databricks.yml",
"resources/*",
"src/*",
".databricks",
]

[Env]
# MSYS2 automatically converts absolute paths on Windows; disable for the workspace path.
MSYS_NO_PATHCONV = "1"
139 changes: 0 additions & 139 deletions integration/bundle/generate_pipeline_test.go

This file was deleted.

Loading