Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Perl images for GitLab CI

by kcott (Archbishop)
on May 05, 2022 at 04:18 UTC ( [id://11143583]=perlquestion: print w/replies, xml ) Need Help??

kcott has asked for the wisdom of the Perl Monks concerning the following question:

G'day All,

I have been tasked with investigating using GitLab CI/CD for our $work Perl modules. I am trying to locate documentation, or other information, on image: perl:5.???.

I started my search from "GitLab CI Pipeline for Perl DBD::Mock using Module::Build" (by Gábor Szabó). Then, via a few links, I found "DBD::Mock: .gitlab-ci.yml". This shows image: perl:5.X-threaded (where X is all even values from 8 to 30) and an image: perl:latest.

From "Gitlab Perl CI and CD Pipeline", again via a few links, I found "Perl - Official Image|Docker Hub". This page has an "Image Variants" section which explains the extension tags (e.g. -threaded) which was useful. However, it only lists Perl versions 5.30, 5.32 & 5.34 (and some without specific versions, e.g. latest).

At $work, we code to a minimum 5.16 version. I'd probably want image: perl:5.X (X=16..34) and image: perl:latest. It seems that there are only a limited number of official images. I don't want to just write image: perl:5.16, cross my fingers, and hope for the best (cargo-cult fashion). I would like to find out more: what's valid; do I need to download them; do I need to create them myself. So, any information on that would be greatly appreciated.

I have also looked in "GitLab CI/CD" and "Super Search". I didn't find anything useful; however, it's not impossible that I overlooked something in these.

— Ken

Replies are listed 'Best First'.
Re: Perl images for GitLab CI
by haukex (Archbishop) on May 05, 2022 at 08:11 UTC
    "Perl - Official Image|Docker Hub"

    On that page, if you go to the tab "Tags", you'll see Perl builds all the way down to 5.8. This is also confirmed if you go to the GitHub repo from which these "official" images are built. I haven’t tried the GitLab CI so unfortunately I can't say anything about that.

      G'day haukex,

      ++ Many thanks. That ("Tags") seems to be exactly what I was looking for. I had a quick scout around and searched for a handful, e.g. 5.16: all there.

      I had looked at that "Tags" tab earlier today. As I scrolled down, I just saw tags like "threaded", "slim", etc. — which I'd already found elsewhere, so I stopped looking. A few more turns of the mousewheel and I would've started to see tags starting with version numbers; a little more perseverance would found links to many more pages: [1] [2] [3] ...

      Moral of the story: "When you've been searching for stuff for many hours without a break, take a break."

      — Ken

Re: Perl images for GitLab CI
by VinsWorldcom (Prior) on May 05, 2022 at 11:06 UTC

    Ken,

    What I've been doing is a `docker pull ...` of the image I want to CI/CD with and then manually running a Docker container from it `docker run ...` and then basically stepping through the steps I'd put in my .gitlab-ci.yml file. This way I can catch any missing dependencies, any download certificate issues from my $work proxy, any packages / modules I "assume" are in the build but aren't and need to be `cpan install ...` ...

    When I'm happy with that, then I create my .gitlab-ci.yml from my build notes and cross fingers it works the same! Most of the time it does. Note if you're going to do this for perl:5.16, perl:5.18, etc... I'd redo the steps for each just to make sure and then create a multi-step .gitlab-ci.yml that'll test them all.

    Hope that helps!

    Cheers.

      G'day VinsWorldcom,

      ++ That's very interesting.

      I haven't done this previously and, from the first few links I posted in the OP, it seemed like creating .gitlab-ci.yml first was the way to go. I'd planned to deal with the container aspects later. Perhaps I'm approaching this from the wrong end.

      Yes, I had planned on multiple steps as in the "DBD::Mock: .gitlab-ci.yml" (mentioned in the OP).

      As those steps are all going to be identical, except for the image: parts, it would be preferable if that could be put in a loop; along the lines of:

      for my $tag (qw{5.16 5.18 ... 5.32 5.34 latest}) { ... image: perl:$tag ... }

      I'll look for some way to do that; if not, then it's the WET (non-DRY) approach.

      — Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11143583]
Approved by Discipulus
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-26 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found