Skip to content

Commit

Permalink
docs: Add additional explanation on jumpbox and port fowarding setup …
Browse files Browse the repository at this point in the history
…with minor fix. (#52)

Co-authored-by: Robert Xiong <>
  • Loading branch information
robertx-dev committed Mar 12, 2024
1 parent c686ab4 commit 72e8128
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions samples/langchain_quick_start.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,21 @@
"source": [
"Memorystore for Redis uses private, internal IP addresses for security. To access your Redis instance from the public internet, you'll need to set up a jump box and SSH into it from your Colab with port forwarding. Using a local Colab runtime makes this process easier.\n",
"\n",
"Download and run the latest Colab runtime docker image on your local machine: `docker run --network=host us-docker.pkg.dev/colab-images/public/runtime`"
"The flow of a connection to Redis instance in this colab example would be:\n",
"\n",
"```\n",
"Colab browser -> Colab runtime on local machine -> GCE VM(jump box) -> Redis instance\n",
"```"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Connect Colab to the local Colab runtime. Please refer to the [instructions](https://research.google.com/colaboratory/local-runtimes.html)."
"1. Download and run the latest Colab runtime docker image on your local machine: `docker run --network=host us-docker.pkg.dev/colab-images/public/runtime`\n",
"\n",
"1. Connect Colab to the local Colab runtime. Please refer to the [instructions](https://research.google.com/colaboratory/local-runtimes.html)."
]
},
{
Expand Down Expand Up @@ -350,7 +356,14 @@
"outputs": [],
"source": [
"redis_ip = !gcloud beta redis instances describe {instance_name} --region {region} --format=\"value(host)\"\n",
"!gcloud compute ssh --project={project_id} --zone={zone} {vm_name} -- -NL 6379:{redis_ip}:6379"
"!gcloud compute ssh --project={project_id} --zone={zone} {vm_name} -- -NL 6379:{redis_ip[0]}:6379\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Please run the above command printed in the output of above step in your local machine to establishing traffic forwarding. Note that the above command is a processed as a blocking command, hence it has to be executed outside Colab and you will need run it on your local machine terminal."
]
},
{
Expand Down

0 comments on commit 72e8128

Please sign in to comment.