Resource Orchestration Service (ROS) deployment

Updated at:

Use Resource Orchestration Service (ROS) and Flow to achieve continuous delivery and automated builds. This process lets you update your Alibaba Cloud infrastructure quickly and reliably.

Background

For example, you can create a pipeline that automatically builds a test stack when you commit an updated template to a code repository. After ROS builds the test stack, you can test it and then decide whether to push the changes to your production stack.

Note

Alibaba Cloud Resource Orchestration Service (ROS) is an easy-to-use service that automates the deployment of cloud resources. You can use JSON/YAML templates to describe and deploy multiple cloud resources, a practice known as Infrastructure as Code (IaC).

Example: Pipeline for test and production stacks

To establish a release process, you can commit a ROS template, and ROS automatically builds a test stack from it. After you review the test stack, you can preview how your changes will affect the production stack and then decide whether to implement them. To complete this workflow, you can use ROS to build a test stack, create a change set, and then execute the change set. However, each action requires manual interaction with ROS. This example builds a pipeline to automate these actions and help you implement a continuous delivery workflow for your ROS stacks.

Example overview

You will build a pipeline for a sample WordPress site in a stack. This pipeline has three stages. Each stage must contain at least one action, which is a task that the pipeline performs on your artifact (your input). Stages organize the actions in your pipeline. A pipeline must complete all actions in a stage before that stage can process a new artifact, such as when you commit a new input to rerun the pipeline.

In this example, you will build a pipeline that performs the following workflow.

Stage 1

Retrieves the source artifact (the ROS template and its configuration file) from a repository.

You will prepare an artifact that contains a sample WordPress template and upload it to a code repository.

First, get the sample template "Create a WordPress Environment Based on ECS and RDS" from ROS, and then upload the artifact to a code repository.

In the navigation pane on the left of the ROS console, choose Templates > Public Templates, switch to the Getting Started Templates tab, and enter wordpress in the search bar to find the template.

Stage 2

The pipeline creates a test stack and then waits for approval.

  1. In the Flow console, click Create Pipeline in the upper-right corner and select an empty template. In the Select a Pipeline Template dialog box, select the Visual Orchestration tab. In the category list on the left, select Empty Template. On the right, select the Empty Template card and click Create.

  2. Add a code source. On the process configuration page, click + Add Pipeline Source in the Pipeline Source stage. In the Add Pipeline Source pane that appears on the right, set Code Source Type to Codeup, configure the Service Connection and Code Repository, set the Default Branch to master, and then click Add.

  3. Add a pipeline step (for the Default Environment only).

    In the task step area, click Add Step and select a step type from the drop-down menu. For example, under the Publish category, you can select deployment methods such as Kubectl deployment, Helm release, Kubectl image update, ROS deployment, or Alibaba Cloud Function Compute deployment.

  4. Edit the ROS deployment step, and then click Save Only in the upper-right corner.

    Set ROS Role to TestTeamRole, Stack Name to WordPressTest, Stack File Path to Test/WordPress.yml, and Timeout to 10. Then, select the Ignore errors when the environment remains unchanged checkbox.

  5. In the stage configuration area, click + to add a stage. After creating the new task, select the Manual Review tool from the step categories.

  6. Edit the manual review step.

    In the edit pane on the right, set Task Name to Code Review and Validator Type to User. Then, specify the users in the Validators field.

  7. Click Save and Run and wait for approval.

    After the pipeline runs, the WordPressTest task in Stage 2 completes successfully. The pipeline then proceeds to the Code Review stage, and its status changes to Pending. The approver can click Approve or Reject to complete the review.

After you review the test stack, you can either continue with the current pipeline or commit another artifact to make changes.

If you approve the changes, the pipeline continues to the next stage.

If you reject the changes, you can return to the first stage, modify the template or configuration file, and run the pipeline again for another review.

Stage 3

The pipeline creates a change set for the production stack and then waits for approval.

Scenario 1: If no production stack exists, the change set shows all the resources that ROS will create. If you approve, the stage executes the change set and builds your production stack.

Scenario 2: If a production stack already exists, the change set shows the resources that ROS will update. If you approve, the stage executes the change set and updates your production stack.

Important

You can find the required template "Create a WordPress Environment Based on ECS and RDS" in the template examples in the ROS console.