GitLab CI Runner artifacts size error: “too large archive”

As part of putting together a GitLab CI pipeline to build a Python deployment for an AWS Lambda, I ran into an issue with the size of the build dir that I’m zipping up ready for deployment:

Uploading artifacts...
./build: found 2543 matching files 
ERROR: Uploading artifacts to coordinator... too large archive id=181 responseStatus=413 Request Entity Too Large status=413 Request Entity Too Large token=rtRUzgtp
FATAL: Too large

Hmm. Ok. A quick search found this post which says there’s a setting to increase the max build artifact size – it’s under /admin/application_settings, in the Continuous Integration setting – looks like the default is 100MB, so let’s bump that up and try again:

Setting up a new shared GitLab runner

Assuming you already have a runner installed (follow steps here).

Navigate to the [your-gitlab]/admin/runners page and scroll down to “How to setup a shared Runner for a new project” section – copy the server url and registration token for the next section.

On the machine where you want to the runner to execute, run

sudo gitlab-runner register

when prompted, enter the url and token.

For info on available executors see here.

Changing a GitLab Runner from ‘Locked to a Project’ to Shared

I have a GitLab Runner assigned to a project that I’d like to share with another similar project. Currently it looks like this:

Pressing the small edit icon, I can see these options:

I want to reuse this same runner, so I unchecked the ‘Lock to current projects’ checkbox.

Now if I go to the CI/CD settings for my other project I can see it is available, so I click ‘enable for this project’

Now my Pending Job that was triggered after my first push to my repo has kicked in and is being deployed to my test Docker server. Cool.

Assigning GitLab runners to a project

Following on from this post, Runners are added per project (unless they are shared). If you’re configuring a new project and haven’t created a new runner and assigned it to your  project, you’ll see this:

Add a new runner per the steps in the previous article.