Skip to content

Commit 66f7bc7

Browse files
authored
Merge pull request #10 from DeNA/feature/update-to-v1.0.0
Update to v1.0.0
2 parents f7505e9 + 20d3cee commit 66f7bc7

File tree

17 files changed

+309
-311
lines changed

17 files changed

+309
-311
lines changed

terraform/environments/dev/main.tf

+63-32
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,61 @@
1+
locals {
2+
shared_env_vars = {
3+
"SECRET_KEY" = var.secret_key
4+
"LOG_LEVEL" = "INFO"
5+
"CONSOLE_WEB_URL" = ""
6+
"CONSOLE_API_URL" = ""
7+
"SERVICE_API_URL" = ""
8+
"APP_WEB_URL" = ""
9+
"CHECK_UPDATE_URL" = "https://updates.dify.ai"
10+
"OPENAI_API_BASE" = "https://api.openai.com/v1"
11+
"FILES_URL" = ""
12+
"MIGRATION_ENABLED" = "true"
13+
"CELERY_BROKER_URL" = "redis://${module.redis.redis_host}:${module.redis.redis_port}/1"
14+
"WEB_API_CORS_ALLOW_ORIGINS" = "*"
15+
"CONSOLE_CORS_ALLOW_ORIGINS" = "*"
16+
"DB_USERNAME" = var.db_username
17+
"DB_PASSWORD" = var.db_password
18+
"DB_HOST" = module.cloudsql.cloudsql_internal_ip
19+
"DB_PORT" = var.db_port
20+
"DB_DATABASE" = var.db_database
21+
"STORAGE_TYPE" = var.storage_type
22+
"GOOGLE_STORAGE_BUCKET_NAME" = module.storage.storage_bucket_name
23+
"GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64" = module.storage.storage_admin_key_base64
24+
"REDIS_HOST" = module.redis.redis_host
25+
"REDIS_PORT" = module.redis.redis_port
26+
"VECTOR_STORE" = var.vector_store
27+
"PGVECTOR_HOST" = module.cloudsql.cloudsql_internal_ip
28+
"PGVECTOR_PORT" = "5432"
29+
"PGVECTOR_USER" = var.db_username
30+
"PGVECTOR_PASSWORD" = var.db_password
31+
"PGVECTOR_DATABASE" = var.db_database
32+
"CODE_EXECUTION_ENDPOINT" = module.cloudrun.dify_sandbox_url
33+
"CODE_EXECUTION_API_KEY" = "dify-sandbox"
34+
"INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH" = var.indexing_max_segmentation_tokens_length
35+
"PLUGIN_DAEMON_KEY" = var.plugin_daemon_key
36+
"PLUGIN_DIFY_INNER_API_KEY" = var.plugin_dify_inner_api_key
37+
}
38+
}
39+
140
module "cloudrun" {
241
source = "../../modules/cloudrun"
342

4-
project_id = var.project_id
5-
region = var.region
6-
dify_version = var.dify_version
7-
dify_sandbox_version = var.dify_sandbox_version
8-
cloud_run_ingress = var.cloud_run_ingress
9-
nginx_repository_id = var.nginx_repository_id
10-
web_repository_id = var.web_repository_id
11-
api_repository_id = var.api_repository_id
12-
sandbox_repository_id = var.sandbox_repository_id
13-
secret_key = var.secret_key
14-
db_username = var.db_username
15-
db_password = var.db_password
16-
db_host = module.cloudsql.cloudsql_internal_ip
17-
db_port = var.db_port
18-
db_database = var.db_database
19-
storage_type = var.storage_type
20-
vector_store = var.vector_store
21-
indexing_max_segmentation_tokens_length = var.indexing_max_segmentation_tokens_length
22-
23-
vpc_network_name = module.network.vpc_network_name
24-
redis_host = module.redis.redis_host
25-
redis_port = module.redis.redis_port
26-
google_storage_service_account_json_base64 = module.storage.storage_admin_key_base64
27-
google_storage_bucket_name = module.storage.storage_bucket_name
28-
43+
project_id = var.project_id
44+
region = var.region
45+
dify_version = var.dify_version
46+
dify_sandbox_version = var.dify_sandbox_version
47+
cloud_run_ingress = var.cloud_run_ingress
48+
nginx_repository_id = var.nginx_repository_id
49+
web_repository_id = var.web_repository_id
50+
api_repository_id = var.api_repository_id
51+
sandbox_repository_id = var.sandbox_repository_id
52+
vpc_network_name = module.network.vpc_network_name
53+
vpc_subnet_name = module.network.vpc_subnet_name
54+
plugin_daemon_repository_id = var.plugin_daemon_repository_id
55+
plugin_daemon_key = var.plugin_daemon_key
56+
plugin_dify_inner_api_key = var.plugin_dify_inner_api_key
57+
dify_plugin_daemon_version = var.dify_plugin_daemon_version
58+
shared_env_vars = local.shared_env_vars
2959
}
3060

3161
module "cloudsql" {
@@ -66,12 +96,13 @@ module "storage" {
6696
module "registry" {
6797
source = "../../modules/registry"
6898

69-
project_id = var.project_id
70-
region = var.region
71-
nginx_repository_id = var.nginx_repository_id
72-
web_repository_id = var.web_repository_id
73-
api_repository_id = var.api_repository_id
74-
sandbox_repository_id = var.sandbox_repository_id
99+
project_id = var.project_id
100+
region = var.region
101+
nginx_repository_id = var.nginx_repository_id
102+
web_repository_id = var.web_repository_id
103+
api_repository_id = var.api_repository_id
104+
sandbox_repository_id = var.sandbox_repository_id
105+
plugin_daemon_repository_id = var.plugin_daemon_repository_id
75106
}
76107

77108
locals {
@@ -90,4 +121,4 @@ resource "google_project_service" "enabled_services" {
90121
for_each = toset(local.services)
91122
project = var.project_id
92123
service = each.value
93-
}
124+
}

terraform/environments/dev/terraform.tfvars

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
project_id = "your-project-id" # replace with your project id
22
region = "your-region" # replace with your region
33
dify_version = "latest"
4+
dify_plugin_daemon_version = "latest"
45
dify_sandbox_version = "latest"
56
nginx_repository_id = "dify-nginx-repo"
67
web_repository_id = "dify-web-repo"
78
api_repository_id = "dify-api-repo"
9+
plugin_daemon_repository_id = "dify-plugin-daemon-repo"
810
sandbox_repository_id = "dify-sandbox-repo"
911
secret_key = "your-secret-key" # replace with a generated value (run command `openssl rand -base64 42`)
1012
db_username = "postgres"
@@ -15,4 +17,6 @@ storage_type = "google-storage"
1517
google_storage_bucket_name = "dify"
1618
vector_store = "pgvector"
1719
indexing_max_segmentation_tokens_length = "1000"
18-
cloud_run_ingress = "INGRESS_TRAFFIC_ALL" # recommend to setup load balancer and use "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER"
20+
cloud_run_ingress = "INGRESS_TRAFFIC_ALL" # recommend to setup load balancer and use "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER"
21+
plugin_daemon_key = "your-plugin-daemon-key" # replace with a generated value (run command `openssl rand -base64 42`)
22+
plugin_dify_inner_api_key = "your-plugin-dify-inner-api-key" # replace with a generated value (run command `openssl rand -base64 42`)

terraform/environments/dev/variables.tf

+15
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ variable "api_repository_id" {
3030
type = string
3131
}
3232

33+
variable "plugin_daemon_repository_id" {
34+
type = string
35+
}
36+
3337
variable "sandbox_repository_id" {
3438
type = string
3539
}
@@ -70,3 +74,14 @@ variable "indexing_max_segmentation_tokens_length" {
7074
type = number
7175
}
7276

77+
variable "plugin_daemon_key" {
78+
type = string
79+
}
80+
81+
variable "plugin_dify_inner_api_key" {
82+
type = string
83+
}
84+
85+
variable "dify_plugin_daemon_version" {
86+
type = string
87+
}

0 commit comments

Comments
 (0)