O Alibaba Cloud Compute Nest é uma plataforma completa que simplifica a implantação de software na nuvem. Configure seu repositório Git para atender às especificações de serviço do Compute Nest e implante seu software na nuvem automaticamente. O Compute Nest oferece modelos oficiais para diferentes arquiteturas e tipos de implantação. Copie e personalize esses modelos no repositório oficial do Compute Nest. Em seguida, use o console do Compute Nest para criar e publicar serviços e implantar seu software na nuvem. Este tópico descreve como criar um repositório Git em conformidade com as especificações do Compute Nest.
Configure um repositório Git
Desenvolvedores de software frequentemente mantêm seus próprios repositórios em plataformas como GitHub, GitLab ou Gitee. Normalmente, a implantação de software exige a configuração manual de servidores e a preparação do ambiente. O Alibaba Cloud Compute Nest oferece uma plataforma completa para implantação de software na nuvem. Ao configurar seu repositório para atender às especificações de serviço do Compute Nest, você implanta seu software na nuvem automaticamente como uma aplicação baseada em nuvem. Caso não possua um repositório, copie um modelo do repositório oficial do Compute Nest para sua conta.
Repositórios oficiais recomendados
Até 28 de fevereiro de 2024, o Compute Nest disponibiliza 8 modelos de serviço privado e 5 modelos de serviço totalmente gerenciado. Esses modelos abrangem diversos cenários arquiteturais.
Tipo de serviço | Nome do modelo | Arquitetura | Tipo de implantação | Endereço do GitHub |
Serviço privado | Pacote Spring Boot para ECS Basic Edition | ECS único | Pacote (implantação de arquivo) | https://github.com/aliyun-computenest/springboot-ecs-package-demo.git |
Imagem Spring Boot para ECS Basic Edition | ECS único | Implantação de imagem ECS | https://github.com/aliyun-computenest/springboot-ecs-image-demo.git | |
kodbox para Function Compute | Serviço FC | Nenhum | ||
WordPress | Basic Edition: ECS + RDS High-availability Edition: Múltiplas instâncias ECS + RDS + SLB + EIP | Pacote (implantação de arquivo) | https://github.com/aliyun-computenest/wordpress-ecs-demo.git | |
Pacote Spring Boot para ECS com Auto Scaling | ECS + SLB + EIP + ESS | Pacote (implantação de arquivo) | https://github.com/aliyun-computenest/springboot-scaling-ecs-demo.git | |
Spring Boot para contêiner ACK | ACK + SLB + EIP | Imagem de contêiner | https://github.com/aliyun-computenest/springboot-ack-docker-demo.git | |
Spring Boot para contêiner ECS | ECS único | Imagem de contêiner | https://github.com/aliyun-computenest/springboot-ecs-docker-demo.git | |
Spring Boot para ACK Helm | ACK + SLB + EIP | Imagem de contêiner, implantação via Helm Chart | https://github.com/aliyun-computenest/springboot-ack-helm-demo.git | |
Serviço totalmente gerenciado single-tenant | Spring Boot managed edition single-tenant | ECS + RDS + EIP | Pacote (implantação de arquivo) | https://github.com/aliyun-computenest/springboot-managed-demo.git |
Arquitetura ECS + SLB para MySQL (suporta PrivateLink) | ECS + SLB | Pacote (implantação de arquivo) | https://github.com/aliyun-computenest/mysql-managed-demo.git | |
WordPress managed edition single-tenant para ECS | ECS + MySQL local + EIP | Pacote (implantação de arquivo) | https://github.com/aliyun-computenest/wordpress-managed-demo.git | |
WordPress managed edition multi-tenant para ACK | ACK + MySQL local | Sem artefato de implantação. Os Pods são implantados via YAML. | https://github.com/aliyun-computenest/wordpress-managed-ack-demo.git | |
MariaDB managed edition multi-tenant para ACK | ACK + MariaDB local | Sem artefato de implantação. Os Pods são implantados via YAML. | https://github.com/aliyun-computenest/mariadb-managed-ack-demo.git |
Descrição de diretórios e arquivos do repositório
Esta seção usa o repositório WordPress managed edition single-tenant para ECS como exemplo para descrever os diretórios e arquivos presentes. Analise a função de cada arquivo para garantir a incorporação correta do seu software.
wordpress-managed-demo
├── README.md - README
├── docs - Service documentation files
│ └── index.md
├── resources - Service resource files
│ ├── icons
│ │ └── service_logo.png - Default service icon
│ └── artifact_resources - Resource files for artifacts
│ └── file - Directory for file artifacts
│ ├── epel-release-latest-7.noarch.rpm - EPEL installation package
│ ├── remi-release-7.rpm - Remi installation package
│ └── wordpress-6.2-zh_CN.tar.gz - WordPress file artifact
├── ros_templates - Service ROS templates. Multiple templates can be included.
│ └── cluster.yaml - ROS template for Cluster Edition
│ └── template.yaml - ROS template for Basic Edition
├── config.yaml - Service configuration file. The Compute Nest command-line tool (computenest-cli) uses this file to build the service.
├── preset_parameters.yaml - Preset parameters for service providers, such as VpcId and VSwitchId. The content of the ROS template is rendered as a form for the provider to fill in.
Configure o arquivo config.yaml
Este é o arquivo de configuração principal que o computenest-cli usa para compilar o serviço. Nele, especifique as configurações do serviço. O computenest-cli chama a Compute Nest OpenAPI correspondente e transmite os parâmetros definidos. Durante a criação do serviço, as APIs criam o serviço Compute Nest, geram artefatos de implantação e criam uma imagem ECS, caso você use implantação baseada em imagem.
Service:
RegionId: cn-hangzhou # The region where the service is deployed.
DeployType: ros # The deployment type. This uses Resource Orchestration Service (ROS).
TenantType: SingleTenant # The tenant type. This is a single-tenant service.
DeployMetadata: # The deployment metadata configuration.
ServiceInstanceNameRule:
Prefix: wp # The prefix for the service instance name.
SupplierDeployMetadata: # The supplier deployment metadata.
RoleName: ${RoleName} # The name of the role to use.
UserType: Aliyun # The user type. This is an Alibaba Cloud user.
SupplierTemplateConfigs: # An array of supplier template configurations.
- Name: High-availability Edition # The template name.
Url: 'templates/template.yaml' # The URL of the template file.
PredefinedParameters: [] # A list of predefined parameters.
HiddenParameterKeys: # A list of hidden parameter keys.
- VpcId
- VSwitchId
- ZoneId
ParameterMappings: # The parameter mapping configuration.
- ParameterKey: RegionId
ParameterMappingKeys: # The parameter mapping keys.
- VpcId
- ZoneId
- VSwitchId
ParameterValueMapping: # The parameter value mapping configuration. This specifies parameter values for a region.
cn-hangzhou:
Parameters:
VpcId: ${VpcId}
ZoneId: ${ZoneId}
VSwitchId: ${VSwitchId}
FileArtifactRelation: # The file deployment artifact association configuration.
'{{ computenest::file::wordpress }}': # The identifier for the file deployment artifact association. You can use this identifier in templates/template.yaml to specify the deployment artifact.
ArtifactId: ${Artifact.Artifact_1.ArtifactId} # The ID of the file deployment artifact.
ArtifactVersion: ${Artifact.Artifact_1.ArtifactVersion} # The version of the file deployment artifact.
TemplateConfigs: # An array of template configurations.
- Name: High-availability Edition
Url: templates/parameters.yaml # The URL of the parameter template file.
AllowedRegions: # A list of allowed regions.
- cn-hangzhou
ServiceType: managed # The service type. This is a managed service.
ServiceInfo: # The service information configuration.
Locale: en-US # The localization configuration. This is for English (US).
ShortDescription: WordPress demo # A short description.
Image: 'icons/service_logo.jpg' # The service icon.
Name: WordPress Managed Edition # The service name.
ShareType: Public # The share type. This is a public service.
ApprovalType: Manual # The approval type. This requires manual approval.
Artifact: # The deployment artifact configuration. After configuration, the corresponding Compute Nest deployment artifact is built.
Artifact_1:
ArtifactType: File # The deployment artifact type. This is a file.
ArtifactName: WordPress # The name of the deployment artifact.
Description: WordPress # The description.
ArtifactProperty: # The deployment artifact property configuration.
RegionId: cn-hangzhou # The region where the deployment artifact is located.
Url: 'artifacts/wordpress-6.2-en_US.tar.gz' # The URL of the deployment artifact file.
Publique o serviço
Após configurar o repositório, faça login no console do Compute Nest e crie um serviço diretamente a partir do repositório para implantar seu software na nuvem.