What is Cruise? What is the way it works? --cruise 101 (1)

Source: Internet
Author: User

what Cruise is. Why to build Cruise.


Since ThoughtWorks created CruiseControl (the first open source Continuous integration Server) for nearly 10 years, our consultants have been helping our customers with continuous integration practices. After more than 10 years of accumulation, we have accumulated and summed up a number of theoretical principles and practices in building and deploying management as well as rapid, high-quality, and Low-risk delivery and release management, and we have integrated these principles with best practices and developed cruise (continuous integration and Release management systems), Using cruise can help the development team to quickly and frequently release the new tested features. By reducing the risk and cost of publishing complex applications, Cruise frees up the development team to focus on the most valuable work. Cruise launched the V1.0 in July 2008, and the current highest version is V1.2.

ThoughtWorks Studios is our product division, which is set up to bring agile development business models to new levels. With a wealth of experience in delivering more than 300 key business Projects ThoughtWorks, Studios is committed to making it possible for the global Distributed software development team to continue and quickly deliver business value. Cruise is only one of the products released by studios, and there are two other tools, mingle--Agile Project management tools, twist--new generation of automated testing tools.

how the cruise works.
Cruise is inherently a distributed system that includes servers and multiple agents. The server is the nerve center of the entire system, responsible for assigning work, saving the results and artifacts of the build, and the agent is primarily used to perform the work that the server distributes (job, you can temporarily understand as a build task) and reports the results to the server. As shown in the following figure.Installation of CruiseCurrently, cruise needs to install both server and at least one agent in order to really start working. Here we take Ubuntu8.04 as an example to install Cruise1.2.
Pre-installation preparation after registering with the studios Web site, download both the server and the agent's Deb installation package (cruise-server-1.2-????. Deb and cruise-agent-1.2-????. Deb). Get license in the registered mailbox. (The free version supports up to two agents and is valid for one year.) After a year, you can also send an email again to apply for a free version of license. Make sure you have Java JRE1.6 installed on the Ubuntu8.04, and if your project is a Java project, you also need to JDK1.6. The installation process installs server run ' sudo dpkg-i cruise-server-1.2-????. Deb ' When the command is over for a few minutes, visit http://localhost:8153/cruise and you can see the license page pasting the license copy you received into the page and saving it, you can see the prompt for the success of the update. You need to add at least one pipeline after clicking on the "Current Activity" tab. Install agent run ' sudo dpkg-i cruise-agent-1.2.-????. Deb ' When the command is over for a few minutes, click on the ' Agent ' tab in the browser and you will find that the local agent has been automatically registered on the server. The installation is complete and your cruise is ready to go.
several main concepts in cruise
Typically, our software development and release process is shown in the following illustration:
And Cruise is based on this, by building pipelines (Pipeline), build phase (Stage), build work (Job) and other basic concepts, linking continuous integration and release management, and integration into the cruise domain model, as shown in the following illustration:
First, Pipeline (build pipeline)

As we all know, Cruise introduced the concept of pipeline, but what it is. Simply put, in a code set, the process that all code starts from compiling to the end of the customer's goal can be viewed as a pipeline.

For example, if a project team is developing a Java-EE Web application, the application is in a set of internally developed and relatively stablecommon components and Interfaces(hereinafter referred to as a) based on user-tailoredActual business Requirements(hereinafter referred to as B), where the common components and interfaces can be viewed as a pipeline (hereinafter referred to as PA), and those developed as a result of business requirements can be considered as another pipeline (hereafter referred to as PB). ForAAny changes you require are compiled, automated unit tests, functional testing (and possibly other types of testing), eventually releasing a new stable version, and any changes to B or integration with a new version, so that B needs to be compiled, automated unit testing, functional testing (and possibly other types of testing) , the final release deployment to the customer site, on-line operation. These two processes are like two pipes, and any change in code will (and should) pass through these two pipes, and the qualified code will turn from the other end of the pipe to the finished product, and the unqualified code will be stuck at a certain point in the pipe.

Simple word:Pipeline is the embodiment of the software development and deployment lifecycle.

Second, Stage ("construction phase")


Simply put, stage is a collection of job (build integration work) that exists within pipeline.

For example (continue with the previous example), in the PA, unit tests run for 10 minutes, and functional tests run for 30 minutes, end-to-end deployment takes 10 minutes, end-to-end tests run for 50 minutes, and testers don't have exploratory tests scheduled, and it takes 3 minutes to compile the release. In practice, it's hard to get developers to wait until all the tests have run out. You can now use multiple stage to represent this workflow. Cruise users can define unit tests, functional tests, end-to-end deployments, End-to-end testing, exploratory testing of testers, and compilation releases into six stage, sorted sequentially. The cruise can make the submitted code go through all the stage in turn, with consistent versions.

Simple word:In a pipeline, multiple stage can be executed sequentially, and each build pipeline keep the code of each stage running on the same version number.

Job (build work)

A job is a build integration work that exists within a stage.

For example (continue with the previous example), in the PA, the unit Test stage has 100 tests, and it takes 10 minutes to run all as a job (for example, ANT all). To increase the speed of feedback, you can divide it into two jobs (such as Ant component1test and Ant component2test), so that the two jobs will have the opportunity to execute in parallel. (How to parallel, later)

Simple word:In a stage, multiple jobs can be executed in parallel; each job runs on the agent independently, stage all jobs are passed to trigger the next stage execution.

Iv. Agent (build actuator)

An agent is a machine that is used to do some job.

For example (continue with the previous example), in the PA, the unit Test stage two jobs are run on the JAVA1.5, using ant to build. Furthermore, with just two machines installed with JAVA1.5, the two machines are installed on the cruise agent side and are requested to work with the same cruise server. As long as the resources are set up, the two agents can request either of these jobs to execute separately.

Simple word:Multiple agents can be registered on the same server, and when each agent requests a job, the server assigns work on demand (resource matching).

V. Resource (Resources)


A resource is a resource declaration.

For example (continue with the previous example), the cruise user assigns the resource of these two agents as JAVA1.5 and tests the PA unit to test the two jobs in the stage Resource is also specified as JAVA1.5, when these two agents request work, the Cruise server executes the corresponding job according to the resource matching rules.

What isResource Matching rulesit. If the agent does not have a resource declaration, it can only be divided into those jobs that do not have resource requirements; jobs that do not have resource requirements can be executed on any agent; the resource-required job must be executed on the agent that provides the resource label, and at this point, The resource label on the agent may be more than the resource required by the job, and if multiple agents have the same resources, the server randomly assigns the job to one of the idle agents to execute.

Simple word:A resource is a tag; as long as they conform to the resource matching rules, the corresponding job may run on top of the agent.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.