Skip to content

Commit

Permalink
Move uploading and cleaning Databricks workspace initscripts into the…
Browse files Browse the repository at this point in the history
… common functions

Signed-off-by: Tim Liu <timl@nvidia.com>
  • Loading branch information
NvTimLiu committed Aug 23, 2023
1 parent 06ec24d commit 089bee3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Binary file modified docs/img/Databricks/initscript_ucx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions jenkins/Jenkinsfile-blossom.premerge-databricks
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,8 @@ void databricksBuild() {

// handle init scripts if exist
if (env.INIT_SCRIPTS) {
sh "bash -c 'databricks workspace mkdirs $ws_path'"
env.INIT_SCRIPTS.split(',').each {
sh "bash -c 'databricks workspace import --overwrite -l R jenkins/databricks/${it} $ws_path/${it}'"
}
// foo.sh,bar.sh --> /path/foo.sh,/path/bar.sh
CREATE_PARAMS += " -f $ws_path/" + env.INIT_SCRIPTS.replace(',', ",$ws_path/")
CREATE_PARAMS += " -f " + DbUtils.uploadFiles(this, env.INIT_SCRIPTS, env.INIT_SCRIPTS_DIR)
}

CLUSTER_ID = sh(script: "python3 ./jenkins/databricks/create.py $CREATE_PARAMS",
Expand Down Expand Up @@ -194,7 +190,7 @@ void databricksBuild() {
container('cpu') {
retry(3) {
if (env.INIT_SCRIPTS) {
sh "bash -c 'databricks workspace rm -r $ws_path'"
DbUtils.cleanUp(this, env.INIT_SCRIPTS_DIR)
}
sh "python3 ./jenkins/databricks/shutdown.py -s $DATABRICKS_HOST -t $DATABRICKS_TOKEN -c $CLUSTER_ID -d"
}
Expand Down

0 comments on commit 089bee3

Please sign in to comment.