Skip to content

Commit

Permalink
Merge branch 'dev' into tauquir/scenario-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
khoaguin committed Oct 3, 2024
2 parents 454ecbf + 072c629 commit 6bfea61
Show file tree
Hide file tree
Showing 30 changed files with 636 additions and 264 deletions.
11 changes: 3 additions & 8 deletions notebooks/api/0.8/11-container-images-k8s.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,7 @@
"assert workerimage is not None, str([image.__dict__ for image in image_list])\n",
"assert workerimage.is_built is not None, str(workerimage)\n",
"assert workerimage.built_at is not None, str(workerimage)\n",
"assert workerimage.image_hash is not None, str(workerimage)\n",
"assert image_list[workerimage.built_image_tag] == workerimage"
"assert workerimage.image_hash is not None, str(workerimage)"
]
},
{
Expand Down Expand Up @@ -1037,10 +1036,6 @@
"assert workerimage_opendp.built_at is not None, str(workerimage_opendp.__dict__)\n",
"assert workerimage_opendp.image_hash is not None, str(workerimage_opendp.__dict__)\n",
"\n",
"assert _images[workerimage_opendp.built_image_tag] == workerimage_opendp, str(\n",
" workerimage_opendp\n",
")\n",
"\n",
"workerimage_opendp"
]
},
Expand Down Expand Up @@ -1395,7 +1390,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "syft-3.11",
"language": "python",
"name": "python3"
},
Expand All @@ -1409,7 +1404,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"\n",
"# syft absolute\n",
"import syft as sy\n",
"from syft.util.test_helpers.checkpoint import create_checkpoint\n",
"from syft.util.test_helpers.email_helpers import get_email_server"
]
},
Expand Down Expand Up @@ -87,6 +88,15 @@
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"root_client.users"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -201,7 +211,7 @@
"metadata": {},
"outputs": [],
"source": [
"smtp_server.stop()"
"create_checkpoint(name=\"000-start-and-config\", client=root_client)"
]
},
{
Expand All @@ -210,20 +220,22 @@
"metadata": {},
"outputs": [],
"source": [
"server.land()"
"smtp_server.stop()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"server.land()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -237,7 +249,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.11.10"
}
},
"nbformat": 4,
Expand Down
90 changes: 56 additions & 34 deletions notebooks/scenarios/bigquery/001-scale-delete-worker-pools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
"source": [
"# stdlib\n",
"import os\n",
"from os import environ as env\n",
"\n",
"# syft absolute\n",
"import syft as sy\n",
"from syft.util.test_helpers.checkpoint import load_from_checkpoint\n",
"from syft.util.test_helpers.email_helpers import Timeout\n",
"from syft.util.test_helpers.email_helpers import get_email_server"
]
Expand All @@ -46,17 +48,29 @@
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"id": "3",
"metadata": {},
"outputs": [],
"source": [
"# in case we are not in k8s we set them here for orchestra to use\n",
"env[\"DEFAULT_ROOT_EMAIL\"] = ROOT_EMAIL\n",
"env[\"DEFAULT_ROOT_PASSWORD\"] = ROOT_PASSWORD"
]
},
{
"cell_type": "markdown",
"id": "4",
"metadata": {},
"source": [
"### Launch server & login"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -67,13 +81,29 @@
" port=\"8080\",\n",
" n_consumers=num_workers, # How many workers to be spawned\n",
" create_producer=True, # Can produce more workers\n",
" log_level=10,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5",
"id": "6",
"metadata": {},
"outputs": [],
"source": [
"load_from_checkpoint(\n",
" name=\"000-start-and-config\",\n",
" client=server.client,\n",
" root_email=ROOT_EMAIL,\n",
" root_password=ROOT_PASSWORD,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -83,7 +113,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6",
"id": "8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -95,7 +125,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "7",
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -105,7 +135,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -115,15 +145,15 @@
},
{
"cell_type": "markdown",
"id": "9",
"id": "11",
"metadata": {},
"source": [
"### Scale Worker pool"
]
},
{
"cell_type": "markdown",
"id": "10",
"id": "12",
"metadata": {},
"source": [
"##### Scale up"
Expand All @@ -132,7 +162,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "11",
"id": "13",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -146,7 +176,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"id": "14",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -156,7 +186,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "13",
"id": "15",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -176,7 +206,7 @@
},
{
"cell_type": "markdown",
"id": "14",
"id": "16",
"metadata": {},
"source": [
"##### Scale down"
Expand All @@ -185,7 +215,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "15",
"id": "17",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -200,7 +230,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "16",
"id": "18",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -219,7 +249,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "17",
"id": "19",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -232,7 +262,7 @@
},
{
"cell_type": "markdown",
"id": "18",
"id": "20",
"metadata": {},
"source": [
"#### Delete Worker Pool"
Expand All @@ -241,7 +271,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "19",
"id": "21",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -254,7 +284,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "20",
"id": "22",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -264,7 +294,7 @@
},
{
"cell_type": "markdown",
"id": "21",
"id": "23",
"metadata": {},
"source": [
"#### Re-launch the default worker pool"
Expand All @@ -273,7 +303,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "22",
"id": "24",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -283,7 +313,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "23",
"id": "25",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -297,7 +327,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "24",
"id": "26",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -311,7 +341,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "25",
"id": "27",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -321,25 +351,17 @@
{
"cell_type": "code",
"execution_count": null,
"id": "26",
"id": "28",
"metadata": {},
"outputs": [],
"source": [
"server.land()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "27",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "syft",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -353,7 +375,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.11.10"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 6bfea61

Please sign in to comment.