Skip to content

kj455/Turborepo-remote-cache-on-google-cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turborepo remote cache on Google Cloud

This repository provides a streamlined process for setting up and managing a self-hosted Turborepo remote cache on Google Cloud, utilizing the ducktors/turborepo-remote-cache project.

architecture

🚀 Getting Started

Prerequisites

  1. Clone this repository
  2. Ensure Terraform is set up and the "Resource Manager API" is enabled on Google Cloud
  3. Create service accounts with the following roles:
    • Editor (or roles with sufficient permissions to create necessary resources)
    • Secret Manager Admin
    • Security Admin
  4. Download the private key (in JSON format) of the service account and place it in the root of this repository as "credentials.json"

Setup and Deployment

  1. Authenticate the gcloud CLI:

    gcloud auth login --cred-file=./credentials.json
  2. Prepare your Terraform variables:

    cp terraform.tfvars.example terraform.tfvars
    # Edit the copied file (terraform.tfvars) with your details
  3. Initialize and apply your Terraform configuration:

    cd terraform
    terraform init
    terraform plan
    terraform apply
  4. Pull the fox1t/turborepo-remote-cache image from Docker Hub and push it to your Artifact Registry:

    Click here for detailed instructions
    # only amd64 image works
    docker pull fox1t/turborepo-remote-cache:(tag)@(digest-of-amd64-image)
    
    docker tag fox1t/turborepo-remote-cache:(tag)@(digest-of-amd64-image) (artifact-registry-repository-location)/turborepo-remote-cache:(tag)
    
    docker push (artifact-registry-repository-location)/turborepo-remote-cache:(tag)
  5. Now your remote cache server is set up and ready to use! 🚀

    turbo run ${command} \
    --api=${cloud run url} \
    --team=${your team name} \
    --token=${turbo_token in terraform.tfvars}

Note: If you push another image into the Artifact Registry, a new revision will be created automatically.

Enjoy your self-hosted Turborepo remote cache!

Any feature requests or pull requests are welcome!

About

Easy self-hosting and management Turborepo remote cache on Google Cloud.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published