Skip to content

Instantly share code, notes, and snippets.

@awaiskaleem
Last active July 14, 2020 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awaiskaleem/f71bf5e0640a2e6f3c23cd52a4547fd3 to your computer and use it in GitHub Desktop.
Save awaiskaleem/f71bf5e0640a2e6f3c23cd52a4547fd3 to your computer and use it in GitHub Desktop.
def get_run(proj_id):
'''
get active and live runs for this model
'''
s3_client = boto3.Session(profile_name=None).client('s3')
artifact_bucket = 'YOUR ARTIFACT BUCKET ON S3'
s3_object = s3_client.get_object(Bucket=artifact_bucket, Key='mlflow/'+proj_id+'/active_model_run')
active_run = s3_object['Body'].read().decode("utf-8")
s3_object = s3_client.get_object(Bucket=artifact_bucket, Key='mlflow/'+proj_id+'/live_model_run')
live_run = s3_object['Body'].read().decode("utf-8")
return active_run, live_run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment