diff --git a/src/s.yaml b/src/s.yaml index c202266..a4d40d1 100644 --- a/src/s.yaml +++ b/src/s.yaml @@ -5,6 +5,9 @@ access: "{{ access }}" vars: region: "{{ region }}" name: "{{ projectname }}" #这里的 name 是 project name,用于作为资源前缀 + db_username: "{{ db_username }}" + db_password: "{{ db_password }}" + db_database: "{{ db_database }}" resources: VectorDB: @@ -13,9 +16,9 @@ resources: region: ${vars.region} name: "{{ db_name }}" engine: "PostgreSQL:16.0" - database: "{{ db_database }}" - username: "{{ db_username }}" - password: "{{ db_password }}" + database: ${vars.db_database} + username: ${vars.db_username} + password: ${vars.db_password} vpcID: auto extensions: - name: vector @@ -39,9 +42,9 @@ resources: timeout: 3 environmentVariables: PG_HOST: ${resources.VectorDB.output.host} - PG_USER: ${resources.VectorDB.props.username} - PG_PASSWORD: ${resources.VectorDB.props.password} - PG_DATABASE: ${resources.VectorDB.props.database} + PG_USER: ${vars.db_username} + PG_PASSWORD: ${vars.db_password} + PG_DATABASE: ${vars.db_database} dimension: '768' #dimension 和 embedding_model 配置要一致 tableName: start_flow_rag_table code: code/pghelper diff --git a/src/variable.yaml b/src/variable.yaml new file mode 100644 index 0000000..1b5f2cb --- /dev/null +++ b/src/variable.yaml @@ -0,0 +1,16 @@ +shared: # 共享变量 + db_database: + title: 数据库名称 + type: string + default: "flow_rag_database_by_dipper" + description: Postgresql 数据库名称 + db_username: + title: 用户名称 + type: string + default: "cap" + description: Postgresql 数据库用户名 + db_password: + title: 密码 + sensitive: true + default: "AwesomeCAP_2024" + description: Postgresql 数据库密码 \ No newline at end of file diff --git a/variable.yaml b/variable.yaml deleted file mode 100644 index a95dac4..0000000 --- a/variable.yaml +++ /dev/null @@ -1,22 +0,0 @@ -services: #服务变量 - vectordb: - db_name: - title: 实例名称 - type: string - default: "flow_rag_postgresql_by_dipper" - description: Postgresql 实例名称 - db_database: - title: 数据库名称 - type: string - default: "flow_rag_database_by_dipper" - description: Postgresql 数据库名称 - db_username: - title: 用户名称 - type: string - default: "admin" - description: Postgresql 数据库用户名 - db_password: - title: 密码 - type: secret - default: "awesome_dipper" - description: Postgresql 数据库密码 \ No newline at end of file