Skip to content

Commit

Permalink
Add restartPython to pip block to fix python sdk version
Browse files Browse the repository at this point in the history
  • Loading branch information
dbbnicole committed Sep 1, 2023
1 parent 08c95e6 commit 58abca5
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions RUNME.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
# Databricks notebook source
# MAGIC %md This notebook sets up the companion cluster(s) to run the solution accelerator. It also creates the Workflow to illustrate the order of execution. Happy exploring!
# MAGIC 🎉
# MAGIC
# MAGIC
# MAGIC **Steps**
# MAGIC 1. Simply attach this notebook to a cluster and hit Run-All for this notebook. A multi-step job and the clusters used in the job will be created for you and hyperlinks are printed on the last block of the notebook.
# MAGIC
# MAGIC
# MAGIC 2. Run the accelerator notebooks: Feel free to explore the multi-step job page and **run the Workflow**, or **run the notebooks interactively** with the cluster to see how this solution accelerator executes.
# MAGIC
# MAGIC
# MAGIC 2a. **Run the Workflow**: Navigate to the Workflow link and hit the `Run Now` 💥.
# MAGIC
# MAGIC 2b. **Run the notebooks interactively**: Attach the notebook with the cluster(s) created and execute as described in the `job_json['tasks']` below.
# MAGIC
# MAGIC
# MAGIC **Prerequisites**
# MAGIC 1. You need to have cluster creation permissions in this workspace.
# MAGIC
# MAGIC
# MAGIC 2. In case the environment has cluster-policies that interfere with automated deployment, you may need to manually create the cluster in accordance with the workspace cluster policy. The `job_json` definition below still provides valuable information about the configuration these series of notebooks should run with.
# MAGIC
# MAGIC
# MAGIC **Notes**
# MAGIC 1. The pipelines, workflows and clusters created in this script are not user-specific. Keep in mind that rerunning this script again after modification resets them for other users too.
# MAGIC
# MAGIC
# MAGIC 2. If the job execution fails, please confirm that you have set up other environment dependencies as specified in the accelerator notebooks. Accelerators may require the user to set up additional cloud infra or secrets to manage credentials.

# COMMAND ----------

# DBTITLE 0,Install util packages
# MAGIC %pip install git+https://github.com/databricks-academy/[email protected] git+https://github.com/databricks-industry-solutions/notebook-solution-companion@safe-print-html --quiet --disable-pip-version-check
# MAGIC dbutils.library.restartPython()

# COMMAND ----------

Expand All @@ -34,10 +35,10 @@

# MAGIC %md
# MAGIC Before setting up the rest of the accelerator, we need set up a few credentials in order to access ____. Grab ___ key for your ___ account ([documentation](https://www.kaggle.com/docs/api#getting-started-installation-&-authentication) here). Here we demonstrate using the [Databricks Secret Scope](https://docs.databricks.com/security/secrets/secret-scopes.html) for credential management.
# MAGIC
# MAGIC
# MAGIC Copy the block of code below, replace the name the secret scope and fill in the credentials and execute the block. After executing the code, The accelerator notebook will be able to access the credentials it needs.
# MAGIC
# MAGIC
# MAGIC
# MAGIC
# MAGIC ```
# MAGIC client = NotebookSolutionCompanion().client
# MAGIC try:
Expand All @@ -49,7 +50,7 @@
# MAGIC "key": "kaggle_username",
# MAGIC "string_value": "____"
# MAGIC })
# MAGIC
# MAGIC
# MAGIC client.execute_post_json(f"{client.endpoint}/api/2.0/secrets/put", {
# MAGIC "scope": "solution-accelerator-cicd",
# MAGIC "key": "kaggle_key",
Expand Down

0 comments on commit 58abca5

Please sign in to comment.