Skip to content

Commit 4f8f6bd

Browse files
committed
manage start all notebooks, updates on the notebooks of the other hospitals, generalise get_URLs script
1 parent 3ab6a2e commit 4f8f6bd

File tree

6 files changed

+269
-225
lines changed

6 files changed

+269
-225
lines changed

projects/aries-fl/manage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ EOF
6363
# Default Settings:
6464
# -----------------------------------------------------------------------------------------------------------------
6565
# DEFAULT_CONTAINERS="nhstrust-agent nhstrust-notebook regulator-agent regulator-notebook researcher-agent researcher-notebook hospital1-agent hospital1-notebook hospital2-agent hospital2-notebook hospital3-agent hospital3-notebook"
66-
DEFAULT_CONTAINERS="researcher-agent researcher-notebook hospital1-agent hospital1-notebook"
66+
DEFAULT_CONTAINERS="researcher-agent researcher-notebook hospital1-agent hospital1-notebook hospital2-agent hospital2-notebook hospital3-agent hospital3-notebook"
6767
# -----------------------------------------------------------------------------------------------------------------
6868
# Functions:
6969
# -----------------------------------------------------------------------------------------------------------------

projects/aries-fl/notebooks/hospital/Hospital1.ipynb

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "indoor-valley",
5+
"id": "alive-sucking",
66
"metadata": {},
77
"source": [
88
"# Hospital 1\n",
@@ -13,7 +13,7 @@
1313
{
1414
"cell_type": "code",
1515
"execution_count": 1,
16-
"id": "heated-typing",
16+
"id": "unnecessary-composite",
1717
"metadata": {},
1818
"outputs": [],
1919
"source": [
@@ -26,7 +26,7 @@
2626
{
2727
"cell_type": "code",
2828
"execution_count": 2,
29-
"id": "enclosed-webmaster",
29+
"id": "changing-stress",
3030
"metadata": {},
3131
"outputs": [],
3232
"source": [
@@ -36,7 +36,7 @@
3636
{
3737
"cell_type": "code",
3838
"execution_count": 3,
39-
"id": "massive-envelope",
39+
"id": "invalid-viking",
4040
"metadata": {},
4141
"outputs": [],
4242
"source": [
@@ -56,7 +56,7 @@
5656
{
5757
"cell_type": "code",
5858
"execution_count": 4,
59-
"id": "colonial-quebec",
59+
"id": "environmental-letters",
6060
"metadata": {},
6161
"outputs": [],
6262
"source": [
@@ -65,49 +65,53 @@
6565
},
6666
{
6767
"cell_type": "markdown",
68-
"id": "demanding-advice",
68+
"id": "scheduled-blood",
6969
"metadata": {},
7070
"source": [
7171
"## Copy from Researcher"
7272
]
7373
},
7474
{
7575
"cell_type": "code",
76-
"execution_count": 6,
77-
"id": "accepted-chamber",
76+
"execution_count": 5,
77+
"id": "casual-market",
7878
"metadata": {},
7979
"outputs": [],
8080
"source": [
81-
"research_invite = {\"@type\": \"did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation\", \"@id\": \"06fa0413-825f-4600-8bec-a582e5d75acc\", \"label\": \"Health Researcher\", \"serviceEndpoint\": \"http://172.17.0.1:8040\", \"recipientKeys\": [\"HrC95BgohtYLsTHjn6g4UspCx8tWzviGAg7PbvnRWHjZ\"]}"
81+
"research_invite = {\"@type\": \"did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation\", \"@id\": \"8adcb4ac-5b8c-4ccb-8586-7ec87d8da60a\", \"label\": \"Health Researcher\", \"recipientKeys\": [\"EVma5YcwgwHkZYQgpvenCW7BYq5EEdDFmdDEzBiSB4FX\"], \"serviceEndpoint\": \"http://172.30.144.131:8040\"}"
8282
]
8383
},
8484
{
8585
"cell_type": "code",
86-
"execution_count": 7,
87-
"id": "magnetic-announcement",
86+
"execution_count": 6,
87+
"id": "buried-addition",
8888
"metadata": {},
8989
"outputs": [
9090
{
9191
"name": "stdout",
9292
"output_type": "stream",
9393
"text": [
9494
"Connection Handler Called\n",
95-
"Connection b16c712d-640e-4948-8ac6-ac767f3cddc2 in State invitation\n",
95+
"Connection 16b3f361-870c-4864-8e54-f1862cc0304d in State invitation\n",
9696
"Connection Handler Called\n",
97-
"Connection b16c712d-640e-4948-8ac6-ac767f3cddc2 in State request\n",
97+
"Connection 16b3f361-870c-4864-8e54-f1862cc0304d in State request\n",
9898
"Connection Handler Called\n",
99-
"Connection b16c712d-640e-4948-8ac6-ac767f3cddc2 in State response\n",
99+
"Connection 16b3f361-870c-4864-8e54-f1862cc0304d in State response\n",
100100
"Connection Handler Called\n",
101-
"Connection b16c712d-640e-4948-8ac6-ac767f3cddc2 in State active\n",
101+
"Connection 16b3f361-870c-4864-8e54-f1862cc0304d in State active\n",
102102
"Pending connection moved to active. Challenging with auth policy if set\n",
103-
"Trusted Research Connection Established - b16c712d-640e-4948-8ac6-ac767f3cddc2\n",
104-
"ML Message from b16c712d-640e-4948-8ac6-ac767f3cddc2\n",
103+
"Trusted Research Connection Established - 16b3f361-870c-4864-8e54-f1862cc0304d\n",
104+
"Connection Handler Called\n",
105+
"Connection 10944e1d-1a53-46be-b0ec-3424a6d24273 in State invitation\n",
106+
"Connection Handler Called\n",
107+
"Connection 10944e1d-1a53-46be-b0ec-3424a6d24273 in State request\n",
108+
"ML Message from 16b3f361-870c-4864-8e54-f1862cc0304d\n",
105109
"Open file\n",
106110
"learning\n",
107111
"untrained_model.pt\n",
108112
"HOSPITAL MODEL LOADED\n",
109113
"HOSPITAL IS TRAINING\n",
110-
"loss at epoch 0 : tensor(0.2577)\n"
114+
"loss at epoch 0 : tensor(0.2499)\n"
111115
]
112116
},
113117
{
@@ -122,18 +126,22 @@
122126
"name": "stdout",
123127
"output_type": "stream",
124128
"text": [
125-
"loss at epoch 5000 : tensor(0.1234)\n",
126-
"loss at epoch 10000 : tensor(0.1123)\n",
127-
"loss at epoch 15000 : tensor(0.1070)\n",
128-
"loss at epoch 20000 : tensor(0.1005)\n",
129-
"loss at epoch 25000 : tensor(0.0970)\n",
130-
"loss at epoch 30000 : tensor(0.0950)\n",
131-
"loss at epoch 35000 : tensor(0.0935)\n",
132-
"loss at epoch 40000 : tensor(0.0925)\n",
133-
"loss at epoch 45000 : tensor(0.0917)\n",
129+
"loss at epoch 5000 : tensor(0.1313)\n",
130+
"loss at epoch 10000 : tensor(0.1146)\n",
131+
"loss at epoch 15000 : tensor(0.1100)\n",
132+
"loss at epoch 20000 : tensor(0.1043)\n",
133+
"loss at epoch 25000 : tensor(0.0986)\n",
134+
"loss at epoch 30000 : tensor(0.0958)\n",
135+
"loss at epoch 35000 : tensor(0.0942)\n",
136+
"loss at epoch 40000 : tensor(0.0931)\n",
137+
"loss at epoch 45000 : tensor(0.0922)\n",
134138
"Learnt \n",
135139
"Trained file open\n",
136-
"connection ID b16c712d-640e-4948-8ac6-ac767f3cddc2\n"
140+
"connection ID 16b3f361-870c-4864-8e54-f1862cc0304d\n",
141+
"Connection Handler Called\n",
142+
"Connection 4feda1ac-0d66-42a7-9a42-cbb711efae97 in State invitation\n",
143+
"Connection Handler Called\n",
144+
"Connection 4feda1ac-0d66-42a7-9a42-cbb711efae97 in State request\n"
137145
]
138146
}
139147
],
@@ -144,7 +152,7 @@
144152
{
145153
"cell_type": "code",
146154
"execution_count": null,
147-
"id": "assumed-password",
155+
"id": "amber-novel",
148156
"metadata": {},
149157
"outputs": [],
150158
"source": []
@@ -166,7 +174,7 @@
166174
"name": "python",
167175
"nbconvert_exporter": "python",
168176
"pygments_lexer": "ipython3",
169-
"version": "3.8.5"
177+
"version": "3.7.6"
170178
}
171179
},
172180
"nbformat": 4,

projects/aries-fl/notebooks/hospital/Hospital2.ipynb

Lines changed: 26 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "completed-question",
5+
"id": "amended-resort",
66
"metadata": {},
77
"source": [
88
"# Hospital 2\n",
@@ -13,7 +13,7 @@
1313
{
1414
"cell_type": "code",
1515
"execution_count": 1,
16-
"id": "cubic-international",
16+
"id": "selected-strategy",
1717
"metadata": {},
1818
"outputs": [],
1919
"source": [
@@ -26,7 +26,7 @@
2626
{
2727
"cell_type": "code",
2828
"execution_count": 2,
29-
"id": "piano-joyce",
29+
"id": "meaning-fiber",
3030
"metadata": {},
3131
"outputs": [],
3232
"source": [
@@ -36,14 +36,14 @@
3636
{
3737
"cell_type": "code",
3838
"execution_count": 3,
39-
"id": "complex-direction",
39+
"id": "published-channels",
4040
"metadata": {},
4141
"outputs": [],
4242
"source": [
4343
"WEBHOOK_HOST = \"0.0.0.0\"\n",
4444
"WEBHOOK_PORT = 8062\n",
4545
"WEBHOOK_BASE = \"\"\n",
46-
"ADMIN_URL = \"http://hospital1-agent:8061\"\n",
46+
"ADMIN_URL = \"http://hospital2-agent:8061\"\n",
4747
"\n",
4848
"agent_config = {\n",
4949
" \"webhook_host\": WEBHOOK_HOST,\n",
@@ -56,7 +56,7 @@
5656
{
5757
"cell_type": "code",
5858
"execution_count": 4,
59-
"id": "thirty-scratch",
59+
"id": "bigger-civilian",
6060
"metadata": {},
6161
"outputs": [],
6262
"source": [
@@ -65,75 +65,41 @@
6565
},
6666
{
6767
"cell_type": "markdown",
68-
"id": "afraid-marijuana",
68+
"id": "moderate-connecticut",
6969
"metadata": {},
7070
"source": [
7171
"## Copy from Researcher"
7272
]
7373
},
7474
{
7575
"cell_type": "code",
76-
"execution_count": 6,
77-
"id": "based-blackberry",
76+
"execution_count": 7,
77+
"id": "advised-greene",
7878
"metadata": {},
7979
"outputs": [],
8080
"source": [
81-
"research_invite = {\"@type\": \"did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation\", \"@id\": \"06fa0413-825f-4600-8bec-a582e5d75acc\", \"label\": \"Health Researcher\", \"serviceEndpoint\": \"http://172.17.0.1:8040\", \"recipientKeys\": [\"HrC95BgohtYLsTHjn6g4UspCx8tWzviGAg7PbvnRWHjZ\"]}"
81+
"research_invite = {\"@type\": \"did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation\", \"@id\": \"cc5fd255-89c9-4e2c-8f2a-a799474821c9\", \"label\": \"Health Researcher\", \"recipientKeys\": [\"Bw9KodyAtMJTkFoYHjqdZWsxQPQAX7jgjxuc5BoepnhQ\"], \"serviceEndpoint\": \"http://172.30.144.131:8040\"}"
8282
]
8383
},
8484
{
8585
"cell_type": "code",
86-
"execution_count": 7,
87-
"id": "dated-beverage",
86+
"execution_count": 8,
87+
"id": "third-kansas",
8888
"metadata": {},
8989
"outputs": [
9090
{
91-
"name": "stdout",
92-
"output_type": "stream",
93-
"text": [
94-
"Connection Handler Called\n",
95-
"Connection b16c712d-640e-4948-8ac6-ac767f3cddc2 in State invitation\n",
96-
"Connection Handler Called\n",
97-
"Connection b16c712d-640e-4948-8ac6-ac767f3cddc2 in State request\n",
98-
"Connection Handler Called\n",
99-
"Connection b16c712d-640e-4948-8ac6-ac767f3cddc2 in State response\n",
100-
"Connection Handler Called\n",
101-
"Connection b16c712d-640e-4948-8ac6-ac767f3cddc2 in State active\n",
102-
"Pending connection moved to active. Challenging with auth policy if set\n",
103-
"Trusted Research Connection Established - b16c712d-640e-4948-8ac6-ac767f3cddc2\n",
104-
"ML Message from b16c712d-640e-4948-8ac6-ac767f3cddc2\n",
105-
"Open file\n",
106-
"learning\n",
107-
"untrained_model.pt\n",
108-
"HOSPITAL MODEL LOADED\n",
109-
"HOSPITAL IS TRAINING\n",
110-
"loss at epoch 0 : tensor(0.2577)\n"
111-
]
112-
},
113-
{
114-
"name": "stderr",
115-
"output_type": "stream",
116-
"text": [
117-
"/opt/conda/lib/python3.7/site-packages/torch/autograd/__init__.py:132: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.)\n",
118-
" allow_unreachable=True) # allow_unreachable flag\n"
119-
]
120-
},
121-
{
122-
"name": "stdout",
123-
"output_type": "stream",
124-
"text": [
125-
"loss at epoch 5000 : tensor(0.1234)\n",
126-
"loss at epoch 10000 : tensor(0.1123)\n",
127-
"loss at epoch 15000 : tensor(0.1070)\n",
128-
"loss at epoch 20000 : tensor(0.1005)\n",
129-
"loss at epoch 25000 : tensor(0.0970)\n",
130-
"loss at epoch 30000 : tensor(0.0950)\n",
131-
"loss at epoch 35000 : tensor(0.0935)\n",
132-
"loss at epoch 40000 : tensor(0.0925)\n",
133-
"loss at epoch 45000 : tensor(0.0917)\n",
134-
"Learnt \n",
135-
"Trained file open\n",
136-
"connection ID b16c712d-640e-4948-8ac6-ac767f3cddc2\n"
91+
"ename": "KeyboardInterrupt",
92+
"evalue": "",
93+
"output_type": "error",
94+
"traceback": [
95+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
96+
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
97+
"\u001b[0;32m<ipython-input-8-7ca3898bbdc5>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mhospital2\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mestablish_research_connection\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresearch_invite\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
98+
"\u001b[0;32m/workspace/hospital.py\u001b[0m in \u001b[0;36mestablish_research_connection\u001b[0;34m(self, invitation)\u001b[0m\n\u001b[1;32m 369\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpending_connections\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpending_connection\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 370\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 371\u001b[0;31m \u001b[0mloop\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_until_complete\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpending_connection\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"is_trusted\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 372\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 373\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpending_connection\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"is_trusted\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
99+
"\u001b[0;32m/opt/conda/lib/python3.7/site-packages/nest_asyncio.py\u001b[0m in \u001b[0;36mrun_until_complete\u001b[0;34m(self, future)\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_log_destroy_pending\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 91\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdone\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 92\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_run_once\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 93\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_stopping\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 94\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
100+
"\u001b[0;32m/opt/conda/lib/python3.7/site-packages/nest_asyncio.py\u001b[0m in \u001b[0;36m_run_once\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 117\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0;36m0.01\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_is_proactorloop\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 118\u001b[0m else None)\n\u001b[0;32m--> 119\u001b[0;31m \u001b[0mevent_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_selector\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mselect\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 120\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_process_events\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mevent_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 121\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
101+
"\u001b[0;32m/opt/conda/lib/python3.7/selectors.py\u001b[0m in \u001b[0;36mselect\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 466\u001b[0m \u001b[0mready\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 467\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 468\u001b[0;31m \u001b[0mfd_event_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_selector\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpoll\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmax_ev\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 469\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mInterruptedError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 470\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mready\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
102+
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
137103
]
138104
}
139105
],
@@ -144,7 +110,7 @@
144110
{
145111
"cell_type": "code",
146112
"execution_count": null,
147-
"id": "cardiovascular-typing",
113+
"id": "pleasant-football",
148114
"metadata": {},
149115
"outputs": [],
150116
"source": []
@@ -166,7 +132,7 @@
166132
"name": "python",
167133
"nbconvert_exporter": "python",
168134
"pygments_lexer": "ipython3",
169-
"version": "3.8.5"
135+
"version": "3.7.6"
170136
}
171137
},
172138
"nbformat": 4,

0 commit comments

Comments
 (0)