podman-gitlab-runner icon indicating copy to clipboard operation
podman-gitlab-runner copied to clipboard

Add support for services via CI_JOB_SERVICES

Open jonasbb opened this issue 5 years ago • 5 comments

Relevant issues for Gitlab

  • https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4358
  • https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/1827

jonasbb avatar Nov 11 '20 10:11 jonasbb

Hey, I was about to build a podman executor for GitLab, glad I found this, I wasn't able to understand what the CI_JOB_SERVICES does could you explain it I'm confused. I'm guessing it's the services option in the YAML file right?

Also, I don't mind helping for anything else too, let me know cause I recently tried to replace docker 1:1 with podman and I got it to work. I've written about it here. https://dev.to/afrocoder/deploying-a-simple-portfolio-with-argo-tunnels-and-containers-for-fun-part-2-2n8l

I will try to run this directly and see if I can find any issues.

afro-coder avatar Oct 12 '21 06:10 afro-coder

Hi @afro-coder, the links above should have examples of what the CI_JOB_SERVICES variable contains when being used. It should contain the information from the services key in the CI config.

jonasbb avatar Oct 12 '21 07:10 jonasbb

Hey @jonasbb is this what this variable is? Seems like Gitlab already exports this $CUSTOM_ENV_CI_JOB_SERVICES https://docs.gitlab.com/runner/executors/custom.html#services

Do we have to pass these to podman to run the containers before we do the image build?

So docker does this by the --link option I'm assuming? Since podman has pods do we launch these services in a pod? I've never worked on such a thing before so I'm quite confused

afro-coder avatar Oct 12 '21 08:10 afro-coder

Seems like Gitlab already exports this $CUSTOM_ENV_CI_JOB_SERVICES docs.gitlab.com/runner/executors/custom.html#services

Yes, that is the same variable. GitLab supports it already, that is what the merge request in the first comment is about.

I have no idea how to implement this. I guess you need to start some more containers, connect them via some network, and tear them down in the opposite order. I am not using services myself, so this is not much of a priority for me.

jonasbb avatar Oct 12 '21 09:10 jonasbb

Yeah, same even I haven't used services. let me see if I can get some examples if I get time I'll work on it

afro-coder avatar Oct 12 '21 09:10 afro-coder