Skip to content

Commit

Permalink
Unique endpoint name (#2660)
Browse files Browse the repository at this point in the history
* randomize keyvault name

* formatting

* shorten kv name

* unique endpoint name

* remove duplicate code

---------

Co-authored-by: Vanessa Arndorfer <vaarndor@microsoft.com>
  • Loading branch information
varndorfer and Vanessa Arndorfer authored Sep 20, 2023
1 parent b2c1bfb commit 5e38bff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
"outputs": [],
"source": [
"# create a endpoint\n",
"import datetime\n",
"\n",
"from azure.ai.ml.entities import (\n",
" ManagedOnlineEndpoint,\n",
")\n",
Expand All @@ -146,7 +148,8 @@
" MLClient,\n",
")\n",
"\n",
"online_endpoint_name = \"aml-llm-demo-langchain-endpoint\"\n",
"time = str(datetime.datetime.now().strftime(\"%m%d%H%M%f\"))\n",
"online_endpoint_name = f\"aml-llm-lc-demo-{time}\"\n",
"\n",
"# get a handle to the workspace\n",
"ml_client = MLClient(credential, SUBSCRIPTION_ID, RESOURCE_GROUP, AML_WORKSPACE_NAME)\n",
Expand Down Expand Up @@ -208,10 +211,6 @@
"metadata": {},
"outputs": [],
"source": [
"import datetime\n",
"\n",
"time = str(datetime.datetime.now().strftime(\"%m%d%H%M%f\"))\n",
"\n",
"KEYVAULT_NAME = f\"llmdemokv{time}\"\n",
"KV_OPENAI_KEY = \"OPENAI-API-KEY\"\n",
"\n",
Expand Down Expand Up @@ -352,7 +351,7 @@
" image=\"mcr.microsoft.com/azureml/minimal-ubuntu20.04-py38-cpu-inference:latest\",\n",
")\n",
"\n",
"deployment_name = f\"deploy-{str(datetime.datetime.now().strftime('%m%d%H%M%f'))}\"\n",
"deployment_name = f\"deploy-{time}\"\n",
"lc_deployment = ManagedOnlineDeployment(\n",
" name=deployment_name,\n",
" environment=env,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@
"outputs": [],
"source": [
"# create a endpoint\n",
"import datetime\n",
"\n",
"from azure.ai.ml.entities import (\n",
" ManagedOnlineEndpoint,\n",
")\n",
Expand All @@ -178,7 +180,8 @@
" MLClient,\n",
")\n",
"\n",
"online_endpoint_name = \"aml-llm-demo-sk-endpoint\"\n",
"time = str(datetime.datetime.now().strftime(\"%m%d%H%M%f\"))\n",
"online_endpoint_name = f\"aml-llm-sk-demo-{time}\"\n",
"\n",
"ml_client = MLClient(credential, SUBSCRIPTION_ID, RESOURCE_GROUP, AML_WORKSPACE_NAME)\n",
"\n",
Expand Down Expand Up @@ -239,10 +242,6 @@
"metadata": {},
"outputs": [],
"source": [
"import datetime\n",
"\n",
"time = str(datetime.datetime.now().strftime(\"%m%d%H%M%f\"))\n",
"\n",
"KEYVAULT_NAME = f\"llmdemokv{time}\"\n",
"KV_OPENAI_KEY = \"OPENAI-API-KEY\"\n",
"\n",
Expand Down Expand Up @@ -376,7 +375,7 @@
" Environment,\n",
")\n",
"\n",
"deployment_name = f\"deploy-{str(datetime.datetime.now().strftime('%m%d%H%M%f'))}\"\n",
"deployment_name = f\"deploy-{time}\"\n",
"sk_deployment = ManagedOnlineDeployment(\n",
" name=deployment_name,\n",
" model=Model(path=\"../src\"),\n",
Expand Down

0 comments on commit 5e38bff

Please sign in to comment.