Download - Docker e git lab
![Page 1: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/1.jpg)
Docker & GitLabDocker & GitLab as a Continuous Integration platform
![Page 2: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/2.jpg)
GPad
Born to be a developer with an interest in “system admin”
I develop using many languages like C++, C#, js and ruby. I have recently fallen in love with functional programming, especially with elixir, erlang, clojure and haskell.
CTO & founder of coders51
![Page 3: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/3.jpg)
We develop web and mobile solutions for the entire galaxy
We don’t develop web sites
At least not simple ones ...
Every time there is something new and interesting, we want to be there!!
![Page 4: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/4.jpg)
Technologies
![Page 5: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/5.jpg)
Continuous Integration https://en.wikipedia.org/wiki/Continuous_integration:
Continuous integration (CI) is the practice, in software engineering, of merging all developer working copies to a shared mainline several times a day. It was first named and proposed by Grady Booch in his 1991 method, although Booch did not advocate integrating several times a day. It was adopted as part of extreme programming (XP), which did advocate integrating more than once per day, perhaps as many as tens of times per day.
![Page 6: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/6.jpg)
Continuous Integration http://www.martinfowler.com/articles/continuousIntegration.html:
Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that ….
![Page 7: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/7.jpg)
Install Install InstallEach software should be installed on a CI computer
Each software with its own dependencies
Each software has different dependencies
Each software has different dependencies with different versions
This is a mess ...
![Page 8: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/8.jpg)
How we used to do it ...
![Page 9: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/9.jpg)
It works on my computer ...One test fails on the CI computer, but not on the developer’s computer
The CI environment is different from the production environment
The CI environment is different from the development environment
![Page 10: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/10.jpg)
Who cleans up this mess ?!?After running the tests we have some dirty data
Dirty data in the database
Dirty data in the file system
Some dirty states on the external services
![Page 11: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/11.jpg)
GitLab
![Page 12: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/12.jpg)
GitLab as CI
![Page 13: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/13.jpg)
GitLab as CI
![Page 14: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/14.jpg)
GitLab as CI
![Page 15: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/15.jpg)
GitLab as CI
![Page 16: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/16.jpg)
Why Docker?!?If we use Docker:
- We can create an isolated environment
- It’s not necessary to clean data after the tests
- It’s “simple” to put together all the necessary external services
- It’s easy to replicate on different computers
![Page 17: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/17.jpg)
Install becomes DeclareIt’s not necessary to install all software on the CI computer
We can “declare” external dependencies
In .gitlab-ci.yml we can declare everything regarding the software under test:
- which images we require
- which services we depend on
- which scripts we want to execute
![Page 18: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/18.jpg)
Install becomes Declare
![Page 19: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/19.jpg)
Install becomes Declare
![Page 20: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/20.jpg)
Install becomes Declare
![Page 21: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/21.jpg)
Install becomes Declare
![Page 22: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/22.jpg)
Install becomes Declare
![Page 23: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/23.jpg)
Install becomes Declare
![Page 24: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/24.jpg)
Install becomes Declare
![Page 25: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/25.jpg)
Install becomes Declare
![Page 26: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/26.jpg)
Install becomes Declare
![Page 27: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/27.jpg)
Auto-cleaning system ...The images are stored in cache on the CI server
At every restart the state of the container is known
It’s simple to avoid a corrupted situation
If the test fails we don’t have any “garbage data” left over
![Page 28: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/28.jpg)
Easily replicableLocal:
![Page 29: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/29.jpg)
Easily replicable ...GitLab:
![Page 30: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/30.jpg)
Easily replicable ...GitLab:
![Page 31: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/31.jpg)
Easily replicable ...Run mongo:
sudo docker run --name mongo-dockerops -d mongo
Run node:
sudo docker run -it --link mongo-dockerops:mongo -v `pwd`:/opt/app node:0.12 /bin/bash
root@9b71e87dfd1c:/# grunt test
![Page 32: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/32.jpg)
Pros & ConsPROS
No need to install all software on the CI computer
The environment is always clean at every restart
The CI environment can be replicated on every computer
CONS
It’s slow when there are a lot of dependencies to download
We need to manage new technologies (Docker)
![Page 33: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/33.jpg)
Evolution ?!?Start to use Docker on development machine with Compose
![Page 34: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/34.jpg)
Evolution ?!?Start to use Docker in production ...
![Page 35: Docker e git lab](https://reader033.vdocument.in/reader033/viewer/2022061307/58a2973f1a28ab36508b6bd9/html5/thumbnails/35.jpg)
Thank you!!!!
Q&A!!!