Why do I need a CI / CD and how to learn how to configure it?

Navigating CI / CD is useful for both infrastructure engineers and developers. Konstantin Bryukhanov, Lead DevSecOps, explained what this methodology gives valuable and how online course “CI / CD” students learn to customize her processes.

Hello! I’ll start by telling you about the meaning of using CI / CD. I can single out 5 reasons:

1. Saving time due to reuse of code and fast deployment of projects

Having described some kind of pipeline for the delivery and deployment of code, you can always reuse it. For example, you have 5 Django projects, and you have already described in one of them how everything should unfold and work. These developments can be taken and copied by automating other Django projects with a little reconfiguration.

2. Getting the expected result from the deployment

The expected result means that if you once described the infrastructure or some process in the form of code, it means that every time you perform some automatic deployment processes, they will be the same. You always know what you get in the end.

CI / CD allows you to prevent situations when today you have deployed in one way, and tomorrow someone corrected something for themselves, you come, but everything does not work, and you need to figure out why. You have the opportunity to guarantee the business that the processes will lead to exactly the result that you regulate.

3. Project independence from the environment

Remember the frequent situation when you deployed the code to the server, nothing starts up for you, but the developer says that everything works for him. And you have to spend time to find out that in fact he changed some kind of addiction, which he kept silent about, for example. You have to reverse engineer and figure out the situation.

In CI / CD, everything that is needed for the service to work already comes with it. That is, you put your code, databases, dependencies in the container and give it to the server. Everything goes in one essence. Wherever you transfer this container, it has everything to work with. You don’t have to waste time setting up your environment.

4. Immutable infrastructure and easy migration

Immutability means that the infrastructure is always in the same state. You have deployed a server that has launched all the necessary processes, and any changes on this server will not be reflected on it. If you restart this server and re-run the server deployment process, it will return to its original position. There is no way to make and write any changes to the server infrastructure. It is impossible to harm him in any way.

And the ease of migration means that you just need to describe everything once. And when you need, for example, to deploy from one data center to another, you simply change the end point where to deploy, and move with ease, deploy the same code without any additional changes.

5. Possibilities of the “Infrastructure as Code” approach

This means that all programming patterns and approaches that are used for code are applicable to the infrastructure.

The most important thing is the presence of full-fledged versioning, which is done in the code, not the servers. This allows you to roll back, if necessary, to a previous version of the infrastructure. And an equally important opportunity to test the infrastructure, that is, to do a test deployment of the server, configure it so that it does not affect the rest of the servers.

In summary: what is CI / CD?

The concept allows to reduce the time to market without losing non-functional requirements: scalability, fault tolerance, documentation, etc. It consists of 2 things:

  • CI (Continuous Integration) allows you to quickly integrate code changes into the working version of the code. Make sure that the new code gets into the last stable one.
  • CD (Continuous Delivery / Deployment) allow not only to integrate functionality into the working version of the code, but also to bring a new working version of the code to the market as quickly as possible. Depending on the tasks of the project, this happens either automatically, or we ourselves send the code using refined scripts.

From here it is obvious that it is not enough just to study the technologies Gitlab CI, Doker, Ansible, terraform, etc., on which the CI / CD is built. Therefore, on the course, we were especially attentive to working out the practice. Design work is the final part of the training, where you have to implement CI / CD processes for any opensource project of your choice. The sequence of students’ actions is as follows:

  • We design CI / CD Workflow, Gitlab CI. That is, we develop all the expected stages: assembly, testing, deployment of a dynamic environment, etc. All this is projected on the diagram.
  • We imitate a certain company, imagine that we are in a certain company with a number of projects. And we take several projects, preferably on a different stack. For example, one in Django. another in Java, etc.
  • We take the CI / CD stages that we designed for each application, disassemble and design each stage by elements of the CI chain. At the same time, we are looking at where we can use the same piece for all projects, for which we will have to make small differences. Thus, we combine three projects within the framework of our general developed scheme and for each draw its own path.
  • We describe all the necessary components of these chain links: terraform plans, Ansible roles, playbooks, Doker files, put them in their places correctly, version them.
  • As a designer, we assemble a real pipeline from these described elements, which will fully ensure the life of the product inside and out.
  • We finish on top of this pipeline such things as alerts in Slack and Telegram in order to receive error reports and notifications about the beginning and end of the deployment.

The goal of the final work is to get a completely ready-made solution at the end that is acceptable for the business, which can be added to the portfolio and demonstrated at the interview. In fact, if you come to a company and say that you have developed universal solutions from scratch for three different projects, this is a serious argument for getting a position.

Classes begin on August 27, but you can join the group within two weeks after the start. The course is designed for specialists with experience in development and operation, for training you will need pass the entrance test… I am waiting for everyone who decided to master this useful technology for their projects and career growth. See you at OTUS!

Similar Posts

Leave a Reply