Last active
February 21, 2021 09:02
-
-
Save philippschmalen/dfe1e96db2d36b5f5ab151bebcfee8f5 to your computer and use it in GitHub Desktop.
AWS Sagemaker session info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
from sagemaker import Session | |
from sagemaker import get_execution_role | |
def session_info(): | |
"""Prints and return Sagemaker session info""" | |
# Session parameters for info | |
sagemaker_session = Session() | |
region = boto3.session.Session().region_name | |
role = get_execution_role() | |
print("SESSION INFO\n"+'-'*42) | |
print("Session:{}\nRegion:{}\nRole:{}\n".format(sagemaker_session, region, role)) | |
return sagemaker_session, region, role |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment