Skip to content

Commit

Permalink
Init computenest project.
Browse files Browse the repository at this point in the history
      on-behalf-of: @org [email protected]
  • Loading branch information
aliyun-computenest committed Dec 16, 2024
1 parent f31b041 commit fdd17aa
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 65 deletions.
13 changes: 1 addition & 12 deletions .computenest/.computenest_parameters.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
ServiceType: private
AllowedRegions:
- ap-southeast-1
ArtifactSourceType: DockerCompose
RepoName: aliyun-computenest/quickstart-authorizer
DockerComposeEnvPath: .env.test
RegionId: cn-hangzhou
CustomParameters: ''
DockerComposeYamlPath: docker-compose.yaml
Owner: LYH-RAIN
Branch: main
Platform: github
{"ServiceType":"private","AllowedRegions":["cn-hangzhou","cn-shanghai","cn-beijing"],"ArtifactSourceType":"DockerCompose","RepoName":"aliyun-computenest/quickstart-authorizer","Arch":"EcsSingle","DockerComposeEnvPath":".env.test","RegionId":"cn-hangzhou","CustomParameters":"","DockerComposeYamlPath":"docker-compose.yaml"}
66 changes: 17 additions & 49 deletions .computenest/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,67 +3,35 @@ Service:
DeployType: ros
OperationMetadata:
StatusOperationConfigs:
- TemplateName: 'ECS单机版'
- TemplateName: '单机版'
SupportOperations:
- Start
- Stop
- Restart
SupportBackup: true
ModifyParametersConfig:
- TemplateName: ECS单机版
Operation:
- Name: 变更ECS实例规格
Description: 变更ECS实例规格
Type: Custom
Parameters:
- EcsInstanceType
- Name: 变更ECS实例密码
Description: 变更ECS实例密码
Type: Custom
Parameters:
- InstancePassword

DeployMetadata:
SupplierDeployMetadata:
SupplierTemplateConfigs:
- Name: 'ECS单机版'
Url: 'ros_templates/template.yaml'
AllowedRegions:
- ap-southeast-1
ArtifactRelation:
ecs_image_quickstart-authorizer:
ArtifactId: ${Artifact.EcsImage.ArtifactId}
ArtifactVersion: draft
FileArtifactRelation:
'{{ computenest::file::aliyun-computenest_quickstart-authorizer-docker-compose }}':
ArtifactId: ${Artifact.Artifact_1.ArtifactId}
ArtifactVersion: ${Artifact.Artifact_1.ArtifactVersion}
TemplateConfigs:
- Name: ECS单机版
- Name: 单机版
Url: 'ros_templates/template.yaml'
# 未选择部署地域则采用 []
AllowedRegions:
- ap-southeast-1
- cn-hangzhou
- cn-shanghai
- cn-beijing
ServiceType: private
ServiceInfo:
Locale: zh-CN
ShortDescription: demo
ShortDescription: docker compose deploy
Image: 'resources/icons/service_logo.png'
Artifact:
EcsImage:
ArtifactType: EcsImage
ArtifactName: ecs_image_quickstart-authorizer
Description: quickstart-authorizer EcsImage
SupportRegionIds:
- ap-southeast-1
ArtifactBuildProperty:
CodeRepo:
Platform: github
Owner: LYH-RAIN
RepoName: aliyun-computenest/quickstart-authorizer
Branch: main
RegionId: ap-southeast-1
CommandType: RunShellScript
CommandContent: |-
mkdir -p /root/application
if [ -e "/root/code/." ]; then cp -r "/root/code/." "/root/application/"; fi
cd /root/application
cp .env.test ./.env
docker compose -f docker-compose.yaml build
docker compose -f docker-compose.yaml pull || true;
Artifact_1:
ArtifactType: File
ArtifactName: aliyun-computenest_quickstart-authorizer-docker-compose
ArtifactProperty:
RegionId: cn-hangzhou
Url: 'resources/artifact_resources/docker_compose.tar'
AcrImageBuilder:
Binary file not shown.
9 changes: 5 additions & 4 deletions .computenest/ros_templates/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Resources:
Ref: ZoneId
SecurityGroupId:
Ref: SecurityGroup
ImageId: ecs_image_quickstart-authorizer
ImageId: "{{resolve:oos:aliyun/services/computenest/images/aliyun_3_2104_docker_compose_2_27_compute_nest}}"
Password:
Ref: InstancePassword
InstanceType:
Expand All @@ -267,7 +267,6 @@ Resources:
InternetMaxBandwidthOut: 5
IoOptimized: optimized
MaxAmount: 1

RunInstallCommand:
Type: ALIYUN::ECS::RunCommand
Properties:
Expand All @@ -281,6 +280,9 @@ Resources:
CommandContent:
Fn::Sub:
- |
wget '{{ computenest::file::aliyun-computenest_quickstart-authorizer-docker-compose }}' -O /root/application/docker_compose.tar
tar -xvf /root/application/docker_compose.tar -C /root/application
cat > /etc/systemd/system/quickstart-authorizer.service <<EOF
[Unit]
Description=Docker Compose Application Service
Expand All @@ -290,7 +292,7 @@ Resources:
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/root/application
WorkingDirectory=/root/application/docker_compose
ExecStart=/usr/bin/docker compose -f docker-compose.yaml up -d
ExecStop=/usr/bin/docker compose down
TimeoutStartSec=0
Expand All @@ -302,7 +304,6 @@ Resources:
systemctl enable quickstart-authorizer
sed -i 's/pull_policy: always/pull_policy: if_not_present/g' /root/application/docker-compose.yaml
systemctl start quickstart-authorizer
- RegionId:
Ref: ALIYUN::Region
Expand Down

0 comments on commit fdd17aa

Please sign in to comment.