diff --git a/mnist-classifaction/deploy_model.ipynb b/mnist-classifaction/deploy_model.ipynb index fc7c4ec..efdd85d 100644 --- a/mnist-classifaction/deploy_model.ipynb +++ b/mnist-classifaction/deploy_model.ipynb @@ -64,6 +64,28 @@ "!mlfoundry login --host " ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Workspace FQN\n", + "Once you run the cell below you will get a prompt to enter your workspace.
\n", + "* Step 1: Click on the link given in the prompt.\n", + "* Step 2: Identify the Workspace you want to deploy the application in.\n", + "* Step 3: Copy the Workspace FQN
\n", + "![Copying Workspace FQN](https://files.readme.io/730fee2-Screenshot_2023-02-28_at_2.08.34_PM.png)\n", + "* Step 4: Paste the Workspace FQN in the prompt and press enter." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "WORKSPACE_FQN = input(\"Enter the FQN of the workspace to use: \")" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -297,13 +319,23 @@ "!pygmentize deploy_model/deploy.py" ] }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [], + "source": [ + "SERVICE_HOST = input(\"Enter the Service Host (Can be found from cluster details in Truefoundry UI)\")\n", + "SERVICE_PATH = input(\"Enter the Service Path where you want your service to be deployed\")" + ] + }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "!cd deploy_model/ && python deploy.py --workspace_fqn --model_version_fqn MODEL_VERSION_FQN --host --path " + "!cd deploy_model/ && python deploy.py --workspace_fqn $WORKSPACE_FQN --model_version_fqn $MODEL_VERSION_FQN --host $SERVICE_HOST --path $SERVICE_PATH" ] }, { diff --git a/mnist-classifaction/deploy_model/deploy.py b/mnist-classifaction/deploy_model/deploy.py index 4b6b6b4..3d382de 100644 --- a/mnist-classifaction/deploy_model/deploy.py +++ b/mnist-classifaction/deploy_model/deploy.py @@ -24,6 +24,7 @@ image=Build( build_spec=PythonBuild( command="python gradio_demo.py", + #commad="uvicorn fastapi_service:app --port 8001 --host 0.0.0.0" for deploying fastapi requirements_path="requirements.txt", ) ),