No Result
View All Result
Cloud Reports
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • PC & Laptop
  • Technology & Digital
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • PC & Laptop
  • Technology & Digital
No Result
View All Result
Cloud Reports
No Result
View All Result

Accelerate your Continuous Integration pipelines with Directed Acyclic Graph (DAG)

npn by npn
December 22, 2020
in Web development
Reading Time: 4min read
A A
0
Accelerate your Continuous Integration pipelines with Directed Acyclic Graph (DAG)

An acyclic directed graph allows the various stages of the pipeline to be executed out of order, ignoring the sequencing of the stages and allowing the tasks to be linked directly to each oth

READ ALSO

Javascript developer should stop for … in for now

Javascript developer should stop for … in for now

December 31, 2020
13
How to display colors (color, bgcolor) in console.log () for javascript developers!

How to display colors (color, bgcolor) in console.log () for javascript developers!

December 29, 2020
9

Recently, GitLab released a great feature that helps reduce pipeline execution time and provides more flexibility in the order of task execution. This functionality: the directed acyclic graph (DAG: Directed Acyclic Graph ) is now available for free on froggit.fr, and on the self-hosted version of GitLab.

Tasks and stages of the pipeline

In a typical CI / CD pipeline, there are multiple stages representing the automation of the DevOps process such as compilation, testing, packages, configuration and deployment. Each step consists of one or more tasks. In the CI / CD configuration file: .gitlab-ci.yml you define the order of your steps. Usually, the pipeline starts with the compilation tasks, once all these tasks are completed, the tests begin, then the next step, and so on.

While this order makes perfect sense, in some cases it can slow down execution time when considered as a whole. Imagine that the compilation step is made up of task A which takes a minute and task B which is very slow (say it takes 5 minutes). Task C belongs to the test step, but it only depends on task A. Task C will still have to wait 5 minutes before being executed, which represents a loss of 4 minutes.

Get to know the directed acyclic graph

DAG allows you to run pipeline stages out of order, breaking the sequencing of stages and allowing tasks to jump back to each other directly regardless of which stage they belong to.

With the DAG, tasks can start directly after the tasks on which they depend are completed, even if other tasks from the previous step are still in progress. This new functionality speeds up the CI / CD process and enables faster deployment.

In the example below, a project generates both Android, iOS, and web apps through a multi-stage pipeline. IOS testing begins as soon as the iOS compilation is complete instead of waiting for the Android and web builds to complete as well. The same goes for the iOS deployment: it launched after the iOS tests were finished, without waiting for the other tests to finish. The total compute time may be the same, but the actual elapsed time is different. In more complex cases, it is possible to reduce the actual elapsed time for the pipeline significantly by declaring which task is dependent on which another task.

Declaration of dependencies between tasks

The .gitlab-ci.yml file introduces a new keyword: needs which takes as parameter an array of tasks on which it depends.

ADVERTISEMENT
ios:
  stage: build
  script:
    - echo "build ios..."


ios_test:
  stage: test
  script:
    - echo "test something..."
  needs: ["ios"]

The ios_test task , which is part of the test stage , will start immediately after the ios task which is in the build stage and it will run regardless of the status of other tasks in the build stage .

When is this useful?

This can be very useful under the increasingly popular mono repository model where you have multiple folders in your repository that can compile, test, and possibly even deploy independently, just like in our example above where iOS, Android and web apps can be compiled, tested and deployed individually.

Another use could be when your pipeline has very heavy tests taking a long time to run. It would make sense to run these tests as early as possible rather than waiting for unrelated tasks to complete before finally launching them.

ShareTweetShare
Previous Post

Pathway to learn javascript to reactjs

Next Post

If you want to learn React JS within 3 months, the following 8 basics must first be known

npn

npn

Related Posts

Javascript developer should stop for … in for now
Javascript

Javascript developer should stop for … in for now

December 31, 2020
13
How to display colors (color, bgcolor) in console.log () for javascript developers!
Javascript

How to display colors (color, bgcolor) in console.log () for javascript developers!

December 29, 2020
9
What is Unit Test? Introduction and Example about Unit Test
Web development

What is Unit Test? Introduction and Example about Unit Test

December 24, 2020
6
The FUNDAMENTAL model for learning Web Development.
Web development

The FUNDAMENTAL model for learning Web Development.

December 21, 2020
19
UTM Google, know everything to better use them!
Web development

UTM Google, know everything to better use them!

December 18, 2020
8
Developers and Trades united in 2021?
Web development

Developers and Trades united in 2021?

December 17, 2020
6
Next Post
If you want to learn React JS within 3 months, the following 8 basics must first be known

If you want to learn React JS within 3 months, the following 8 basics must first be known

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Categories

  • Android (1)
  • Ant Design tutorial (7)
  • Javascript (21)
  • Layout and Routing (2)
  • Linux (3)
  • PC & Laptop (34)
  • React (17)
  • SQL (2)
  • Technology & Digital (124)
  • The Basics (5)
  • Web development (38)

Search

No Result
View All Result
No Result
View All Result
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • PC & Laptop
  • Technology & Digital