From f4ba2b0ee86f78e0dcded96a8812e35f6a06ff81 Mon Sep 17 00:00:00 2001 From: Saeid Date: Mon, 5 Sep 2022 15:31:50 +0100 Subject: [PATCH] custom server requirements.txt file generation added to the notebook (#711) --- docs/examples/custom/README.ipynb | 29 +++++++++++++++++++++++++++-- docs/examples/custom/README.md | 11 +++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/docs/examples/custom/README.ipynb b/docs/examples/custom/README.ipynb index f4fd431e9..6395a9711 100644 --- a/docs/examples/custom/README.ipynb +++ b/docs/examples/custom/README.ipynb @@ -335,6 +335,26 @@ "With that goal in mind, the rough outline of steps will be to first build a custom image containing our code, and then deploy it.\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Specifying requirements\n", + "MLServer will automatically find your requirements.txt file and install necessary python packages" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%writefile requirements.txt\n", + "numpy==1.22.0\n", + "numpyro==0.8.0\n", + "jax==0.2.24" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -467,7 +487,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.8.10 64-bit", "language": "python", "name": "python3" }, @@ -481,7 +501,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.8" + "version": "3.8.10" + }, + "vscode": { + "interpreter": { + "hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a" + } } }, "nbformat": 4, diff --git a/docs/examples/custom/README.md b/docs/examples/custom/README.md index f74533f01..9e66c3f66 100644 --- a/docs/examples/custom/README.md +++ b/docs/examples/custom/README.md @@ -251,6 +251,17 @@ Now that we have written and tested our custom model, the next step is to deploy With that goal in mind, the rough outline of steps will be to first build a custom image containing our code, and then deploy it. +### Specifying requirements +MLServer will automatically find your requirements.txt file and install necessary python packages + + +```python +%%writefile requirements.txt +numpy==1.22.0 +numpyro==0.8.0 +jax==0.2.24 +``` + ### Building a custom image ```{note}