Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
koenvanderveen committed Oct 4, 2023
1 parent e0282b6 commit 84a6959
Show file tree
Hide file tree
Showing 7 changed files with 1,260 additions and 187 deletions.
6 changes: 6 additions & 0 deletions notebooks/helm/Untitled.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}
588 changes: 588 additions & 0 deletions notebooks/helm/consumer node.ipynb

Large diffs are not rendered by default.

190 changes: 109 additions & 81 deletions notebooks/helm/helm_syft.ipynb

Large diffs are not rendered by default.

134 changes: 31 additions & 103 deletions notebooks/helm/nested_syft_functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,20 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"id": "a196017f",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"kj/filesystem-disk-unix.c++:1703: warning: PWD environment variable doesn't match current directory; pwd = /Users/koen/workspace/pysyft\n"
]
}
],
"outputs": [],
"source": [
"import syft as sy\n",
"from syft import ActionObject\n",
"from syft import syft_function, syft_function_single_use\n",
"from time import sleep"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "95e55a0a",
"metadata": {},
"outputs": [],
"source": [
"# subprocess.check_output(\n",
"# [lsof_path, \"-w\", \"-Fd\", \"-p\", str(os.getpid())]\n",
"# ).decode().split(os.linesep)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "dcd8f67c",
"metadata": {},
"outputs": [],
"source": [
"import os"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "151a3517",
"metadata": {},
"outputs": [],
"source": [
"from collections import Counter\n",
"def print_open_files():\n",
" import psutil\n",
"\n",
" files = psutil.Process(pid=os.getpid()).open_files()\n",
" print('len(files):', len(files))\n",
" print(Counter([f.path for f in files]))\n",
"# for f in files:\n",
"# print('FD:', f.fd, f.path)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "ff6b7f51",
"metadata": {},
"outputs": [],
"source": [
"from time import sleep\n",
"import os\n",
"import psutil\n",
"\n",
"import inspect"
"import inspect\n",
"from syft.service.queue.zmq_queue import ZMQQueueConfig, ZMQClientConfig"
]
},
{
Expand All @@ -84,53 +28,17 @@
},
{
"cell_type": "code",
"execution_count": 6,
"id": "4cbee0b1",
"metadata": {},
"outputs": [],
"source": [
"# client = sy.login(port=8800, email=\"[email protected]\", password=\"changethis\")"
]
},
{
"cell_type": "markdown",
"id": "6c9ce5a0",
"metadata": {},
"source": [
"Without server"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "46b2c271",
"metadata": {},
"outputs": [],
"source": [
"# get_open_fds()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "0e8e3591",
"metadata": {},
"outputs": [],
"source": [
"# node.python_node"
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 5,
"id": "9b31c627",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CREATING A PRODUCER ON tcp://127.0.0.1:54341\n",
"spawning thread\n",
"spawning thread\n",
"spawning thread\n",
"Logged into <test-domain-helm2: High side Domain> as <[email protected]>\n"
]
},
Expand All @@ -148,7 +56,8 @@
}
],
"source": [
"node = sy.orchestra.launch(name=\"test-domain-helm2\", dev_mode=True, reset=True, n_consumers=0)\n",
"node = sy.orchestra.launch(name=\"test-domain-helm2\", dev_mode=True, reset=True, n_consumers=3,\n",
" queue_config=ZMQQueueConfig(client_config=ZMQClientConfig(create_producer=True)))\n",
"client = node.login(email=\"[email protected]\", password=\"changethis\")"
]
},
Expand Down Expand Up @@ -182,6 +91,25 @@
"# client.register(name=\"a\", email=\"[email protected]\", password=\"AVC\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a8c342a6",
"metadata": {},
"outputs": [],
"source": [
"from collections import Counter\n",
"def print_open_files():\n",
" import psutil\n",
"\n",
" files = psutil.Process(pid=os.getpid()).open_files()\n",
" print('len(files):', len(files))\n",
" print(Counter([f.path for f in files]))\n",
"# for f in files:\n",
"# print('FD:', f.fd, f.path)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 13,
Expand Down
Loading

0 comments on commit 84a6959

Please sign in to comment.