-
Notifications
You must be signed in to change notification settings - Fork 7
/
config.default
184 lines (144 loc) · 7.52 KB
/
config.default
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# Copyright 2022 Google LLC All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
######################################################
#
# Configs
#
# Update these variables based on your GCP project,
# naming convensions, and desired settings.
#
# Where it makes sense, code has been added
# to dynamically set variable values, but these
# can all be overridden by adding in your own values
# within this file.
#
# NOTE: The "TF_VAR_" prefix is used so that terraform
# can dynamically load these env variables.
#
######################################################
######################################################
# General Project Parameters
######################################################
# GCP Project ID
# TODO: User needs to add their own value prior to deployment
export TF_VAR_GCP_PROJECT_ID=<YOUR_GCP_PROJECT_ID>
# GCP Project Number
# TODO: User needs to add their own value prior to deployment
export TF_VAR_GCP_PROJECT_NUMBER=<YOUR_GCP_PROJECT_NUMBER>
# GCP Region where the Clean-Chat resources should be deployed.
# TODO (Optional): User may add their own value prior to deployment
export TF_VAR_GCP_REGION=us-central1
# Solution name that is used as a naming prefix
# TODO (Optional): User may add their own value prior to deployment
export TF_VAR_SOLUTION_NAME=clean-chat
# (Optional) Add your model API key here if you choose to
# deploy a model that requires an API key, using services from
# Cohere.ai, Perspective, etc.
export TF_VAR_MODEL_API_KEY=""
######################################################
# Google Artifact Repo
######################################################
export TF_VAR_GCP_ARTIFACT_REGISTRY_NAME=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-repo
export TF_VAR_GCP_ARTIFACT_REGISTRY_REGION=${TF_VAR_GCP_REGION}
######################################################
# Google Cloud Storage
######################################################
# GCS bucket where text-based chat files will be dropped/uploaded.
export TF_VAR_GCS_BUCKET_TEXT_DROPZONE=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-text-dropzone
# GCS bucket where audio files will be dropped/uploaded.
export TF_VAR_GCS_BUCKET_AUDIO_DROPZONE_SHORT=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-audio-dropzone-short
export TF_VAR_GCS_BUCKET_AUDIO_DROPZONE_LONG=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-audio-dropzone-long
export TF_VAR_GCS_BUCKET_AUDIO_STT_RESULTS=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-audio-stt-results
# GCS bucket for cloud functions tmp space
export TF_VAR_GCS_BUCKET_CLOUD_FUNCTIONS=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-cloud-functions
# GCS bucket for Dataflow - tmp and staging assets.
export TF_VAR_GCS_BUCKET_DATAFLOW=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-dataflow
######################################################
# Google PubSub
######################################################
# PubSub topic where chat/txt messages will be sent to for analysis.
export TF_VAR_PUBSUB_TOPIC_TEXT_INPUT=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-text-input
# This topic contains the scored messages as a JSON payload.
export TF_VAR_PUBSUB_TOPIC_TEXT_SCORED=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-text-scored
export TF_VAR_PUBSUB_TOPIC_TEXT_SCORED_PUSH_ENDPOINT=https://${TF_VAR_SOLUTION_NAME}-api-backend-placeholder-uc.a.run.app/${TF_VAR_SOLUTION_NAME}-callback
# PubSub topic for flagged/toxic user (if a toxic user is flagged, a message will be sent here)
export TF_VAR_PUBSUB_TOPIC_TOXIC=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-toxic-topic
######################################################
# API Endpoint & Backend
######################################################
# API Backend App Parameters
export TF_VAR_APP_CLOUD_RUN_NAME=${TF_VAR_SOLUTION_NAME}-api-backend
export TF_VAR_APP_CLOUD_RUN_REGION=${TF_VAR_GCP_REGION}
# API Endpoint Parameters
export TF_VAR_ENDPOINTS_CLOUD_RUN_NAME=${TF_VAR_SOLUTION_NAME}-api-endpoint
export TF_VAR_ENDPOINTS_CLOUD_RUN_REGION=${TF_VAR_GCP_REGION}
######################################################
# BigQuery
######################################################
# BigQuery locations such as US, EU, us-central1, europe-west1, etc.
# Reference: https://cloud.google.com/bigquery/docs/locations
export TF_VAR_BIGQUERY_LOCATION=US
export TF_VAR_BIGQUERY_DATASET=clean_chat
export TF_VAR_BIGQUERY_TABLE=scored_chats
######################################################
# Google Dataflow (Scoring Engine configs)
######################################################
# Dataflow Region
export TF_VAR_DATAFLOW_REGION=${TF_VAR_GCP_REGION}
# Dataflow Runner (typically DataflowRunner, or DirectRunner for local testing/deployment)
export TF_VAR_DATAFLOW_RUNNER=DataflowRunner
# Max Dataflow workers
export TF_VAR_MAX_DATAFLOW_WORKERS=2
# Scoring engine time window settings
# Toxic scores are aggregated based on the time window parameters, set below.
# Window duration (in seconds) is the time window that the aggregation is applied to.
# Example: If the TF_VAR_WINDOW_DURATION_SECONDS=30, then scores will be aggregated
# for a 30 second time period.
# https://beam.apache.org/documentation/programming-guide/#sliding-time-windows
export TF_VAR_WINDOW_DURATION_SECONDS=30
# Window sliding (in seconds) is a parameter used to determine how often a new window starts
# Example: If the TF_VAR_WINDOW_SLIDING_SECONDS=5, then scores will be calculated across the
# window at 5 second intervals.
# https://beam.apache.org/documentation/programming-guide/#sliding-time-windows
export TF_VAR_WINDOW_SLIDING_SECONDS=5
# Toxicity Threshold (from 0.0 to 1.0 where 1.0 is highly toxic)
export TF_VAR_TOXIC_USER_THRESHOLD=0.60
######################################################
# Machine Learning
######################################################
# GKE cluster name for ML Pipeline
export TF_VAR_ML_CLUSTER=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-ml-cluster
# GKE zone
export TF_VAR_ML_ZONE=${TF_VAR_GCP_REGION}
# GKE machine type
export TF_VAR_ML_MACHINE_TYPE=n1-standard-2
# Additional ML Pipeline Configs
export TF_VAR_ML_SCOPES=cloud-platform
export TF_VAR_ML_PIPELINE_NAME=${TF_VAR_GCP_PROJECT_ID}-toxicity-pipeline
export TF_VAR_ML_PIPELINE_ROOT=${TF_VAR_GCP_PROJECT_ID}-kubeflow-root
export TF_VAR_ML_APP_INSTANCE_NAME=${TF_VAR_GCP_PROJECT_ID}-${TF_VAR_SOLUTION_NAME}-ml-pipeline
export TF_VAR_ML_NAMESPACE=${TF_VAR_SOLUTION_NAME}-ml-namespace
export TF_VAR_MARKETPLACE_TOOLS_TAG=remove-ui-ownerrefs
export TF_VAR_MARKETPLACE_TOOLS_IMAGE=gcr.io/cloud-marketplace-staging/marketplace-k8s-app-tools/k8s/dev
######################################################
# Get current working dir
######################################################
export TF_VAR_CURRENT_DIR=$PWD
######################################################
# Environment varirables for tfx pipeline on Vertex AI
######################################################
export ML_GCS_BUCKET=gs://${TF_VAR_GCP_PROJECT_ID}-clean-chat-bert
######################################################
# End of Config
######################################################