For a while, I’ve been working on a project that uses GitLab Runner with Docker as its executor. Since runners are hosted on CentOS 7, everything made sense—until we started looking at moving it to CentOS 8, and our world exploded.
The first thing we were thinking was, since Podman is a drop-in replacement, this should be easy (you can imagine the veracity of that statement yourselves). The truth was, Podman didn’t have the API that GitLab Runner used to manage the containers, so even if we could do everything manually, we weren’t there yet.
OK, back to the drawing board, how about we file a GitLab issue for GitLab Runner to implement Podman as an executor? It turns out that the issue already existed. The paraphrased answer was, "we’re not taking any new executors, but if you write it yourself, we can see if we can take it." My knowledge of the internals of GitLab Runner is worse than my German, and all I can say is "Danke," not even the whole word.
Don't try this at home
This "simple" migration was being anything but, so as a last resort, we thought, there must be a way to install Docker in CentOS8. Well, you can read some "tutorials" that do it, but they make you want to claw your eyes out, so that wasn’t an option. (Seriously, don’t try this at home).
[ You might also like: Improved systemd integration with Podman 2.0 ]
Some time went by, and we temporarily moved to another project that was more urgent. Even though we wanted to move everything to CentOS 8, there was no hurry.
But then a few months ago, we found a post saying that Podman was implementing a Docker compatible REST API. It felt like they were reading our minds; this is exactly what we needed. This should be easy now. (You see where I’m going with this, right?)
We started testing again when Podman 2.0 was released, all happy and optimistic. GitLab Runner was connecting to the socket but failing to create volumes. Then we read the release notes more carefully, and they said that the endpoint for volumes was not implemented yet, but it was in the main tree (soon to be 2.1). So we still had a chance.
A hacky backport
A few days went by; we made a hacky backport of the volumes endpoint to 2.0 and tried the main branch too, but it all was failing, and we had no idea why.
Luckily, Podman 2.1 was released pretty quickly, and we were back on track. We started again, but this time, we took a different approach. After commenting a little bit on the corresponding Podman issue, we started hanging out in #podman on IRC and asking questions about this problem. We got a few answers from the devs, and that’s when things became interesting!
We set up a test repo in GitLab, registered a bunch of runners, and started tackling every problem, one by one. We also set up a Docker instance to use as a baseline but monitored all its communication with GitLab Runner using socat—that way, we could see exactly what was going on and what we needed to match.
We started with an issue where the job seemed to work, but it actually wasn’t doing anything; worst of all, it wasn’t logging anything, so the guys had to fix the logs first and then go back to the main issue. With that out of the way, there was another issue with /dev entries, which was solved too. After a few days of testing, things were starting to look really good; we could run easy one-liners without much trouble. So we thought we were done, but we actually still had a little ways to go.
When we moved to longer running jobs, they were being cut in the middle due to an issue in the idle connection tracking. Fixing that led to another issue with Podman never closing, but the Podman maintainers addressed both of these issues.
Bug for bug
However, there was one issue that had been bugging us from the beginning—it caused us to have to remove the volumes before every run. The thing that nobody tells you about compatibility is that sometimes, to achieve this, you have to be bug-for-bug compatible. Docker has an issue filed over five years ago about the fact that when you ask to create a volume that already exists, it will return "all good" and act like nothing ever happened. Podman, on the other hand, was returning the correct error message (emphasis on "was" because now it acts the same way as Docker does, at least in the compat mode. Bug-for-bug, right?)
With those major issues out of the way, some minor things appeared, but everything was running smoothly, at least as far as we could test.
[ The API owner's manual: 7 best practices of effective API programs ]
Wrapping up
So, how are things now? Well, all of the issues that we ran into with Podman all now have fixes in the main branch, and if all goes well, they will be part of the upcoming release of Podman 2.2. That will mark the first Podman release that can run with GitLab Runner right out of the box, without it even knowing that it is talking to Podman. That’s a really major milestone for us.
저자 소개
Pablo is a member of the CentOS QA team and is the armhfp maintainer for CentOS releases. He mainly works with the kernel and troubleshoots unsupported architecture.
He has been working around computers his entire life, mostly programming, until life brought him to the world of small devices. He now spends his days trying to get things to work in armhfp and aarch64 SoCs. If you ask Pablo for his story, he will respond, "I was born, my parents bought me a computer, and here I am.....".
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.