Skip to content

Commit

Permalink
Fix enclave notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
kiendang committed Oct 18, 2023
1 parent bf67a1f commit da90a14
Showing 1 changed file with 40 additions and 38 deletions.
78 changes: 40 additions & 38 deletions notebooks/tutorials/enclaves/Enclave-single-notebook-DO-DS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@
"metadata": {},
"outputs": [],
"source": [
"#Local Python Mode\n",
"enclave_node = sy.orchestra.launch(name=\"Enclave\",\n",
" node_type=sy.NodeType.ENCLAVE,\n",
" local_db=True,\n",
" dev_mode=True,\n",
" reset=True)"
"# Local Python Node\n",
"enclave_node = sy.orchestra.launch(\n",
" name=\"Enclave\",\n",
" node_type=sy.NodeType.ENCLAVE,\n",
" local_db=True,\n",
" dev_mode=True,\n",
" reset=True\n",
")"
]
},
{
Expand Down Expand Up @@ -69,14 +71,18 @@
"metadata": {},
"outputs": [],
"source": [
"ca_node = sy.orchestra.launch(name=\"Canada\",\n",
" local_db=True,\n",
" reset=True,\n",
" dev_mode=True)\n",
"it_node = sy.orchestra.launch(name=\"Italy\",\n",
" local_db=True,\n",
" reset=True,\n",
" dev_mode=True) "
"ca_node = sy.orchestra.launch(\n",
" name=\"Canada\",\n",
" local_db=True,\n",
" reset=True,\n",
" dev_mode=True\n",
")\n",
"it_node = sy.orchestra.launch(\n",
" name=\"Italy\",\n",
" local_db=True,\n",
" reset=True,\n",
" dev_mode=True\n",
") "
]
},
{
Expand Down Expand Up @@ -105,11 +111,13 @@
"metadata": {},
"outputs": [],
"source": [
"gateway_node = sy.orchestra.launch(name=\"gateway\",\n",
" node_type = sy.NodeType.GATEWAY,\n",
" local_db=True,\n",
" reset=True,\n",
" dev_mode=True)"
"gateway_node = sy.orchestra.launch(\n",
" name=\"gateway\",\n",
" node_type = sy.NodeType.GATEWAY,\n",
" local_db=True,\n",
" reset=True,\n",
" dev_mode=True\n",
")"
]
},
{
Expand Down Expand Up @@ -334,7 +342,7 @@
"metadata": {},
"outputs": [],
"source": [
"#Explore the domains and enclaves connected to the gateway\n",
"# Explore the domains and enclaves connected to the gateway\n",
"ds_gateway_client.domains"
]
},
Expand All @@ -345,9 +353,9 @@
"metadata": {},
"outputs": [],
"source": [
"#logs into canada as proxy_client\n",
"# Log into canada as proxy_client\n",
"ds_ca_proxy_client = ds_gateway_client.domains[0]\n",
"ds_ca_proxy_client.login(email=\"[email protected]\" , password=\"changethis\")\n",
"ds_ca_proxy_client = ds_ca_proxy_client.login(email=\"[email protected]\", password=\"changethis\")\n",
"assert ds_ca_proxy_client.name == \"Canada\"\n",
"assert ds_ca_proxy_client.connection.proxy_target_uid == do_ca_client.id\n",
"assert isinstance(ds_ca_proxy_client, DomainClient)"
Expand All @@ -360,9 +368,9 @@
"metadata": {},
"outputs": [],
"source": [
"#logs into italy as proxy_client\n",
"# Log into italy as proxy_client\n",
"ds_it_proxy_client = ds_gateway_client.domains[1]\n",
"ds_it_proxy_client.login(email=\"[email protected]\" , password=\"changethis\")\n",
"ds_it_proxy_client = ds_it_proxy_client.login(email=\"[email protected]\", password=\"changethis\")\n",
"assert ds_it_proxy_client.name == \"Italy\"\n",
"assert ds_it_proxy_client.connection.proxy_target_uid == do_it_client.id\n",
"assert isinstance(ds_it_proxy_client, DomainClient)"
Expand All @@ -375,9 +383,11 @@
"metadata": {},
"outputs": [],
"source": [
"# Creates and account and logs into enclave as proxy client\n",
"# Create an account and log into enclave as proxy client\n",
"ds_enclave_proxy_client = ds_gateway_client.enclaves[0]\n",
"ds_enclave_proxy_client.login(email=\"[email protected]\" , password=\"changethis\",name=\"Sheldon\", register=True)\n",
"ds_enclave_proxy_client = ds_enclave_proxy_client.login(\n",
" email=\"[email protected]\" , password=\"changethis\", name=\"Sheldon\", register=True\n",
")\n",
"assert ds_enclave_proxy_client.name == \"Enclave\"\n",
"assert ds_enclave_proxy_client.connection.proxy_target_uid == enclave_guest_client.id\n",
"assert isinstance(ds_enclave_proxy_client, EnclaveClient)"
Expand Down Expand Up @@ -453,11 +463,11 @@
"metadata": {},
"outputs": [],
"source": [
"#Checking result of mock data execution\n",
"# Check result of mock data execution\n",
"mock_result = compute_census_matches(\n",
" canada_census_data=canada_census_data.mock,\n",
" italy_census_data=italy_census_data.mock\n",
" )\n",
" canada_census_data=canada_census_data.mock,\n",
" italy_census_data=italy_census_data.mock,\n",
")\n",
"mock_result"
]
},
Expand Down Expand Up @@ -659,14 +669,6 @@
"source": [
"assert result_ptr.syft_action_data == 813"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1beca4ac",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit da90a14

Please sign in to comment.