SlideShare a Scribd company logo
1 of 23
Download to read offline
5 things I wish I knew about Gitlab CI
Sebastian Witowski
5 things I wish I knew about Gitlab CI
Sebastian Witowski
Have an hour to spare?
1. Interruptible jobs
build:
stage: build
interruptible: true
script:
- docker compose build
1. Interruptible jobs
2. Caching
You can use caching to, well,
cache stuff between jobs.
2. Caching
You can use caching to, well,
cache stuff between jobs.
But you can also specify if
you want to push or pull stuff
to cache using policy key.
default:
cache: &global_cache
key: $CI_COMMIT_REF_SLUG
paths:
- .cache/pip
- some/other/path/
policy: pull-push
job:
cache:
# inherit all global cache settings
<<: *global_cache
# override the policy
policy: pull
2. Caching with Fastzip
For caching/artifacts, you
can choose different level
of compression (low level of
compression runs faster, but
results in a larger zip file).
variables:
FF_USE_FASTZIP: "true"
# Available options are:
# fastest, fast, default, slow,
# or slowest
ARTIFACT_COMPRESSION_LEVEL: "fastest"
CACHE_COMPRESSION_LEVEL: "fastest"
3. Split slow tests into multiple jobs
• Make MR pipelines fast and main branch pipelines
thorough.
3. Split slow tests into multiple jobs
• Make MR pipelines fast and main branch pipelines
thorough.
• Or run the slow tests at the end of the test suite
(https:/
/stackoverflow.com/a/61539510)
4. Hidden jobs and anchors
Allows you to reuse parts of the config
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script:
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script:
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script:
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script:
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script:
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script: &docker-before-script
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
- *docker-before-script
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
5. Runners
5. Runners
• Very easy to set up and use (it's just a binary)
5. Runners
• Very easy to set up and use (it's just a binary)
• Save you money if you run many jobs
5. Runners
• Very easy to set up and use (it's just a binary)
• Save you money if you run many jobs
• Allows for much more flexibility (e.g. access to
proprietary code on your servers)
Wanna learn more?
Questions?
switowski.com
@SebaWitowski
Slides: https:/
/www.slideshare.net/SebastianWitowski

More Related Content

Similar to 5 Things I Wish I Knew About Gitlab CI

Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐KAI CHU CHUNG
 
Build optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerBuild optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerDmytro Patkovskyi
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stackDana Luther
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.skJuraj Hantak
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chefMukta Aphale
 
Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015Chef
 
Docker security
Docker securityDocker security
Docker securityJanos Suto
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushPantheon
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...Puppet
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configurationlutter
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneVEXXHOST Private Cloud
 
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...Mihai Criveti
 
DevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux ContainersDevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux Containersinside-BigData.com
 
ContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerDocker-Hanoi
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Bo-Yi Wu
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020CloudHero
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context ConstraintsAlessandro Arrichiello
 

Similar to 5 Things I Wish I Knew About Gitlab CI (20)

Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
 
Build optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerBuild optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and Docker
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015
 
Docker security
Docker securityDocker security
Docker security
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub Clone
 
Gradle como alternativa a maven
Gradle como alternativa a mavenGradle como alternativa a maven
Gradle como alternativa a maven
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
 
DevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux ContainersDevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux Containers
 
ContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with Docker
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
 

More from Sebastian Witowski

Python Versions and Dependencies Made Easy
Python Versions and Dependencies Made EasyPython Versions and Dependencies Made Easy
Python Versions and Dependencies Made EasySebastian Witowski
 
Productivity tips for developers
Productivity tips for developersProductivity tips for developers
Productivity tips for developersSebastian Witowski
 
Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)Sebastian Witowski
 
It's 2019 & I'm still using Python 2! Should I be worried?
It's 2019 & I'm still using Python 2! Should I be worried?It's 2019 & I'm still using Python 2! Should I be worried?
It's 2019 & I'm still using Python 2! Should I be worried?Sebastian Witowski
 

More from Sebastian Witowski (6)

Writing Faster Python 3
Writing Faster Python 3Writing Faster Python 3
Writing Faster Python 3
 
Python Versions and Dependencies Made Easy
Python Versions and Dependencies Made EasyPython Versions and Dependencies Made Easy
Python Versions and Dependencies Made Easy
 
Productivity tips for developers
Productivity tips for developersProductivity tips for developers
Productivity tips for developers
 
Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)
 
It's 2019 & I'm still using Python 2! Should I be worried?
It's 2019 & I'm still using Python 2! Should I be worried?It's 2019 & I'm still using Python 2! Should I be worried?
It's 2019 & I'm still using Python 2! Should I be worried?
 
Wait, IPython can do that?
Wait, IPython can do that?Wait, IPython can do that?
Wait, IPython can do that?
 

Recently uploaded

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Recently uploaded (20)

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

5 Things I Wish I Knew About Gitlab CI

  • 1. 5 things I wish I knew about Gitlab CI Sebastian Witowski
  • 2. 5 things I wish I knew about Gitlab CI Sebastian Witowski
  • 3. Have an hour to spare?
  • 5. build: stage: build interruptible: true script: - docker compose build 1. Interruptible jobs
  • 6. 2. Caching You can use caching to, well, cache stuff between jobs.
  • 7. 2. Caching You can use caching to, well, cache stuff between jobs. But you can also specify if you want to push or pull stuff to cache using policy key. default: cache: &global_cache key: $CI_COMMIT_REF_SLUG paths: - .cache/pip - some/other/path/ policy: pull-push job: cache: # inherit all global cache settings <<: *global_cache # override the policy policy: pull
  • 8. 2. Caching with Fastzip For caching/artifacts, you can choose different level of compression (low level of compression runs faster, but results in a larger zip file). variables: FF_USE_FASTZIP: "true" # Available options are: # fastest, fast, default, slow, # or slowest ARTIFACT_COMPRESSION_LEVEL: "fastest" CACHE_COMPRESSION_LEVEL: "fastest"
  • 9. 3. Split slow tests into multiple jobs • Make MR pipelines fast and main branch pipelines thorough.
  • 10. 3. Split slow tests into multiple jobs • Make MR pipelines fast and main branch pipelines thorough. • Or run the slow tests at the end of the test suite (https:/ /stackoverflow.com/a/61539510)
  • 11. 4. Hidden jobs and anchors Allows you to reuse parts of the config
  • 12. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 13. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 14. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 15. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 16. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 17. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: &docker-before-script - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: - *docker-before-script # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 19. 5. Runners • Very easy to set up and use (it's just a binary)
  • 20. 5. Runners • Very easy to set up and use (it's just a binary) • Save you money if you run many jobs
  • 21. 5. Runners • Very easy to set up and use (it's just a binary) • Save you money if you run many jobs • Allows for much more flexibility (e.g. access to proprietary code on your servers)