Skip to content

Commit

Permalink
More refinement of the Jupyter Notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexejPenner committed Dec 11, 2023
1 parent faae977 commit d323108
Showing 1 changed file with 12 additions and 27 deletions.
39 changes: 12 additions & 27 deletions stack-showcase/run_stack_showcase.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -859,17 +859,21 @@
"metadata": {},
"outputs": [],
"source": [
"from zenml.config import DockerSettings\n",
"\n",
"# The actual code will stay the same, all that needs to be done is some configuration\n",
"\n",
"step_args = {}\n",
"\n",
"# We configure which step operator should be used\n",
"step_args[\"step_operator\"] = \"sagemaker-eu\"\n",
"\n",
"# M5 Large is what we need for this big data!\n",
"step_args[\"settings\"] = {\"step_operator.sagemaker\": {\"estimator_args\": {\"instance_type\" : \"ml.m5.large\"}}}\n",
"\n",
"# Update the step. We can also do this in YAML\n",
"# Update the step. We could also do this in YAML\n",
"model_trainer = model_trainer.with_options(**step_args)\n",
"\n",
"from zenml.config import DockerSettings\n",
"\n",
"docker_settings = DockerSettings(\n",
" requirements=[\n",
" \"pyarrow\",\n",
Expand Down Expand Up @@ -994,6 +998,7 @@
}
],
"source": [
"# Lets run the pipeline\n",
"fe_t_configured()"
]
},
Expand Down Expand Up @@ -1304,30 +1309,6 @@
"!zenml stack up"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "d7f5609f-94db-4977-89be-531246f55566",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;35mNumExpr defaulting to 8 threads.\u001b[0m\n",
"\u001b[31mThe ZenML global configuration version (0.51.0) is higher than the version of ZenML currently being used (0.50.0). Read more about this issue and how to solve it here: \u001b[0m\u001b[1;36mhttps://docs.zenml.io/user-guide/advanced-guide/environment-management/global-settings-of-zenml#version-mismatch-downgrading\u001b[31m\u001b[0m\n",
"\u001b[2;36mProvisioning resources for active stack \u001b[0m\u001b[2;32m'sagemaker-airflow-stack'\u001b[0m\u001b[2;36m.\u001b[0m\n",
"\u001b[1;35mProvisioning resources for stack 'sagemaker-airflow-stack'.\u001b[0m\n",
"\u001b[1;35mReading the config from /home/apenner/.config/zenml/airflow/f3b0bda3-5245-4134-8ad9-6b42affebcf5/airflow.cfg\u001b[0m\n",
"\u001b[1;35mConfigured default timezone Timezone('UTC')\u001b[0m\n",
"\u001b[1;35mResuming provisioned resources for stack sagemaker-airflow-stack.\u001b[0m\n"
]
}
],
"source": [
"!zenml stack up"
]
},
{
"cell_type": "code",
"execution_count": 25,
Expand Down Expand Up @@ -1408,6 +1389,8 @@
"source": [
"# Switch to full Sagemaker Stack\n",
"\n",
"Just one command will allow you to switch the full code execution over to sagemaker. No Sagemaker domain knowledge necessary. No setup of VMs or maintenance \n",
"\n",
"![Sagemaker local stack](_assets/sagemaker_stack.png)\n"
]
},
Expand All @@ -1430,6 +1413,8 @@
}
],
"source": [
"# Finally, this is all that needs to be done to fully switch the code to be run fully on sagemaker\n",
"\n",
"!zenml stack set sagemaker-stack"
]
},
Expand Down

0 comments on commit d323108

Please sign in to comment.