Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasecchig committed Sep 18, 2024
1 parent e51d2a2 commit dcc0dd8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This template covers all aspects of Generative AI app development, from prototyp

| Description | Visualization |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| Start with a variety of common patterns: this repository offers examples including a basic conversational chain, a production-ready RAG (Retrieval-Augmented Generation) chain developed with python, and a LangGraph agent implementation. Use them in the application by changing one line of code. See the [README](app/README.md) for more details. | ![patterns available](images/patterns_available.png) |
| Start with a variety of common patterns: this repository offers examples including a basic conversational chain, a production-ready RAG (Retrieval-Augmented Generation) chain developed with python, and a LangGraph agent implementation. Use them in the application by changing one line of code. See the [Readme](app/README.md) for more details. | ![patterns available](images/patterns_available.png) |

</details>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ The application leverages [**Terraform**](http://terraform.io) to define and pro
- CI/CD project (can be the same as staging or production)
2. Terraform installed on your local machine
3. Enable required APIs in the CI/CD project. This will be required for the Terraform deployment:

```bash
gcloud config set project YOUR_CI_CD_PROJECT_ID
gcloud services enable serviceusage.googleapis.com cloudresourcemanager.googleapis.com cloudbuild.googleapis.com secretmanager.googleapis.com
```

## Step-by-Step Guide

1. **Create a Git Repository using your favorite git provider (GitHub, GitLab, Bitbucket, etc.)**
1. **Create a Git Repository using your favorite Git provider (GitHub, GitLab, Bitbucket, etc.)**

2. **Connect Your Repository to Cloud Build**
For detailed instructions, visit: [Cloud Build Repository Setup](https://cloud.google.com/build/docs/repositories#whats_next).<br>
Expand All @@ -54,37 +55,43 @@ The application leverages [**Terraform**](http://terraform.io) to define and pro
3. **Configure Terraform Variables**
- Edit [`deployment/terraform/vars/env.tfvars`](../terraform/vars/env.tfvars) with your Google Cloud settings.

| Variable | Description | Required |
| ---------------------- | --------------------------------------------------------------- | :------: |
| prod_project_id | **Production** Google Cloud Project ID for resource deployment. | Yes |
| staging_project_id | **Staging** Google Cloud Project ID for resource deployment. | Yes |
| cicd_runner_project_id | Google Cloud Project ID where CI/CD pipelines will execute. | Yes |
| region | Google Cloud region for resource deployment. | Yes |
| host_connection_name | Name of the host connection you created in Cloud Build | Yes |
| repository_name | Name of the repository you added to Cloud Build | Yes |
| Variable | Description | Required |
| ---------------------- | --------------------------------------------------------------- | :------: |
| prod_project_id | **Production** Google Cloud Project ID for resource deployment. | Yes |
| staging_project_id | **Staging** Google Cloud Project ID for resource deployment. | Yes |
| cicd_runner_project_id | Google Cloud Project ID where CI/CD pipelines will execute. | Yes |
| region | Google Cloud region for resource deployment. | Yes |
| host_connection_name | Name of the host connection you created in Cloud Build | Yes |
| repository_name | Name of the repository you added to Cloud Build | Yes |

Other optional variables include: telemetry and feedback BigQuery dataset IDs, log filters, sink names, service account names, bucket name suffixes, artifact registry repo name, and various role assignments for Cloud Run and CICD.
Other optional variables include: telemetry and feedback BigQuery dataset IDs, log filters, sink names, service account names, bucket name suffixes, artifact registry repository name, and various role assignments for Cloud Run and CICD.

4. **Deploy Infrastructure with Terraform**
- Open a terminal and navigate to the Terraform directory:
```bash
cd deployment/terraform
```

```bash
cd deployment/terraform
```

- Initialize Terraform:
```bash
terraform init
```

```bash
terraform init
```

- Apply the Terraform configuration:
```bash
terraform apply --var-file vars/env.tfvars
```

```bash
terraform apply --var-file vars/env.tfvars
```

- Type 'yes' when prompted to confirm

After completing these steps, your infrastructure will be set up and ready for deployment!

## Dev Deployment

For end-to-end testing of the application, including tracing and feedback sinking to BigQuery, without the need to trigger a CI/CD pipeline.
For End-to-end testing of the application, including tracing and feedback sinking to BigQuery, without the need to trigger a CI/CD pipeline.

After you edited the relative [`env.tfvars` file](../terraform/dev/vars/env.tfvars), follow the following instructions:

Expand All @@ -100,7 +107,7 @@ Then deploy the application using the following command (from the root of the re
gcloud run deploy conversational-app-sample --source . --project $YOUR_DEV_PROJECT_ID --service-account genai-app-sample-cr-sa@$YOUR_DEV_PROJECT_ID.iam.gserviceaccount.com
```

### E2E Demo video
### End-to-end Demo video

<a href="https://storage.googleapis.com/test-elia-us-central1/template%20deployment%20demo.mp4">
<img src="../images/preview_video.png" alt="Watch the video" width="300"/>
Expand Down

0 comments on commit dcc0dd8

Please sign in to comment.