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 19, 2024
1 parent 19c71ac commit a903dee
Show file tree
Hide file tree
Showing 5 changed files with 516 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .computenest/.computenest_parameters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ServiceType: private
ArtifactSourceType: DockerCompose
ServiceBuildRegion: ap-southeast-1
RepoName: aliyun-computenest/mongodb
DockerComposeEnvPath: .env.example
RegionId: cn-hangzhou
CustomParameters:
- NoEcho: false
Type: String
AllowedValues:
- root
- admin
- master
AllowedPattern: ''
Label: 用户名
ConstraintDescription: ''
Default: root
Name: MONGO_INITDB_ROOT_USERNAME
- NoEcho: false
Type: String
AllowedPattern: ''
Label: 密码
ConstraintDescription: ''
Default: pleaseChangeMe
Name: MONGO_INITDB_ROOT_PASSWORD
DockerComposeYamlPath: docker-compose.yaml
Owner: workhardliuzheng
Branch: main
Platform: github
21 changes: 21 additions & 0 deletions .computenest/README.md
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/)
113 changes: 113 additions & 0 deletions .computenest/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
Service:
RegionId: cn-hangzhou
DeployType: ros
OperationMetadata:
StatusOperationConfigs:
- TemplateName: 'ECS单机版'
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

ParameterConfigs:
- TemplateName: 'ECS单机版'
Parameters:

Default.MONGO_INITDB_ROOT_USERNAME:
Type: String
Default: root
Description: 用户名





AllowedValues:

- root
- admin
- master

Default.MONGO_INITDB_ROOT_PASSWORD:
Type: String
Default: pleaseChangeMe
Description: 密码






Metadata:
ParameterGroups:
- Parameters:
- MONGO_INITDB_ROOT_USERNAME
- MONGO_INITDB_ROOT_PASSWORD

DefaultValue: |-
MONGO_INITDB_ROOT_USERNAME=root
MONGO_INITDB_ROOT_PASSWORD=pleaseChangeMe
Formatter: env
Name: Default

DeployMetadata:
SupplierDeployMetadata:
SupplierTemplateConfigs:
- Name: 'ECS单机版'
Url: 'ros_templates/template.yaml'
AllowedRegions:
- ap-southeast-1
ArtifactRelation:
ecs_image_mongodb:
ArtifactId: ${Artifact.EcsImage.ArtifactId}
ArtifactVersion: draft
TemplateConfigs:
- Name: ECS单机版
Url: 'ros_templates/template.yaml'
AllowedRegions:
- ap-southeast-1
ServiceType: private
ServiceInfo:
Locale: zh-CN
ShortDescription: demo
Image: 'resources/icons/service_logo.png'
Artifact:
EcsImage:
ArtifactType: EcsImage
ArtifactName: ecs_image_mongodb
Description: mongodb EcsImage
SupportRegionIds:
- ap-southeast-1
ArtifactBuildProperty:
CodeRepo:
Platform: github
Owner: workhardliuzheng
RepoName: aliyun-computenest/mongodb
Branch: main
RegionId: ap-southeast-1
CommandType: RunShellScript
CommandContent: |-
mkdir -p /root/application
if [ -e "/root/code/.env.example" ]; then cp -r "/root/code/.env.example" "/root/application/"; fi
if [ -e "/root/code/docker-compose.yaml" ]; then cp -r "/root/code/docker-compose.yaml" "/root/application/"; fi
if [ -e "/root/code/mongodata" ]; then cp -r "/root/code/mongodata" "/root/application/"; fi
cd /root/application
cp .env.example ./.env
sed -i 's/pull_policy: always/pull_policy: if_not_present/g' docker-compose.yaml
docker compose -f docker-compose.yaml build
docker compose -f docker-compose.yaml pull || true;
Binary file added .computenest/resources/icons/service_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a903dee

Please sign in to comment.