-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dify template: Build the large language model (LLM) application d…
…evelopment platform Dify on the ECS instance (CentOS 7).
- Loading branch information
Showing
3 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
ROSTemplateFormatVersion: '2015-09-01' | ||
Description: | ||
en: Build the large language model (LLM) application development platform Dify on | ||
the ECS instance (CentOS 7). | ||
zh-cn: 在ECS实例(CentOS 7)上搭建大语言模型(LLM) 应用开发平台Dify。 | ||
Parameters: | ||
ZoneId: | ||
Type: String | ||
Label: | ||
en: Availability Zone | ||
zh-cn: 可用区ID | ||
AssociationProperty: ALIYUN::ECS::Instance:ZoneId | ||
InstanceType: | ||
Type: String | ||
Label: | ||
en: Instance Type | ||
zh-cn: 实例类型 | ||
AssociationProperty: ALIYUN::ECS::Instance::InstanceType | ||
AssociationPropertyMetadata: | ||
ZoneId: ${ZoneId} | ||
DefaultValueStrategy: recent | ||
SystemDiskCategory: | ||
Type: String | ||
Label: | ||
en: System Disk Type | ||
zh-cn: 系统盘类型 | ||
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory | ||
AssociationPropertyMetadata: | ||
LocaleKey: DiskCategory | ||
ZoneId: ${ZoneId} | ||
InstanceType: ${InstanceType} | ||
AutoSelectFirst: true | ||
AutoChangeType: false | ||
Default: cloud_essd | ||
InstancePassword: | ||
Type: String | ||
Label: | ||
en: Instance Password | ||
zh-cn: 实例密码 | ||
Description: | ||
en: Server login password, Length 8-30, must contain three(Capital letters, | ||
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol | ||
in). | ||
zh-cn: 服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。 | ||
ConstraintDescription: | ||
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers, | ||
()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in). | ||
zh-cn: 长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。 | ||
AssociationPropertyMetadata: | ||
Visible: | ||
Condition: | ||
Fn::Equals: | ||
- ${SelectInstance} | ||
- false | ||
Default: | ||
AllowedPattern: '[0-9A-Za-z\_\-\&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$' | ||
MinLength: 8 | ||
MaxLength: 30 | ||
NoEcho: true | ||
Resources: | ||
Vpc: | ||
Type: ALIYUN::ECS::VPC | ||
Properties: | ||
CidrBlock: 192.168.0.0/16 | ||
VSwitch: | ||
Type: ALIYUN::ECS::VSwitch | ||
Properties: | ||
ZoneId: | ||
Ref: ZoneId | ||
VpcId: | ||
Ref: Vpc | ||
CidrBlock: 192.168.0.0/24 | ||
SecurityGroup: | ||
Type: ALIYUN::ECS::SecurityGroup | ||
Properties: | ||
VpcId: | ||
Ref: Vpc | ||
SecurityGroupIngress_80: | ||
Type: ALIYUN::ECS::SecurityGroupIngress | ||
Properties: | ||
SecurityGroupId: | ||
Ref: SecurityGroup | ||
SourceCidrIp: 0.0.0.0/0 | ||
IpProtocol: tcp | ||
NicType: intranet | ||
PortRange: 80/80 | ||
InstanceGroup: | ||
Type: ALIYUN::ECS::InstanceGroup | ||
Properties: | ||
VpcId: | ||
Ref: Vpc | ||
VSwitchId: | ||
Ref: VSwitch | ||
SecurityGroupId: | ||
Ref: SecurityGroup | ||
ImageId: centos_7_9 | ||
InstanceName: dify | ||
InstanceType: | ||
Ref: InstanceType | ||
SystemDiskCategory: | ||
Ref: SystemDiskCategory | ||
Password: | ||
Ref: InstancePassword | ||
IoOptimized: optimized | ||
MaxAmount: 1 | ||
DS_Instances: | ||
Type: DATASOURCE::ECS::Instances | ||
Properties: | ||
InstanceIds: | ||
Fn::GetAtt: | ||
- InstanceGroup | ||
- InstanceIds | ||
InstallDify: | ||
Type: ALIYUN::ECS::RunCommand | ||
Properties: | ||
InstanceIds: | ||
Fn::GetAtt: | ||
- InstanceGroup | ||
- InstanceIds | ||
Type: RunShellScript | ||
Sync: true | ||
Timeout: 1800 | ||
CommandContent: | | ||
#!/bin/bash | ||
echo "#########################" | ||
echo "# Install Docker" | ||
echo "#########################" | ||
wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo | ||
yum -y install docker-ce | ||
systemctl start docker | ||
systemctl enable docker | ||
echo "#########################" | ||
echo "# Install Dify" | ||
echo "#########################" | ||
yum -y install git | ||
git clone --depth 1 https://github.com/langgenius/dify.git /opt/dify | ||
cd /opt/dify/docker | ||
docker compose up -d | ||
docker compose ps | ||
Outputs: | ||
DifyUrl: | ||
Description: Dify default address. | ||
Value: | ||
Fn::Sub: | ||
- http://${IP} | ||
- IP: | ||
Fn::Jq: | ||
- First | ||
- if .[0].PublicIpAddress != [] then .[0].PublicIpAddress[0] else .[0].EipAddress.IpAddress | ||
end | ||
- Fn::GetAtt: | ||
- DS_Instances | ||
- Instances |