Compare commits

..
3 changed files with 11 additions and 20 deletions
+5 -6
View File
@@ -26,9 +26,6 @@ from utils import util
# This script is used to execute a notebook and write out the output notebook.
# This is used to force papermill to use this kernel to run the notebook instead of any defined inside the notebook itself
DEFAULT_KERNEL_NAME = "python3"
def execute_notebook(
notebook_source: str,
@@ -53,11 +50,14 @@ def execute_notebook(
execution_exception = None
print("\n=== DOWNLOAD EXECUTED NOTEBOOK ===\n")
print(f"Please debug the executed notebook by downloading the executed notebook:")
print(
f"Please debug the executed notebook by downloading the executed notebook:"
)
print("Option 1. Using gsutil. Run the following command in your terminal.")
print(f'\tgsutil cp "{output_file_or_uri}" .')
print(f"\tgsutil cp \"{output_file_or_uri}\" .")
print("Option 2. Using this link.")
print(f"\thttps://storage.googleapis.com/{output_file_or_uri[5:]}")
@@ -72,7 +72,6 @@ def execute_notebook(
output_path=notebook_source,
progress_bar=should_log_output,
request_save_on_cell_execute=should_log_output,
kernel_name=DEFAULT_KERNEL_NAME,
log_output=should_log_output,
stdout_file=sys.stdout if should_log_output else None,
stderr_file=sys.stderr if should_log_output else None,
@@ -1068,7 +1068,7 @@
"model = aiplatform.Model.upload(\n",
" display_name=\"movies_\" + TIMESTAMP,\n",
" artifact_uri=SAVEDMODEL_DIR,\n",
" serving_container_image_uri=DEPLOY_IMAGE,\n",
" serving_container_image_uri=DELOY_IMAGE,\n",
")"
]
},
@@ -214,7 +214,7 @@
"if not os.getenv(\"IS_TESTING\"):\n",
" # Automatically restart kernel after installs\n",
" import IPython\n",
"\n",
" \n",
" app = IPython.Application.instance()\n",
" app.kernel.do_shutdown(True)"
]
@@ -675,18 +675,6 @@
"!./swivel_template_configuration.sh -pipeline_suffix {YOUR_PIPELINE_SUFFIX} -project_number {PROJECT_NUMBER} -project_id {PROJECT_ID} -machine_type {MACHINE_TYPE} -accelerator_count {ACCELERATOR_COUNT} -accelerator_type {ACCELERATOR_TYPE} -pipeline_root {BUCKET}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "1cacea95d68c"
},
"outputs": [],
"source": [
"! sed \"s:\\t: :g\" swivel_pipeline_basic.json >tmp.json\n",
"! mv tmp.json swivel_pipeline_basic.json"
]
},
{
"cell_type": "markdown",
"metadata": {
@@ -777,15 +765,19 @@
"# Instantiate PipelineJob object\n",
"pl = aiplatform.PipelineJob(\n",
" display_name=YOUR_PIPELINE_SUFFIX,\n",
"\n",
" # Whether or not to enable caching\n",
" # True = always cache pipeline step result\n",
" # False = never cache pipeline step result\n",
" # None = defer to cache option for each pipeline component in the pipeline definition\n",
" enable_caching=False,\n",
"\n",
" # Local or GCS path to a compiled pipeline definition\n",
" template_path=\"swivel_pipeline_basic.json\",\n",
"\n",
" # Dictionary containing input parameters for your pipeline\n",
" parameter_values=PARAMETER_VALUES,\n",
"\n",
" # GCS path to act as the pipeline root\n",
" pipeline_root=PIPELINE_ROOT,\n",
")\n",