Skip to content

Commit 7d3196a

Browse files
committed
Updating OpenVINO scripts
1 parent 7227fd0 commit 7d3196a

File tree

3 files changed

+46
-16
lines changed

3 files changed

+46
-16
lines changed

Access-OpenVINO-Workbench.ipynb

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,19 @@
1111
"cell_type": "markdown",
1212
"metadata": {},
1313
"source": [
14-
"With the launch of OpenVINO AMI, the OpenVINO Deep Learning Workbench is launched automatically with authentication enabled. Running the following cells will help you retreive the authentication token.\n",
14+
"- With the launch of OpenVINO AMI, the OpenVINO Deep Learning Workbench is launched automatically with authentication enabled. Running the following cells will help you retreive the **OpenVINO DL Workbench URL and authentication token.**\n",
1515
"\n",
16-
"### [Click here for more detailed information](https://docs.openvinotoolkit.org/latest/workbench_docs_Workbench_DG_Authentication.html)"
16+
"- ### [Click here for more detailed information](https://docs.openvinotoolkit.org/latest/workbench_docs_Workbench_DG_Authentication.html)"
1717
]
1818
},
1919
{
2020
"cell_type": "markdown",
2121
"metadata": {},
2222
"source": [
23-
"### Retrieve Token from the OpenVINO DL workbench docker container\n",
24-
"Run the the following cell to get the token.\n",
25-
"#### NOTE: If you get `No such file or directory` error, please try again after 1 min, as the docker container is still booting up."
23+
"## Launch OpenVINO Deep Learning Workbench \n",
24+
"- **Goto [http://\\<Your-EC2-Instance-IP\\>:5665](#) to launch.**\n",
25+
"- Run the the following cell to get the **OpenVINO DL Workbench URL and authentication token.**\n",
26+
"#### NOTE: If you get `No such file or directory` error, please try again after 1 min, as the docker container is still booting up.\n"
2627
]
2728
},
2829
{
@@ -31,31 +32,44 @@
3132
"metadata": {},
3233
"outputs": [],
3334
"source": [
34-
"!docker exec workbench cat /home/workbench/.workbench/token.txt"
35+
"%%sh\n",
36+
"dl_workbench_token=`docker exec workbench cat /home/workbench/.workbench/token.txt`\n",
37+
"ec2_instance_public_ip=`cat /home/ec2-user/.public-ipv4.txt`\n",
38+
"echo \"OpenVINO DL Workbench URL: http://$ec2_instance_public_ip:5665/\"\n",
39+
"echo -e \"\\nToken for both DL Workbench and DL Workbench JupyterLab:\"\n",
40+
"echo \"$dl_workbench_token\""
3541
]
3642
},
3743
{
3844
"cell_type": "markdown",
3945
"metadata": {},
4046
"source": [
41-
"### Launch OpenVINO Deep Learning Workbench \n",
42-
"- #### Goto [http://your-ec2-instance-IP:5665](http://<your-ec2-instance-ip>:5665) to launch.\n",
43-
"- When prompted for token, paste the above retrieved token. [Click here for more detailed information](https://docs.openvinotoolkit.org/latest/workbench_docs_Workbench_DG_Authentication.html)"
47+
"### [Optional] Retrieve Token from the OpenVINO DL workbench docker container\n",
48+
"Run the the following cell to print OpenVINO DL Workbench authentication token.\n",
49+
"#### NOTE: If you get `No such file or directory` error, please try again after 1 min, as the docker container is still booting up."
50+
]
51+
},
52+
{
53+
"cell_type": "code",
54+
"execution_count": null,
55+
"metadata": {},
56+
"outputs": [],
57+
"source": [
58+
"!docker exec workbench cat /home/workbench/.workbench/token.txt"
4459
]
4560
},
4661
{
4762
"cell_type": "markdown",
4863
"metadata": {},
4964
"source": [
50-
"## Below are optional cells. \n",
51-
"Can be used to debug."
65+
"## Run below cells to get more information on DL Workbench container."
5266
]
5367
},
5468
{
5569
"cell_type": "markdown",
5670
"metadata": {},
5771
"source": [
58-
"### [OPTIONAL] See the logs to check the status of workbench launch..."
72+
"#### [Optional] See the logs to check the status of workbench launch..."
5973
]
6074
},
6175
{
@@ -71,7 +85,7 @@
7185
"cell_type": "markdown",
7286
"metadata": {},
7387
"source": [
74-
"### [OPTIONAL] See the logs with continuos streaming of containers output...\n",
88+
"#### [Optional] See the logs with continuos streaming of containers output...\n",
7589
"#### NOTE: Click `\"Esc + i i\"` or `Kernel → Interrupt` to exit out, after running the below cell."
7690
]
7791
},
@@ -97,12 +111,21 @@
97111
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
98112
},
99113
"kernelspec": {
100-
"display_name": "Python 3.8.2 64-bit",
114+
"display_name": "Python 3",
115+
"language": "python",
101116
"name": "python3"
102117
},
103118
"language_info": {
119+
"codemirror_mode": {
120+
"name": "ipython",
121+
"version": 3
122+
},
123+
"file_extension": ".py",
124+
"mimetype": "text/x-python",
104125
"name": "python",
105-
"version": ""
126+
"nbconvert_exporter": "python",
127+
"pygments_lexer": "ipython3",
128+
"version": "3.6.9"
106129
}
107130
},
108131
"nbformat": 4,

start_dlworkbench.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Script to launch openvino-workbench container
2-
# Application accessed through webbrowser with http://<ec2-public-ip>:5665/
2+
# OpenVINO DL Workbench Application accessed through web browser with http://<ec2-public-ip>:5665/
33

44
# Remove any existing workbench container
55
docker rm workbench

start_jupyter.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
# Script to start Jupyter Notebook server with EC2 $INSTANCE_ID as the password
2+
13
TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
24

35
INSTANCE_ID=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/instance-id)
46

7+
# Save the EC2 Instance public ipv4 address. This is used in Access-OpenVINO-Workbench.ipynb
8+
curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/public-ipv4 >/home/ec2-user/.public-ipv4.txt
9+
10+
# Setup the ec2-user environment
511
cd /home/ec2-user
612
source /home/ec2-user/.bashrc
713

14+
# Start Jupyter Notebook server with $INSTANCE_ID as the password
815
/home/ec2-user/.local/bin/jupyter notebook --no-browser --NotebookApp.allow_password_change=False --NotebookApp.token="$INSTANCE_ID" --ip 0.0.0.0 --port 8888 >/tmp/jupyter.log 2>&1 &

0 commit comments

Comments
 (0)