|
52 | 52 | "id": "markdown-header" |
53 | 53 | } |
54 | 54 | }, |
55 | | - { |
56 | | - "cell_type": "markdown", |
57 | | - "metadata": { |
58 | | - "id": "ce84cca6" |
59 | | - }, |
60 | | - "source": [ |
61 | | - "## Resources\n", |
62 | | - "\n", |
63 | | - "* [Get Started with AlloyDB](https://cloud.google.com/alloydb/docs/quickstart)" |
64 | | - ] |
65 | | - }, |
66 | 55 | { |
67 | 56 | "cell_type": "code", |
68 | 57 | "source": [ |
|
71 | 60 | "# 1. CONFIGURATION\n", |
72 | 61 | "# ==========================================\n", |
73 | 62 | "# @markdown ### **⚙️ 1. Cluster Configuration**\n", |
74 | | - "project_id = \"your-project-id\" # @param {type:\"string\"}\n", |
75 | | - "region = \"your-region-id\" # @param {type:\"string\"}\n", |
76 | | - "cluster_id = \"your-cluster-id\" # @param {type:\"string\"}\n", |
77 | | - "instance_id = \"your-instance-id\" # @param {type:\"string\"}\n", |
| 63 | + "project_id = \"\" # @param {type:\"string\", placeholder:\"Project ID\"}\n", |
| 64 | + "region = \"\" # @param {type:\"string\", placeholder: \"Region (e.g. us-central1)\"}\n", |
| 65 | + "cluster_name = \"\" # @param {type:\"string\", placeholder: \"Cluster name\"}\n", |
| 66 | + "instance_name = \"\" # @param {type:\"string\", placeholder: \"Instance Name\"}\n", |
78 | 67 | "\n", |
79 | 68 | "# @markdown ### **🔐 2. Database Credentials**\n", |
80 | | - "db_user = \"your-database-user\" # @param {type:\"string\"}\n", |
81 | | - "db_name = \"your-database-name\" # @param {type:\"string\"}\n", |
| 69 | + "# @markdown *Note: Password will be requested securely when the benchmark is executed.*\n", |
| 70 | + "db_user = \"\" # @param {type:\"string\", placeholder: \"DB User\"}\n", |
| 71 | + "db_name = \"\" # @param {type:\"string\", placeholder: \"DB Name\"}\n", |
82 | 72 | "\n", |
83 | 73 | "# @markdown ### **⚙️ 3. Benchmark Settings**\n", |
84 | 74 | "# @markdown *Note: Increasing these values will provide more intensive testing, but will slow down the benchmark runtime.*\n", |
85 | | - "test_queries = 1000 # @param {type:\"integer\"}\n", |
86 | | - "search_limit = 10 # @param {type:\"integer\"}\n", |
| 75 | + "# @markdown ### **⚙️ 3. Benchmark Settings**\n", |
| 76 | + "# @markdown *Note: Increasing these values will provide more intensive testing, but will slow down the benchmark runtime.*\n", |
| 77 | + "# @markdown * `test_queries`: The total number of test queries to run during the benchmark. Increasing this value provides a more stable average but slows down the overall runtime.\n", |
| 78 | + "# @markdown * `search_limit`: The number of nearest neighbors to retrieve per query (i.e., the `LIMIT` on the vector similarity search, equivalent to top-k).\n", |
| 79 | + "\n", |
| 80 | + "test_queries = 1000 # @param [100, 1000, 10000] {type:\"raw\"}\n", |
| 81 | + "search_limit = 10 # @param [10, 100] {type:\"raw\"}\n", |
87 | 82 | "vector_dim = 100 # Fixed for GloVe-100 dataset\n", |
88 | 83 | "\n", |
89 | 84 | "import getpass\n", |
|
228 | 223 | "async def monitor_index_progress(connector):\n", |
229 | 224 | " try:\n", |
230 | 225 | " poll_conn = await connector.connect(\n", |
231 | | - " f\"projects/{project_id}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}\",\n", |
| 226 | + " f\"projects/{project_id}/locations/{region}/clusters/{cluster_name}/instances/{instance_name}\",\n", |
232 | 227 | " \"asyncpg\", user=db_user, password=db_pass, db=db_name, ip_type=\"PUBLIC\"\n", |
233 | 228 | " )\n", |
234 | 229 | " except Exception:\n", |
|
400 | 395 | " console.print(\"\\n[bold blue]Step 1/9:[/bold blue] 🔌 Initializing AlloyDB AsyncConnector...\")\n", |
401 | 396 | " connector = AsyncConnector()\n", |
402 | 397 | " conn = await connector.connect(\n", |
403 | | - " f\"projects/{project_id}/locations/{region}/clusters/{cluster_id}/instances/{instance_id}\",\n", |
| 398 | + " f\"projects/{project_id}/locations/{region}/clusters/{cluster_name}/instances/{instance_name}\",\n", |
404 | 399 | " \"asyncpg\", user=db_user, password=db_pass, db=db_name, ip_type=\"PUBLIC\"\n", |
405 | 400 | " )\n", |
406 | 401 | "\n", |
|
0 commit comments