Skip to content

Commit

Permalink
Some bug fixes and more doc (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
jobergum committed Nov 1, 2023
1 parent 749b23a commit dd09691
Show file tree
Hide file tree
Showing 3 changed files with 337 additions and 354 deletions.
18 changes: 13 additions & 5 deletions docs/sphinx/source/getting-started-pyvespa-cloud.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,15 @@
"Note that the subsequent deploy-call below will add `data-plane-public-cert.pem` to the application before deploying it to Vespa Cloud, so that\n",
"you have access to both the private key and the public certificate, while Vespa Cloud only knows the public certificate. \n",
"\n",
"### Configure control-plane security \n",
"\n",
"Authenticate to generate a tenant level control plane API key for deploying the applications to Vespa Cloud, and save the path to it. \n",
"\n",
"The generated tenant api key must be added in the Vespa Console before attemting to deploy the application. \n",
"\n",
"```\n",
"To use this key in Vespa Cloud click 'Add custom key' at\n",
"https://console.vespa-cloud.com/tenant/samples/account/keys\n",
"https://console.vespa-cloud.com/tenant/TENANT_NAME/account/keys\n",
"and paste the entire public key including the BEGIN and END lines.\n",
"```"
]
Expand Down Expand Up @@ -295,14 +297,20 @@
"source": [
"from vespa.deployment import VespaCloud\n",
"\n",
"\n",
"key_content=os.getenv(\"VESPA_TEAM_API_KEY\").replace(r\"\\n\", \"\\n\")\n",
"def read_secret():\n",
" \"\"\"Read the API key from the environment variable. This is \n",
" only used for CI/CD purposes.\"\"\"\n",
" t = os.getenv(\"VESPA_TEAM_API_KEY\")\n",
" if t:\n",
" return t.replace(r\"\\n\", \"\\n\")\n",
" else:\n",
" return t\n",
"\n",
"vespa_cloud = VespaCloud(\n",
" tenant=os.environ[\"TENANT_NAME\"],\n",
" application=application,\n",
" key_content=key_content,\n",
" #key_location=api_key_path,\n",
" key_content=read_secret() if read_secret() else None,\n",
" key_location=api_key_path,\n",
" application_package=package)"
]
},
Expand Down

0 comments on commit dd09691

Please sign in to comment.