By Jongjin Lim, Solution Architect at Alibaba Cloud
As a business expands, the diversity and complexity of its IT environment also increases. Even within the same company and the same team, different platforms, tools, and cloud environments are being used depending on the nature of the work.
Despite this, many companies still maintain legacy development environment and processes, which are not well equipped to deal with such issues. As a consequence, companies oftentimes are not able to effectively utilize innovative platforms even if the company invested heavily in such technology.
DevOps is a process innovation that was created to solve these problems. Among the three core elements of DevOps (People, Process, and Technology), the realization of technology, that is, CI/CD, has become essential.
In this article today, we will take a look at Flow, an innovative DevOps platform of Alibaba Cloud.
Alibaba Cloud DevOps Flow (hereafter Flow) is a DevOps SaaS platform provided by Alibaba Cloud. It is an enterprise-level automated R&D and delivery pipeline platform, providing business with flexible and easy-to-use features of continuous integration, continuous verification, and continuous deployment. Open source projects that provide similar services include Jenkins, Bamboo, and ArgoCD.
Most of the traditional CI/CD tools use a specific script language and are difficult to configure. But with Flow, essentially all CI/CD Steps are provided in a GUI as shown in the capture below. You can easily access and use them without knowing a specific script language or specific usage.
Defines the Source Code Repository for starting the Pipeline. By default, GitHub and General Git are available.
GitHub can handle the credential for the repository by linking the user's account, but in General Git, you need to set the key, etc. in the options.
Task defines the actions required in each CI/CD Step provided by Alibaba Cloud.
Alibaba Cloud pre-defines and provides various CI/CD tasks, and representative tasks will be explained below.
3.3.2.1 Java Code Scan
Code scanning for Java Source. Using the script provided by Alibaba Cloud, the high-risk code in each code is analyzed and a report is provided.
After the pipeline runs, you can refer to the Code Scanning report. You can find out in detail which source code is the issue.
3.3.2.2 Maven Unit Test
Set options for unit test using Maven
3.3.2.3 Java Build
It is a task that builds Java source code, and Maven build is used in the default setting. If you use Java Build provided by Flow, you can easily build without using a separate build server when developing and deploying.
3.3.2.4 Java Image Build
It is mainly used for container deployment. Usually, when deploying a container in a local environment, the developer pulls the Base Image from the registry and then performs Java build. After that, the built library and Base Image are merged to create an image to be operated.
If Java Image Build is used, users can easily create source code into container images without performing a separate build server or Docker build.
Java Build included in Configuration is the same as above.
First, define options for ACR build, which is Alibaba Cloud's Container Registry service for Docker build.
3.3.2.5 ECS Deployment
It defines the ECS to be used when deploying. Depending on the configuration, it can be deployed to multiple ECSs.
3.3.2.6 Kubectl Apply
If you use Kubernetes for deployment, you can apply the Kubectl Apply task. You can also use a single container for deployment, but you can use Blue/Green or Canary deployments depending on your requirements.
3.3.2.7 Manual Approval
It is used when an approval procedure for a specific task is required during distribution. Basically, approval can be processed in the account registered in FLOW.
In addition, tasks such as Blue-green deployment, Node.js build / test, Execute command, and custom image repository build can be used.
FLOW's console provides a variety of additional functions for managing your pipeline.
3.3.3.1 WebHook Trigger
Users can tightly connect GIT repository and CI by using WebHook Trigger. You can use the API displayed in the menu easily by adding it to the GIT webhook.
3.3.3.2 Scheduled Trigger
A feature that automates the execution of pipelines, primarily for periodic tasks such as PMs.
3.3.3.3 Variable
Defines an Object to be used as a variable in the pipeline environment.
3.3.3.4 Cache
Caching is used to speed up pipeline deployment.
You can create a workspace with your Alibaba Cloud International account by accessing the Alibaba Cloud DevOps FLOW. Using this, you can easily configure the pipeline environment.
From item 5, you can check the guide for creating a pipeline that deploys ECS Single Instance using the source code stored in GitHub, assuming that there is a customer with the specific conditions below.
The example environment has the following background.
The technical requirements for implementing the example environment are as follows.
In this example, the pipeline will consist of four stages.
You can check how to configure in the order of GitHub Repository Connection > Java Code Scan / Maven Unit Test > Java Build & Archive > ECS deployment.
Example source code can be forked at https://github.com/Jason-Jongjin-Lim/FLOWtest
If you connect to the FLOW Console and create a workspace, you can see the following screen. Here we choose Create Pipeline to configure the pipeline.
If you select Create Template, you can check the list of predefined templates. We will set it up using the first Template here.
In this guide, we will use GitHub as the Pipeline Source. First, you can associate a GitHub account with FLOW and follow the guide below to set it up.
If the Enable Code Source Trigger option is turned on, the pipeline can be started automatically using the webhook function provided by the Git process. After setting this option, the developer executes the pipeline only with Commit/Push operation.
Set up a scanning policy to check for potential issues in the sample Java code.
In this example, the default option is used. If there is a specially used JDK or Maven version, you can specify it.
Specify options for Maven Unit Test. As an example used in this scenario, the reporting function using surefire can be used.
In this example, the default option is used.
Specify each option for Java build.
Specifies the options to use when deploying with ECS.
Deploy.sh
.mkdir -p /home/admin/application/
tar zxvf /home/admin/app/package.tgz -C /home/admin/application/
sh /home/admin/application/deploy.sh restart
When the pipeline creation is completed, execute Save and Run at the upper right of the FLOW Console.
After running the pipeline, you can check various information about the pipeline progress in the Dashboard of the FLOW Console.
As the pipeline progresses, problems occur at various stages. If you check the detail page of the step where the problem occurred, you can troubleshoot such as detailed information, log, retry, and skip.
You can also check the status of previously executed pipelines in Running History.
In this blog, we have talked about Alibaba Cloud DevOps Flow, introducing its features and capabilities.
At the time of writing, Flow supports less plug-ins compared to Jenkins and Bamboo, both of which are currently widely used pipeline tools. Because of this, Flow may be a little light for corporate users who have complex DevOps environments.
However, it is suitable among Alibaba Cloud customers who operate simple services based on Java or Node.js. With Flow, customers can automate build, test, approval, and deployment to instances and containers with only Commit/Push after source code development, so it is a more suitable solution than heavy Pipeline tools.
Alibaba Cloud VPC와 AWS VPC를 VPN으로 연결하기 (IPsec VPN Connection / Site-to-site VPN Connection)
Alibaba Cloud DevOps Flow를 이용하여 Alibaba Cloud에 최적화된 DevOps(CI/CD) 환경 구현하기
Alibaba Clouder - February 9, 2021
Alibaba Clouder - October 28, 2020
Alibaba Clouder - February 9, 2021
JJ Lim - September 23, 2021
Alibaba Clouder - September 9, 2020
Alibaba Clouder - March 1, 2021
An enterprise-level continuous delivery tool.
Learn MoreAccelerate software development and delivery by integrating DevOps with the cloud
Learn MoreData Integration is an all-in-one data synchronization platform. The platform supports online real-time and offline data exchange between all data sources, networks, and locations.
Learn MoreHighly reliable and secure deployment solutions for enterprises to fully experience the unique benefits of the hybrid cloud
Learn MoreMore Posts by JJ Lim