generated from aliyun-computenest/quickstart-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from KunSir991/main
update config
- Loading branch information
Showing
9 changed files
with
1,177 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 代码仓库结构 | ||
|
||
## 文档目录说明: | ||
``` | ||
. | ||
├── README.md - README | ||
├── docs - 服务文档相关文件 | ||
│ └── index.md | ||
├── resources - 服务资源文件 | ||
│ ├── icons | ||
│ │ └── service_logo.png - 服务logo | ||
│ └── artifact_resources - 部署物相关资源文件 | ||
├── ros_templates - 服务ROS模板目录,支持多模板 | ||
│ └── template.yaml - ROS模板,ROS模板引擎根据该模板会自动创建出所有的资源 | ||
├── config.yaml - 服务配置文件,服务构建过程中会使用计算巢命令行工具computenest-cli,computenest-cli会基于该配置文件构建服务 | ||
├── preset_parameters.yaml - (该文件只有托管版有)服务商预设参数,如VpcId,VSwitchId等,该ros模板内容会渲染为表单方便服务商填写 | ||
``` | ||
|
||
## 其他 | ||
关于ROS模板,请参见 [资源编排](https://help.aliyun.com/zh/ros)。 | ||
关于computenest-cli请参见 [computenest-cli](https://pypi.org/project/computenest-cli/)。 |
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,71 @@ | ||
Service: | ||
RegionId: cn-hangzhou | ||
DeployType: ros | ||
DeployMetadata: | ||
ServiceInstanceNameRule: | ||
Prefix: minecraft- | ||
SupplierDeployMetadata: | ||
ArtifactRelation: | ||
'centos_7': | ||
ArtifactId: ${Artifact.EcsImage.ArtifactId} | ||
ArtifactVersion: ${Artifact.EcsImage.ArtifactVersion} | ||
TemplateConfigs: | ||
- Name: 快速部署 | ||
Url: 'ros_templates/minecraft.yaml' | ||
- Name: 迁移到计算巢 | ||
Url: 'ros_templates/minecraft-ecs.yaml' | ||
ServiceType: private | ||
ServiceInfo: | ||
Locale: zh-CN | ||
ShortDescription: docker deploy | ||
Image: 'resources/icons/service_logo.png' | ||
Artifact: | ||
EcsImage: | ||
ArtifactType: EcsImage | ||
ArtifactName: minecraft | ||
Description: Minecraft deploy | ||
ArtifactProperty: | ||
RegionId: ${ImageBuilder.EcsImage.RegionId} | ||
ImageId: ${ImageBuilder.EcsImage.SourceImageId} | ||
ImageBuilder: | ||
EcsImage: | ||
RegionId: ap-southeast-1 | ||
SourceImageId: ubuntu_24_04_x64_20G_alibase_20241115.vhd | ||
SystemDiskSize: 40 | ||
InstanceType: ecs.c6.large | ||
InternetMaxBandwidthOut: 10 | ||
CommandType: RunShellScript | ||
Timeout: 10800 | ||
CommandContent: |- | ||
#!/bin/bash | ||
mkdir -p /opt/minecraft/{jars,instances} | ||
wget -O /opt/minecraft/jars/server.jar https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar | ||
mkdir -p /opt/minecraft/instances/survival | ||
sudo apt update | ||
sudo apt install openjdk-21-jdk -y | ||
cat >/lib/systemd/system/minecraft.service << EOF | ||
[Unit] | ||
Description=Minecraft Server | ||
Wants=network.target | ||
After=network.target | ||
[Service] | ||
Type=simple | ||
WorkingDirectory=/opt/minecraft/instances/survival | ||
ExecStart=/usr/bin/java -Xms2G -jar /opt/minecraft/jars/server.jar nogui | ||
RestartSec=30 | ||
Restart=on-failure | ||
KillMode=process | ||
KillSignal=SIGINT | ||
SuccessExitStatus=130 | ||
StandardInput=null | ||
[Install] | ||
WantedBy=default.target | ||
EOF | ||
echo "eula=true" > /opt/minecraft/instances/survival/eula.txt | ||
systemctl enable minecraft.service | ||
systemctl start minecraft.service |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,70 @@ | ||
# 服务模板说明文档 | ||
|
||
## 服务说明 | ||
|
||
**简单描述服务的功能和用途。** | ||
例如: | ||
_(服务功能描述,如“WordPress 是一款免费开源的 CMS,适用于创建和管理各种类型的网站。”)_ | ||
|
||
_(服务快速上手链接或文档,如果有的话)_ | ||
|
||
## 服务架构 | ||
|
||
此服务模板构建出的服务的部署架构为单机ecs部署。 | ||
|
||
<img src="architecture_ecs_single.png" width="600" height="400" align="bottom"/> | ||
|
||
## 计费说明 | ||
通过此服务模板构建服务不产生费用。 | ||
用户部署构建出的服务时,资源费用主要涉及: | ||
- 所选ECS实例规格 | ||
- 磁盘容量 | ||
- 公网带宽 | ||
|
||
计费方式包括: | ||
- 按量付费(小时) | ||
- 包年包月 | ||
|
||
预估费用在部署前可实时看到。 | ||
|
||
## RAM账号所需权限 | ||
|
||
此服务模板构建出的服务需要对ECS、VPC等资源进行访问和创建操作,若使用RAM用户创建服务实例,需要在创建服务实例前,对使用的RAM用户的账号添加相应资源的权限。添加RAM权限的详细操作,请参见[为RAM用户授权](https://help.aliyun.com/document_detail/121945.html)。所需权限如下表所示: | ||
|
||
| 权限策略名称 | 备注 | | ||
|-------------------------------------|-------------------------------| | ||
| AliyunECSFullAccess | 管理云服务器服务(ECS)的权限 | | ||
| AliyunVPCFullAccess | 管理专有网络(VPC)的权限 | | ||
| AliyunROSFullAccess | 管理资源编排服务(ROS)的权限 | | ||
| AliyunComputeNestUserFullAccess | 管理计算巢服务(ComputeNest)的用户侧权限 | | ||
| AliyunComputeNestSupplierFullAccess | 管理计算巢服务(ComputeNest)的服务商侧权限 | | | ||
|
||
## 服务实例计费说明 | ||
|
||
**详细说明服务实例的计费方式。** | ||
_(描述费用构成,例如所选 vCPU 和内存规格,系统盘类型和容量等)_ | ||
|
||
_(列出计费方式,例如按量付费或包年包月)_ | ||
|
||
## 服务实例部署流程 | ||
|
||
### 部署参数说明 | ||
|
||
| 参数组 | 参数项 | 说明 | | ||
|---------------------------------|--------|-------------------------------------------------------------------------| | ||
| 服务实例 | 服务实例名称 | 长度不超过64个字符,必须以英文字母开头,可包含数字、英文字母、短划线(-)和下划线(_)。 | | ||
| | 地域 | 服务实例部署的地域。 | | ||
| | 付费类型 | 资源的计费类型:按量付费和包年包月。 | | ||
| ECS实例配置 | 实例类型 | ECS实例规格配置。 | | ||
| | 实例密码 | 长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*-+=|{}[]:;'<>,.?/ 中的特殊符号)。 | | ||
| 网络配置 | 可用区 | ECS实例所在可用区。 | | ||
|
||
### 部署步骤 | ||
|
||
**简述如何一步步部署服务实例。** | ||
|
||
1. _(步骤1描述和相关链接或图片,如果有的话)_ | ||
2. _(步骤2描述和相关链接或图片,如果有的话)_ | ||
... | ||
|
||
[部署链接](部署链接地址) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.