From fa401190c0adb53765f93a2cf8efe298e163d571 Mon Sep 17 00:00:00 2001 From: Joshua Aulet <51500017+JAulet@users.noreply.github.com> Date: Fri, 29 Oct 2021 12:56:06 -0400 Subject: [PATCH] Added yaml_dict.get call to add id to notebook and updated template.yaml to match Katalog. (#245) Signed-off-by: JAulet <51500017+JAulet@users.noreply.github.com> --- .../controllers_impl/notebook_service_controller_impl.py | 2 +- notebooks/template.yaml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/api/server/swagger_server/controllers_impl/notebook_service_controller_impl.py b/api/server/swagger_server/controllers_impl/notebook_service_controller_impl.py index 430c72ab..3edbb370 100644 --- a/api/server/swagger_server/controllers_impl/notebook_service_controller_impl.py +++ b/api/server/swagger_server/controllers_impl/notebook_service_controller_impl.py @@ -388,7 +388,7 @@ def _upload_notebook_yaml(yaml_file_content: AnyStr, name=None, access_token=Non template_metadata = yaml_dict.get("metadata") or dict() - notebook_id = existing_id or generate_id(name=name or yaml_dict["name"]) + notebook_id = existing_id or yaml_dict.get("id") or generate_id(name=name or yaml_dict["name"]) created_at = datetime.now() name = name or yaml_dict["name"] description = yaml_dict["description"].strip() diff --git a/notebooks/template.yaml b/notebooks/template.yaml index d303e681..c8545ce4 100644 --- a/notebooks/template.yaml +++ b/notebooks/template.yaml @@ -1,11 +1,13 @@ # Copyright 2021 The MLX Contributors # # SPDX-License-Identifier: Apache-2.0 -name: # required + +id: # Required, must be DNS-1123 subdomain, lower case alphanumeric characters and '-' +name: # Required description: # Optional metadata: # Optional metadata annotations: platform: -implementation: # required +implementation: # Required github: source: