Giter Club home page Giter Club logo

nx-remotecache-gcs's Introduction

nx-remotecache-gcs

A task runner for Nx that uses a Google Cloud Storage bucket as a remote cache, so all team members and CI servers can share a single cache. The concept and benefits of computation caching are explained in the NX documentation.

setup

npm install --save-dev nx-remotecache-gcs

create a Google Cloud Storage bucket. Since this is only a cache, there is no need for a dual- or multi-region bucket, so choose a single location near you.

gsutil mb -p [PROJECT_ID] -l [BUCKET_LOCATION] -b on gs://[BUCKET_NAME]/

setup a lifecycle rule for your storage bucket to automatically delete old files. If you want to use our suggested auto-delete-after-30-days rule, you can simply use the json that is included:

gsutil lifecycle set node_modules/nx-remotecache-gcs/lifecycle.json gs://[BUCKET_NAME]

by default all viewers, editors and owners of your Google Cloud project can read and/or write to the bucket. You could also restrict who can read and write the bucket to only allow certain users or (build server) service accounts.

finally, add tasksRunnerOptions in your nx.json file

{
    "projects": {
        ...
    },
    "tasksRunnerOptions": {
        "default": {
            "runner": "nx-remotecache-gcs",
            "options": {
                "bucket": "gs://NAME-OF-YOUR-STORAGE-BUCKET",
                "cacheableOperations": [
                    "build",
                    "test",
                    "lint",
                    "e2e"
                ]
            }
        }
    }
}

run a build and see if files end up in your cache storage bucket:

nx run-many --target=build --all

nx-remotecache-gcs's People

Contributors

wvanderdeijl avatar dependabot[bot] avatar

Stargazers

wangxingkang avatar  avatar Alvaro Almendros Gala avatar Steven Miller avatar Manuel Reich avatar Van den Berghe Jo avatar Benjamin Rose avatar Zackary Therrien avatar André Gaul avatar Rebecca Richards avatar Furina avatar Han avatar Ricki Hastings avatar Tyler Paul Thompson avatar  avatar C. T. Lin avatar Evan Ye avatar dongyuwei avatar  avatar Zakir Nuriiev avatar Maxime avatar  avatar Dmitry Zakharov avatar Gleb Mikheev avatar Thiago Barbato avatar Minijus L avatar David Gilson avatar Paco van der Linden avatar

Watchers

James Cloos avatar Web Artisan avatar Paco van der Linden avatar Van den Berghe Jo avatar  avatar Zackary Therrien avatar

nx-remotecache-gcs's Issues

Caches restored with a different commit?

> nx run myProject:build
Compiling TypeScript files for project "myProject"...
Done compiling TypeScript files for project "myProject".
stored cache at gs://a-project/123.commit and gs://a-project/123.tar
retrieved cache from gs://a-project/456.commit and gs://a-project/456.tar

Is it normal that caches are stored with a commit but retrieved using a different commit?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.