generated from carpentries/workbench-template-md
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add files from draft repo for final testing
- Loading branch information
1 parent
a569eaf
commit 600febd
Showing
12 changed files
with
10,570 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "8965828d-379f-4826-9624-df531216d268", | ||
"metadata": {}, | ||
"source": [ | ||
"### View all running notebook instance info" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "083e8e4c-5c6f-4ce6-9c4c-a72738598a8d", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import boto3\n", | ||
"import requests\n", | ||
"\n", | ||
"# Get the current instance ID\n", | ||
"response = requests.get(\"http://169.254.169.254/latest/meta-data/instance-id\")\n", | ||
"instance_id = response.text\n", | ||
"\n", | ||
"# Initialize SageMaker client\n", | ||
"sagemaker_client = boto3.client(\"sagemaker\")\n", | ||
"\n", | ||
"# List notebook instances to find the one with the matching instance ID\n", | ||
"response = sagemaker_client.list_notebook_instances()\n", | ||
"for instance in response[\"NotebookInstances\"]:\n", | ||
" if instance.get(\"NotebookInstanceStatus\") == \"InService\":\n", | ||
" print(f\"Notebook Instance Name: {instance['NotebookInstanceName']}\")\n", | ||
" break\n" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "conda_tensorflow2_p310", | ||
"language": "python", | ||
"name": "conda_tensorflow2_p310" | ||
}, | ||
"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.10.15" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.