Skip to content

Commit

Permalink
small fix on delete nb
Browse files Browse the repository at this point in the history
  • Loading branch information
BrendanSchell committed Sep 19, 2024
1 parent 7fca328 commit bca09d9
Showing 1 changed file with 35 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "589bbac0",
"id": "1",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -41,7 +41,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "1",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -57,22 +57,20 @@
{
"cell_type": "code",
"execution_count": null,
"id": "2",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
"environment = os.environ.get(\"ORCHESTRA_DEPLOYMENT_TYPE\", \"python\")\n",
"\n",
"num_workers = int(os.environ.get(\"NUM_TEST_WORKERS\", 1))\n",
"\n",
"ROOT_EMAIL = \"[email protected]\"\n",
"ROOT_PASSWORD = \"bqpw\"\n",
"# ROOT_EMAIL = \"[email protected]\"\n",
"# ROOT_PASSWORD = \"bqpw\"\n",
"environment"
]
},
{
"cell_type": "markdown",
"id": "3",
"id": "4",
"metadata": {},
"source": [
"### Launch server & login"
Expand All @@ -81,15 +79,14 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
"server_low = sy.orchestra.launch(\n",
" name=\"bigquery-low\",\n",
" server_side_type=\"low\",\n",
" dev_mode=True,\n",
" reset=True,\n",
" n_consumers=1,\n",
" create_producer=True,\n",
" port=low_port,\n",
Expand All @@ -99,7 +96,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5",
"id": "6",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -109,29 +106,27 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6",
"id": "7",
"metadata": {},
"outputs": [],
"source": [
"low_client = server_low.login(\n",
" email=ROOT_EMAIL, password=ROOT_PASSWORD\n",
")"
"low_client = server_low.login(email=\"[email protected]\", password=\"changethis\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7",
"id": "8",
"metadata": {},
"outputs": [],
"source": [
"low_client.worker_pools"
"assert len(low_client.worker_pools.get_all()) == 2"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -141,15 +136,15 @@
},
{
"cell_type": "markdown",
"id": "9",
"id": "10",
"metadata": {},
"source": [
"### Scale Worker pool"
]
},
{
"cell_type": "markdown",
"id": "10",
"id": "11",
"metadata": {},
"source": [
"##### Scale up"
Expand All @@ -158,7 +153,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "11",
"id": "12",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -172,7 +167,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"id": "13",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -182,7 +177,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "13",
"id": "14",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -195,14 +190,13 @@
" assert scale_up_result, scale_up_result\n",
"\n",
" assert (\n",
" low_client.api.services.worker_pool[default_worker_pool.name].max_count\n",
" == 5\n",
" low_client.api.services.worker_pool[default_worker_pool.name].max_count == 5\n",
" )"
]
},
{
"cell_type": "markdown",
"id": "14",
"id": "15",
"metadata": {},
"source": [
"##### Scale down"
Expand All @@ -211,7 +205,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "15",
"id": "16",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -226,7 +220,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "16",
"id": "17",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -245,7 +239,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "17",
"id": "18",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -258,7 +252,7 @@
},
{
"cell_type": "markdown",
"id": "18",
"id": "19",
"metadata": {},
"source": [
"#### Delete Worker Pool"
Expand All @@ -267,7 +261,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "19",
"id": "20",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -280,7 +274,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "20",
"id": "21",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -290,7 +284,7 @@
},
{
"cell_type": "markdown",
"id": "21",
"id": "22",
"metadata": {},
"source": [
"#### Re-launch the default worker pool"
Expand All @@ -299,7 +293,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "22",
"id": "23",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -309,7 +303,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "23",
"id": "24",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -323,7 +317,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "24",
"id": "25",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -337,7 +331,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "25",
"id": "26",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -347,20 +341,13 @@
{
"cell_type": "code",
"execution_count": null,
"id": "26",
"id": "27",
"metadata": {},
"outputs": [],
"source": [
"server_low.land()"
"if environment != \"remote\":\n",
" server_low.land()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "27",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -379,7 +366,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit bca09d9

Please sign in to comment.