Gitlab Runner Cache using Linode Object Storage

Linode offers 250 GB of object storage for $5 a month. Using this creates a cache for use in Gitlab Runner. This allows proper access to a cache when running your own runners.

Setup Linode Object Storage

First need to set up your Linode Object Storage. Using this setup, the base $5/month price, and you get 250 GB of storage.

Setup Linode Object Storage Bucket

Make a bucket for the cache.

Ex. my-gitlab-runner-cache

Setup Access keys for Linode Object Storage

Setup limited access keys for your object storage.

Setup Gitlab Runner

Setup Gitlab runner where you want to run the jobs.

Configure runner.cache

For Gitlab runner, you need to configure the cache type. Set it to s3 (Linode Object Storage is S3 compatible).

Type = s3

Configure runner.cache.s3 to use Linode Object Storage

	ServerAddress = ""
	AccessKey = "LINO**************"
	SecretKey = "SECR*********************************"
	BucketName = "gitlab-runner-cache"
	BucketLocation = "us-east-1"

All Together


  name = "MyRunner"
  url = ""
  token = "*******************"
  executor = "docker"
    Type = "s3"
			ServerAddress = ""
			AccessKey = "LINO**************"
			SecretKey = "SECR*********************************"
			BucketName = "my-gitlab-runner-cache"
			BucketLocation = "us-east-1"

    tls_verify = false
    image = "alpine:latest"
    privileged = false
    disable_entrypoint_overwrite = false
    disable_cache = false

Register Gitlab Runner

Start Gitlab Runner

sudo systemctl start gitlab-runner

If you want to start on boot you can use enable.

sudo systemctl enable gitlab-runner


Should end up something like this.

Restoring cache
Checking cache for my-cache-1...
FATAL: file does not exist                         
Failed to extract cache
Saving cache for successful job
Creating cache my-cache-1...
Uploading to https://******/project/***/my-cache-1 
Created cache


If you see 403, your access keys are not working.

If you see 404, it means it is missing (but should create it properly).

Use log_level = "debug" in gitlab-runner/config.toml to see more info on what’s happening.