|
7 | 7 | "source": [ |
8 | 8 | "# Step 4: Add a model building CI/CD pipeline\n", |
9 | 9 | "\n", |
10 | | - "<div class=\"alert alert-warning\"> This notebook has been last tested on a SageMaker Studio JupyterLab instance using the <code>SageMaker Distribution Image 3.6.1</code> and with the SageMaker Python SDK version <code>2.255.0</code></div>\n", |
| 10 | + "<div class=\"alert alert-warning\"> This notebook has been last tested on a SageMaker Studio JupyterLab instance using the <code>SageMaker Distribution Image 3.7.0</code> and with the SageMaker Python SDK version <code>2.255.0</code></div>\n", |
11 | 11 | "\n", |
12 | 12 | "In this step you create an automated CI/CD pipeline for model building using [Amazon SageMaker Projects](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-projects.html). \n", |
13 | 13 | "\n", |
|
1010 | 1010 | "\n", |
1011 | 1011 | " # If no tracking server ARN, try to find an active MLflow server\n", |
1012 | 1012 | " if tracking_server_arn is None:\n", |
1013 | | - " r = sm.list_mlflow_tracking_servers(\n", |
1014 | | - " TrackingServerStatus='Created',\n", |
1015 | | - " )['TrackingServerSummaries']\n", |
1016 | | - " \n", |
1017 | | - " if len(r) < 1:\n", |
| 1013 | + " summaries = []\n", |
| 1014 | + " for status in ['Created', 'Updated']:\n", |
| 1015 | + " r = sm.list_mlflow_apps(Status=status)\n", |
| 1016 | + " summaries.extend(r['Summaries'])\n", |
| 1017 | + " \n", |
| 1018 | + " if len(summaries) < 1:\n", |
1018 | 1019 | " print(\"You don't have any running MLflow servers. Exiting...\")\n", |
1019 | 1020 | " return None\n", |
1020 | 1021 | " else:\n", |
1021 | | - " tracking_server_arn = r[0]['TrackingServerArn']\n", |
| 1022 | + " tracking_server_arn = summaries[0]['Arn']\n", |
1022 | 1023 | " print(f\"Use the tracking server ARN:{tracking_server_arn}\")\n", |
1023 | 1024 | " \n", |
1024 | 1025 | " # Parameters for pipeline execution\n", |
|
0 commit comments