Get Studio Classic Notebook and App Metadata
Important
As of November 30, 2023, the previous Amazon SageMaker Studio experience is now named Amazon SageMaker Studio Classic. The following section is specific to using the Studio Classic application. For information about using the updated Studio experience, see Amazon SageMaker Studio.
You can access notebook metadata and App metadata using the Amazon SageMaker Studio Classic UI.
Get Studio Classic Notebook Metadata
Jupyter notebooks contain optional metadata that you can access through the Amazon SageMaker Studio Classic UI.
To view the notebook metadata:
-
In the right sidebar, choose the Property Inspector icon ( ).
-
Open the Advanced Tools section.
The metadata should look similar to the following.
{ "instance_type": "ml.t3.medium", "kernelspec": { "display_name": "Python 3 (Data Science)", "language": "python", "name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:<acct-id>:image/datascience-1.0" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.10" } }
Get App Metadata
When you create a notebook in Amazon SageMaker Studio Classic, the App metadata is written to a file
named resource-metadata.json
in the folder
/opt/ml/metadata/
. You can get the App metadata by opening an Image
terminal from within the notebook. The metadata gives you the following information, which
includes the SageMaker AI image and instance type the notebook runs in:
-
AppType –
KernelGateway
-
DomainId – Same as the Studio ClassicID
-
UserProfileName – The profile name of the current user
-
ResourceArn – The Amazon Resource Name (ARN) of the App, which includes the instance type
-
ResourceName – The name of the SageMaker AI image
Additional metadata might be included for internal use by Studio Classic and is subject to change.
To get the App metadata
-
In the center of the notebook menu, choose the Launch Terminal icon ( ). This opens a terminal in the SageMaker AI image that the notebook runs in.
-
Run the following commands to display the contents of the
resource-metadata.json
file.$
cd /opt/ml/metadata/ cat resource-metadata.jsonThe file should look similar to the following.
{ "AppType": "KernelGateway", "DomainId": "d-xxxxxxxxxxxx", "UserProfileName": "profile-name", "ResourceArn": "arn:aws:sagemaker:us-east-2:account-id:app/d-xxxxxxxxxxxx/profile-name/KernelGateway/datascience--1-0-ml-t3-medium", "ResourceName": "datascience--1-0-ml", "AppImageVersion":"" }