Тёмный

How to configure your own Gitlab CI Runner 

Valentin Despa
Подписаться 60 тыс.
Просмотров 128 тыс.
50% 1

Опубликовано:

 

17 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 105   
@vdespa
@vdespa 4 года назад
👉 Want to learn more about CI/CD and DevOps? Check my Gitlab CI online course. vdespa.com/courses/
@xaviergravel8110
@xaviergravel8110 4 года назад
this is so much more concise than other tutorial videos. Thank you for actually knowing what you're doing haha
@vdespa
@vdespa 4 года назад
Thanks 👍 I am glad this helped.
@afz902k
@afz902k 4 года назад
Hi there, great video to get started with gitlab runners, I ran into some issues running from scratch on Windows and this is how I worked through them: 1. Runner does not connect with gitlab: there can be many reasons this happens, but for me it was due to registering the runner before having completed the docker desktop installation in full, including the restart. Runners were able to connect after that, but I did have to run the command *gitlab-runner-windows verify* 2. Executor requires OSType=windows, but Docker Engine supports only OSType=linux, as the error itself says, this is due to selecting docker-windows as the runner executor instead of simply docker, you can change the executor on a runner but it might be quicker to register a new one with the right executor type. 3. Runner stuck pulling docker image ruby:2.6 - I was doing all this on a random Windows laptop I had lying around, which had a pretty finicky WiFi connection and timed out several times trying to pull docker images. You can just retry when your runner host internet connection is better, what I did is a manual docker pull ruby:2.6 before running the pipeline. Not a great solution in actual CI/CD but in those cases I guess it's better to have at least a partial dockerhub mirror or your internal docker registry that is reachable and fast to connect to. For context, I installed git for windows and docker desktop right before gitlab-runner, and chose to work with linux docker containers. That was all I needed, but for folks out there don't forget to do all the command-line stuff in an elevated shell/powershell session. I would massively recommend to use Linux instead if you can
@vdespa
@vdespa 4 года назад
Thanks for sharing all this. Very helpful. Windows is indeed causing many issues with tools that work well on Linux.
@Steelingz
@Steelingz 3 года назад
Quick, easy, and straight to the point! Awesome!
@vdespa
@vdespa 3 года назад
Thanks 👍
@deathbypenguins
@deathbypenguins 4 года назад
I need to do this same thing... your video was so concise and straight to the point, thanks!
@vdespa
@vdespa 4 года назад
I am glad it was helpful, Alexis!
@rajkumar-pf4xf
@rajkumar-pf4xf 3 года назад
This is what exactly I'm looking for 👍
@vdespa
@vdespa 3 года назад
I am glad it helped!
@gettysburger
@gettysburger 4 года назад
This is great. Just what I needed. Thanks. I would also see how to create a runner inside a Docker image that is running in the GitLab Registry.
@vdespa
@vdespa 4 года назад
Thanks for your comment. TheGitLab Registry is just for storing containers, not for running them. So I don't see how this would be possible.
@henrystrainsandmore3546
@henrystrainsandmore3546 4 года назад
This is great to know. I am new to this and thought it might work. Thanks!
@daily6912
@daily6912 2 года назад
thank you soo much , i was so much confuse to solv this problem
@vdespa
@vdespa 2 года назад
Happy to help! You are welcome. Thank you for leaving a comment.
@swatitomer5542
@swatitomer5542 4 года назад
Your tutorials are very helpful :)
@vdespa
@vdespa 4 года назад
Thank you very much for watching!
@SupunPraneeth
@SupunPraneeth 3 года назад
This is short and clear, thanks
@vdespa
@vdespa 3 года назад
Glad it was helpful!
@fulltime5937
@fulltime5937 3 года назад
Nice tuto sir. Thanks a lot :)
@vdespa
@vdespa 3 года назад
Thanks, i am glad it helped!
@lincethomas2365
@lincethomas2365 3 года назад
Super useful buddy!
@vdespa
@vdespa 3 года назад
Thanks for watching
@manavid86
@manavid86 3 года назад
It's very helpful... Please upload video for gitlab jira integration.. thanks
@vdespa
@vdespa 3 года назад
I am glad. How do you want to integrate GitLab with Jira? Please be more specific.
@mevidvash6139
@mevidvash6139 2 года назад
Thank you !
@vdespa
@vdespa 2 года назад
You're welcome!
4 года назад
Hi, this seems stupid question, why you select ruby:x.x.x as default image? and how this affects the container execution?
@vdespa
@vdespa 4 года назад
Great question. That is the default image that gitlab.com uses as well. If you don't specifiy an image, it will default to that Ruby image.
@entarossa
@entarossa 7 месяцев назад
Hello, Valentin. I have a question. Gitlab already has shared runners. Why install your own runner? Is it safe to use shared runners provided by Gitlab by default? When do you need to install your runner? Thank you!
@madhusudanahb
@madhusudanahb 4 года назад
Neat explanation :) so is there a performance advantage with specific runner ? shared runners take a long time usually
@vdespa
@vdespa 4 года назад
Yes, you can get a significant performance advantage with your own runners and you can have dedicated hardware for your needs (eg. more GPU or memory or... )
@edrakalmoosawi6661
@edrakalmoosawi6661 3 года назад
Followed all instructions here and successfully added a gitlab runner in Gitlab project settings. But when I run pipelines, they are stuck in "pending state". The gitlab-runner is not picking up the jobs, anyone can help?
@Dudarinho
@Dudarinho 2 года назад
same for me bro
@rusynvasyl
@rusynvasyl 4 года назад
Thank you so much
@vdespa
@vdespa 4 года назад
Any time
@anudeep7919
@anudeep7919 4 года назад
Nice intro! I have a doubt which might be stupid, how does the gitlab connect to the runner on your local to run the pipeline? Should there be a connectivity of my machine on network and the firewall has to be turned off? please suggest , Also redirect me if there's a link on gitlab which answers this Thanks!
@vdespa
@vdespa 4 года назад
Great question. AFAIK, the communication is done over HTTPS using the standard port. I think for this reason, this does not need any additional firewall settings, but this depends from case to case. Did it work for you?
@gujarisantamanyugmai
@gujarisantamanyugmai 3 года назад
Hi, what is the meaning of "Running on server"? How it is implemented? Below is the snippet of the pipeline log:- Using Shell executor... 00:00 Running on server...
@bluebayspring18
@bluebayspring18 3 года назад
Thanks for your helpful video. I just want to know which infrastructure is "more cost effective" and "more reliable". I want to use AWS for Gitlab configuration. Only 1000 minutes on gitlab.com. I think the quota is not enough. therefore there are 2 options on the gitlab documentation page, one of them "Auto-Scale GitLab Runner on AWS EC2" and "Auto-Scale GitLab CI on AWS Fargate". So which one do you think should I install?
@hamsyedful
@hamsyedful 2 года назад
Hi Valentin, // I HAVE A QUESTION! my GitLab runner is not picking jobs ,it is registered ,it is running and while running a pipeline it runs couple of jobs and stuck in pending state .if i try to run any other job it goes into pending .. only solution i found is GitLab-runner run ,command . do you know what could be the issue and how can i permanently fix this ? also it started happening only after i install docker on the runner machine (ec2 rhel)
@vdespa
@vdespa 2 года назад
Hi Syed, sorry for the late reply. Are you using GitLab.com or a self-managed GitLab server?
@vdespa
@vdespa 2 года назад
Hi Syed, sorry for the late reply. Are you using GitLab.com or a self-managed GitLab server?
@hamsyedful
@hamsyedful 2 года назад
Hi Valentine I am using self managed gitlab server
@jinkahari
@jinkahari Год назад
Can we create Gitlab runners with our own images(linux and windows)? I am trying to create a runner in EKS cluster. Please suggest.
@mukundrao1989
@mukundrao1989 4 года назад
Hey would you be able to do a video for autoscaling runners in AWS with docker-machine. Pretty please!
@vdespa
@vdespa 4 года назад
I will look into that. Thanks for the suggestion.
@raghupathym25
@raghupathym25 Год назад
Thanks for the video. How to deploy via cicd if machine is behind the windows bastion host. My aws instance is behind windows bastion. Is this task possible. Currently my cicd is deploying to dev environment(public IP), the requirement is to deploy to prod environment(privateIP)
@velikiy-prikalel
@velikiy-prikalel 2 года назад
Спасибо. заработало
@vdespa
@vdespa 2 года назад
Добре дошли
@TecSanento
@TecSanento Год назад
My runner fails to run the pipeline because its a private repo - how do i allow access for the runner ?
@nareshthalari8472
@nareshthalari8472 3 года назад
Hey, i have a local shell runner and need to add to my gitlab with shared docker executor.. can you tell me the steps
@arunj5357
@arunj5357 Год назад
Getting the below error when I try to run on windows machine. Please suggest some tips. Thank You ERROR: Job failed (system failure): prepare environment: failed to start process: exec: "pwsh": executable file not found in %PATH%.
@santoshverma8971
@santoshverma8971 3 года назад
Thanks for this video, I'd like to know how can I run my own private docker image from AWS ECR instead of that default (ruby:2.6 ) image? Should I use shell mode and download through a shell script?
@vdespa
@vdespa 3 года назад
Why publish to ECR when you can publish directly in GitLab and use it from there? Have you considered that?
@GauravBhandari85
@GauravBhandari85 4 года назад
What if you get a docker login error? One thing I find ot hard to understand is that is it possible I can have Gitlab project on Gitlab.com while my runner is on my virtual machine and how will my runner understand that there is a commit on my project and create a docker image on my VM
@GauravBhandari85
@GauravBhandari85 4 года назад
ok, tested it. It is working now. My latest setup is following: - Project is on my Gitlab account (Hosted by Gitlab.com) - The runner is running on my virtual machine - When I commit a file in my project the runner understands it and creates a docker image on my virtual machine. Thank you for your video :)
@vdespa
@vdespa 4 года назад
I am glad it is working now, thanks for sharing.
@prakash8876
@prakash8876 Год назад
I am using shell, how to added another runner? I need 2 runners and make one active and other pause. Also I want make this as highavaiable if one runner down, other should pick up
@vdespa
@vdespa Год назад
The idea is to add runners on different machines. I don't know of a way to pause a runner. Since the machine with the runner already has allocated resources, just have two runners active at the same time. If one dies, GitLab will only use the one working.
@groovebird812
@groovebird812 3 года назад
Hi, nice video. If i use docker via the Cloud Version i can run a runner on my local maschine or do i have to use a server in the internet? If not, how does it work that gitlab hast access to my local maschine?
@vdespa
@vdespa 3 года назад
You can install your own Gitlab server and be offline, no internet. Otherwise, yes, how else?
@occitany2982
@occitany2982 Год назад
3:03 right after this, there is now optional maintenance note for the runner and i can't skip when i try to press enter it just does a newline. How can i skip it ?
@vdespa
@vdespa Год назад
I don't think this field is mandatory. But anyway, just enter some text.
@akshathakl4740
@akshathakl4740 7 месяцев назад
Hi, Created runners using command in Linux and it's active also. But when I do push or commit changes to gitlab cicd pipeline is triggered but status shows pending for some time and gets failed. What is the reason? Could u please help me
@vdespa
@vdespa 7 месяцев назад
It seems like GitLab can't find any runners. Can the runner run untagged jobs?
@jovelynobias5422
@jovelynobias5422 Месяц назад
How to configure proxy for gitlab runner? Im using dind and kubernetes executor
@ANILKUMAR1794
@ANILKUMAR1794 4 года назад
Nice tutorial. Is it mandatory to have GitLab code on https (SSL Certificate verified) to use GitLab CICD?
@vdespa
@vdespa 4 года назад
Thank you. I am not sure what you mean by that. https or ssh is just a secure way for Git to communicate with the server.
@ANILKUMAR1794
@ANILKUMAR1794 4 года назад
@@vdespa Let me rephrase that. Can I use GitLab CI/CD on locally hosted http server?
@Mawkisht1
@Mawkisht1 4 года назад
Hi Valentin! thanks for all the knowledge just wanted to know the difference between /etc/gitlab-runner/config.toml and /srv/gitlab-runner/config/config.toml whenever i am registering gitlabrunner it's being updated in /etc/gitlab-runner/config.toml which i am able to list as well what is the role of /srv/gitlab-runner/config/config.toml how will i overwrite the same
@vdespa
@vdespa 4 года назад
Are you using Docker mount folders? Is /srv/gitlab-runner/config/config.toml not mapping to /etc/gitlab-runner/config.toml in the container?
@Truthsetsyoufree100
@Truthsetsyoufree100 3 года назад
Hey Valentin, I am wondering how to register two runners on the same machine. I am looking to use it for another project.
@amitchettri_ac
@amitchettri_ac 3 года назад
Even I am looking for the same. Right now my runner is running with gitlab-runner user. But I wanna know if there is a way to use user1 to execute project 1 user2 to project 2 insted of gitlab-runner @Valentin. Can you u help?
@vdespa
@vdespa 3 года назад
Why do you need two runners on the same machine? Typically a runner can run 4 concurrent jobs by default. You can change that setting. docs.gitlab.com/runner/configuration/advanced-configuration.html
@kamelromdhani8301
@kamelromdhani8301 3 года назад
I don't find the "runners" section under CI/CD, what is the problem?
@vdespa
@vdespa 3 года назад
Are you using GitLab.com?
@nipungupta176
@nipungupta176 3 года назад
I followed the steps you mentioned on my local gitlab server. But I am getting error while registering runner
@vdespa
@vdespa 3 года назад
And which error are you getting?
@PrafulDhabekar
@PrafulDhabekar 3 года назад
Neat explanation :) But I ran into problem when I run this command: sudo gitlab-runner install Error: FATAL: Please specify user that will run gitlab-runner service
@vdespa
@vdespa 3 года назад
It is hard to know what the problem is in this case. Join the Facebook community (facebook.com/groups/1830385683880815) and ask your question there. Consider adding more details, including screenshots. Thanks for understanding.
@Truthsetsyoufree100
@Truthsetsyoufree100 4 года назад
How can I setup a runner to run using my target platform? Like run directly on my machine not in a container
@Truthsetsyoufree100
@Truthsetsyoufree100 4 года назад
ah you use the shell I think anyways.... Ill try that
@vdespa
@vdespa 4 года назад
Yes, I have used the shell. But you can install Docker and configure the runner to use docker.
@ajithkumara3747
@ajithkumara3747 4 года назад
Sir in my remote server im installed the gitlab runner and after my gitlab-runer registration the gitlab repo ci/cd runners stores ipv6 address. but i need to fetch ipv4. what i will do for this problem ?
@vdespa
@vdespa 4 года назад
It is hard to know what the problem is in this case. Join the Facebook community (facebook.com/groups/1830385683880815) and ask your question there. Consider adding more details, including screenshots. Thanks for understanding.
@ksubrahmanyam7747
@ksubrahmanyam7747 2 года назад
for every project wee need to install runner newly?
@vdespa
@vdespa 2 года назад
No. You can create a group and configure the runner there.
@RABWA333
@RABWA333 4 года назад
Do you have gitlab pipeline on Kubernetes tutorial?
@vdespa
@vdespa 4 года назад
Where is you Kubernetes infrastructure?
@scott_strool
@scott_strool 3 года назад
How do I use an existing docker image that has programs loaded in it. Your demo does not seem useful scenario
@vdespa
@vdespa 3 года назад
You define which Docker image to use from your pipeline, the .gitlab-ci.yml
@scott_strool
@scott_strool 3 года назад
@@vdespa did that but still either cant find it or msg says you need to docker login.
@florianfelix8295
@florianfelix8295 3 года назад
do i need to have docker installed on my desktop for this?
@vdespa
@vdespa 3 года назад
The machine that is running the Gitlab runner needs to have Docker installed if you want to run jobs using Docker.
@janituma9769
@janituma9769 3 года назад
How can I define a specific shared runner into my gitlab-ci ?
@vdespa
@vdespa 3 года назад
You can use the tags property to configure a job to use a specific runner. You also need to tag the runner.
@elhamahmadlou5185
@elhamahmadlou5185 4 года назад
Hi what shoud i do for this problem ? ERROR: Registering runner... failed runner=PzKU6zJ8 status=couldn't execute POST against gitlab-test.test.ir/api/v4/runners: Post gitlab-test.test.ir/api/v4/runners: Bad Gateway PANIC: Failed to register this runner. Perhaps you are having network problems
@vdespa
@vdespa 4 года назад
Try to see if you can register the runner against github.com.
@vallalarasupandiyan3464
@vallalarasupandiyan3464 2 года назад
Can you please create gitlab-ci.yml file for ReadyAPI/Soapui
@scott_strool
@scott_strool 3 года назад
lets see the pipeline steps
@farzankhalaj415
@farzankhalaj415 Год назад
Are you still answering ?
@ayomidewilfred1864
@ayomidewilfred1864 Месяц назад
The runner is very slow compared to gitlab shared runner
@vdespa
@vdespa Месяц назад
@@ayomidewilfred1864 it depends on how it is configured and the resources available.
Далее
GitLab CI/CD | GitLab Runner Introduction | 2022
23:28
Просмотров 124 тыс.
GitLab CI/CD - Providing your own docker runners
14:17
Просмотров 3,1 тыс.
Send Gitlab CI reports & artifacts by e-mail
8:37
Просмотров 20 тыс.
GitLab CI CD Pipeline Tutorial | Introduction | 2022
34:43
Gitlab Runner - Create a private runner on Ubuntu 22.04
23:05