sagemaker-explaining-credit-decisions icon indicating copy to clipboard operation
sagemaker-explaining-credit-decisions copied to clipboard

Cell fails in 5_dashboard

Open juliensimon opened this issue 5 years ago • 1 comments

Calling get_notebook_name() fails with KeyError: 'SolutionPrefix'

port = 8501
url = get_dashboard_url(port)
!echo Dashboard URL: {url}
!(cd ../containers/dashboard/src && streamlit run app.py --server.port {port})

KeyError Traceback (most recent call last) in 1 port = 8501 ----> 2 url = get_dashboard_url(port) 3 get_ipython().system('echo Dashboard URL: {url}') 4 get_ipython().system('(cd ../containers/dashboard/src && streamlit run app.py --server.port {port})')

in get_dashboard_url(port) 8 9 def get_dashboard_url(port): ---> 10 notebook_name = get_notebook_name() 11 region_name = sagemaker.Session().boto_region_name 12 return f"https://{notebook_name}.notebook.{region_name}.sagemaker.aws/proxy/{port}/"

in get_notebook_name() 2 with open('/opt/ml/metadata/resource-metadata.json') as openfile: 3 data = json.load(openfile) ----> 4 notebook_name = data['SolutionPrefix'] 5 return notebook_name 6 #return 'sm-soln-explaining-credit-decisions-notebook'

KeyError: 'SolutionPrefix'

juliensimon avatar Oct 26 '20 10:10 juliensimon

Seems there was an overzealous find and replace. It should be ResourceName. I'll change this back.

thomelane avatar Oct 28 '20 23:10 thomelane