Skip to content

Commit

Permalink
fix: Fix Blueprint integration test (#88)
Browse files Browse the repository at this point in the history
Co-authored-by: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com>
  • Loading branch information
NimJay and kweinmeister committed Mar 27, 2024
1 parent 4551c08 commit 0457df4
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Deployment: 6 mins
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed. | `bool` | `false` | no |
| documentai\_location | Document AI location, see https://cloud.google.com/document-ai/docs/regions | `string` | `"us"` | no |
| firestore\_location | Firestore location, see https://firebase.google.com/docs/firestore/locations | `string` | `"nam5"` | no |
| initial\_index\_json\_path | Path to the initial (placeholder) Vector Search index | `string` | `"initial-index.json"` | no |
| project\_id | The Google Cloud project ID to deploy to | `string` | n/a | yes |
| region | The Google Cloud region to deploy to | `string` | `"us-central1"` | no |
| unique\_names | Whether to use unique names for resources | `bool` | `true` | no |
Expand Down
7 changes: 4 additions & 3 deletions examples/simple_example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/

module "simple" {
source = "../../"
project_id = var.project_id
webhook_path = abspath("../../webhook")
source = "../../"
project_id = var.project_id
webhook_path = abspath("../../webhook")
initial_index_json_path = abspath("../../initial-index.json")
}
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -260,5 +260,5 @@ resource "google_vertex_ai_index_endpoint" "docs" {
resource "google_storage_bucket_object" "index_initial" {
bucket = google_storage_bucket.main.name
name = "vector-search-index/initial.json"
source = abspath("initial-index.json")
source = var.initial_index_json_path
}
3 changes: 3 additions & 0 deletions metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ spec:
firestore_location:
name: firestore_location
title: Firestore Location
initial_index_json_path:
name: initial_index_json_path
title: Initial Index Json Path
project_id:
name: project_id
title: Project Id
Expand Down
13 changes: 10 additions & 3 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ spec:
detailed: This solution showcases how to extract question & answer pairs out of documents using Generative AI. It provides an end-to-end demonstration of QA extraction and fine-tuning of a large language model (LLM) on Vertex AI. Along the way, the solution utilizes Document AI Character Recognition (OCR), Firestore, Vector Search, Vertex AI Studio, and Cloud Functions.
icon: assets/icon.png
deploymentDuration:
configurationSecs: 120
deploymentSecs: 360
configurationSecs: "120"
deploymentSecs: "360"
costEstimate:
description: Cost Details
url: https://cloud.google.com/products/calculator-legacy#id=2ed62cc0-d0ab-4bff-918a-d5cb297b4201
Expand Down Expand Up @@ -80,10 +80,13 @@ spec:
description: Firestore location, see https://firebase.google.com/docs/firestore/locations
varType: string
defaultValue: nam5
- name: initial_index_json_path
description: Path to the initial (placeholder) Vector Search index
varType: string
defaultValue: initial-index.json
- name: project_id
description: The Google Cloud project ID to deploy to
varType: string
defaultValue: null
required: true
- name: region
description: The Google Cloud region to deploy to
Expand Down Expand Up @@ -124,12 +127,16 @@ spec:
- roles/artifactregistry.admin
- roles/documentai.editor
- roles/firebase.admin
- roles/iam.serviceAccountAdmin
- roles/iam.serviceAccountUser
- roles/resourcemanager.projectIamAdmin
- roles/serviceusage.serviceUsageAdmin
services:
- aiplatform.googleapis.com
- artifactregistry.googleapis.com
- cloudbuild.googleapis.com
- cloudfunctions.googleapis.com
- cloudresourcemanager.googleapis.com
- documentai.googleapis.com
- eventarc.googleapis.com
- firestore.googleapis.com
Expand Down
3 changes: 3 additions & 0 deletions test/setup/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ locals {
"roles/artifactregistry.admin",
"roles/documentai.editor",
"roles/firebase.admin",
"roles/iam.serviceAccountAdmin",
"roles/iam.serviceAccountUser",
"roles/resourcemanager.projectIamAdmin",
"roles/serviceusage.serviceUsageAdmin",
]
}

Expand Down
1 change: 1 addition & 0 deletions test/setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module "project" {
"artifactregistry.googleapis.com",
"cloudbuild.googleapis.com",
"cloudfunctions.googleapis.com",
"cloudresourcemanager.googleapis.com",
"documentai.googleapis.com",
"eventarc.googleapis.com",
"firestore.googleapis.com",
Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ variable "webhook_path" {
default = "webhook"
}

# Used for testing.
variable "initial_index_json_path" {
description = "Path to the initial (placeholder) Vector Search index"
type = string
default = "initial-index.json"
}

variable "unique_names" {
description = "Whether to use unique names for resources"
type = bool
Expand Down

0 comments on commit 0457df4

Please sign in to comment.