[go: up one dir, main page]

Migrating sccache from Local Storage to GCP Cloud Storage

This MR transitions the Tezos CI infrastructure from using local filesystem-based sccache storage to Google Cloud Storage (GCS) for distributed compilation caching. This change enables shared caching across CI runners, significantly improving build performance and reducing redundant compilation work.

Before reviewing this MR the you can familiarize yourself with

Also the reviewer should have a clear understanding on the rust-* docker images and where / how are used.

Key Changes in the MR:

1. CI Pipeline Configuration Updates (40+ files changed):

  • Removed local sccache cache configuration: All GitLab CI pipeline files have been updated to remove the local filesystem cache entries:

    # REMOVED:
    - key: sccache-$CI_JOB_NAME_SLUG
      paths:
      - $CI_PROJECT_DIR/_sccache
      policy: pull-push
  • Added GCS configuration: Replaced with GCS bucket configuration using environment variables:

    SCCACHE_GCS_BUCKET: $GCP_LINUX_PACKAGES_BUCKET
    SCCACHE_GCS_RW_MODE: READ_WRITE
    SCCACHE_GCS_KEY_PREFIX: sccache
    SCCACHE_IGNORE_SERVER_IO_ERROR: "1"

Benefits of This Change:

  1. Shared Cache: Multiple CI runners can now share the same compilation cache stored in GCS
  2. Persistent Cache: Cache persists beyond individual runner lifecycles

Configuration Details:

  • Uses $GCP_LINUX_PACKAGES_BUCKET as the centralized storage location
  • Implements cache busting with $CI_JOB_NAME_SLUG to prevent cache pollution
  • Includes SCCACHE_IGNORE_SERVER_IO_ERROR for resilience against transient network issues
  • The precise path of the cache is tezos-linux-repo/sccache. You can have a look at it on the GCP UI.

Testing

Check these lines in the logs:

$ . ./scripts/ci/sccache-start.sh
sccache: Starting the server...
$ sccache --show-stats | grep "Cache location"
Cache location                  gcs, name: tezos-linux-repo, prefix: /sccache/

there is a some variability considering the same job and different hit rates for the sccache.

Edited by pietro

Merge request reports

Loading