From 416c5baf42f3e21fa37eb2823459cb87619c01c5 Mon Sep 17 00:00:00 2001 From: Robert Xiong <> Date: Mon, 11 Mar 2024 14:38:32 -0700 Subject: [PATCH] [fix] Add additional explanation on jumpbox and port fowarding setup with minor fix. --- samples/langchain_quick_start.ipynb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/samples/langchain_quick_start.ipynb b/samples/langchain_quick_start.ipynb index ff95ce0..f0a6f85 100644 --- a/samples/langchain_quick_start.ipynb +++ b/samples/langchain_quick_start.ipynb @@ -91,7 +91,11 @@ "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", + "```" ] }, { @@ -99,7 +103,9 @@ "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)." ] }, { @@ -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." ] }, {