Skip to content
Snippets Groups Projects

Introduce GCS adapter for remote cache

Merged Tomasz Maczukin requested to merge introduce-gcs-cache-support into master
1 file
+ 54
6
Compare changes
  • Side-by-side
  • Inline
@@ -476,27 +476,32 @@ in the [runners autoscale documentation](autoscale.md#distributed-runners-cachin
| Parameter | Type | Description |
|------------------|------------------|-------------|
| `Type` | string | As of now, only S3-compatible services are supported, so only `s3` can be used. |
| `Type` | string | One of: `s3`, `gcs`. |
| `Path` | string | Name of the path to prepend to the cache URL. |
| `Shared` | boolean | Enables cache sharing between runners, `false` by default. |
| `BucketName` | string | Name of the storage bucket where cache will be stored. |
Related to `S3` type only:
| Parameter | Type | Description |
|------------------|------------------|-------------|
| `ServerAddress` | string | A `host:port` to the used S3-compatible server. |
| `AccessKey` | string | The access key specified for your S3 instance. |
| `SecretKey` | string | The secret key specified for your S3 instance. |
| `BucketName` | string | Name of the bucket where cache will be stored. |
| `BucketLocation` | string | Name of S3 region. |
| `Insecure` | boolean | Set to `true` if the S3 service is available by `HTTP`. Is set to `false` by default. |
| `Path` | string | Name of the path to prepend to the cache URL. |
| `Shared` | boolean | Enables cache sharing between runners, `false` by default. |
Example:
```bash
```toml
[runners.cache]
Type = "s3"
ServerAddress = "s3.amazonaws.com"
AccessKey = "AMAZON_S3_ACCESS_KEY"
SecretKey = "AMAZON_S3_SECRET_KEY"
BucketName = "runners"
BucketLocation = "eu-west-1"
Insecure = false
BucketName = "runners-cache"
Path = "path/to/prefix"
Shared = false
```
@@ -507,6 +512,49 @@ Example:
> **Note:** If any of `ServerAddress`, `AccessKey` or `SecretKey` aren't specified then the S3 client will use the
> IAM instance profile available to the instance.
### The `[runners.cache.gcs]` section
>**Note:**
Introduced in GitLab Runner v11.2.0
Allows to configure native support for Google Cloud Storage
| Parameter | Type | Description |
|-------------------|------------------|-------------|
| `CredentialsFile` | string | Path to the Google JSON key file. Currently only `service_account` type is supported. If configured, takes precedence over `AccessID` and `PrivateKey` configured directly in `config.toml` |
| `AccessID` | string | ID of GCP Service Account used to access the storage. |
| `PrivateKey` | string | Private key used to sign GCS requests. |
Please read [Google Cloud Storage Authentication documentation](https://cloud.google.com/storage/docs/authentication#service_accounts)
to check where get these values from.
Examples:
**Credentials configured directly in `config.toml` file:**
```toml
[runners.cache]
Type = "gcs"
BucketName = "runners-cache"
Path = "path/to/prefix"
Shared = false
[runners.cache.gcs]
AccessID = "cache-access-account@test-project-123456.iam.gserviceaccount.com"
PrivateKey = "-----BEGIN PRIVATE KEY-----\nXXXXXX\n-----END PRIVATE KEY-----\n"
```
**Credentials in JSON file downloaded from GCP:**
```toml
[runners.cache]
Type = "gcs"
BucketName = "runners-cache"
Path = "path/to/prefix"
Shared = false
[runners.cache.gcs]
CredentialsFile = "/etc/gitlab-runner/service-account.json"
```
## The `[runners.kubernetes]` section
> **Note:**
Loading