npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

turbo-remote-cache-rs

v0.3.4

Published

A remote cache for turbo

Downloads

5

Readme

turbo-repo-remote-cache-rs

Fast turbo remote cache server written in Rust.

if you are using turbo and you want to have a self-hosted remote cache server this is for you.

  1. It is fast ⚡️.
  2. It supports multiple object storage providers (S3, GCP, Azure, and file).

Installation

  • Using Cargo (Linux/macOS/Windows)
cargo install turbo-remote-cache-rs
  • Using Npm (Linux/macOS/Windows)
npm install -g turbo-remote-cache-rs

Usage

  1. Copy .env.example to same directory as the binary and rename it to .env.
  2. Edit .env file to your needs (TURBO_TOKENS, BUCKET_NAME are required) please refer to .env.example for more information about required vars for each cloud storage provider.
  3. Run the binary.
  turbo-repo-remote-cache-rs
  1. Provide the url to turbo cli
turbo build --api="http://localhost:4000" --token=<token> --team=<team>

you can also set teamId and apiUrl .turbo/config.json in the root of your project.

  1. Enjoy your self-hosted remote cache and faster builds 🚀.

Docker

  1. Create a docker file.
FROM salamaashoush/turbo-remote-cache-rs
ENV PORT=4000
ENV FS_PATH=/tmp
ENV BUCKET_NAME=cache
ENV TURBO_TOKENS="token1,token2,token3"
EXPOSE 4000
CMD ["turbo-remote-cache-rs"]
  1. Build the image.
docker build -t your-image .
  1. Run the image.
docker run -p 4000:4000 -v ./cache:/tmp/cache your-image
  1. Provide the URL to turbo cli
turbo build --api="http://localhost:4000" --token=<token> --team=<team>

you can also set teamId and apiUrl .turbo/config.json in the root of your project.

Kubernetes

See example in examples/k8s, Don't forget to change the spec and env vars for your needs before applying it (NOTE that it is just an example and it is not production ready).

Environment Variables

Required

| Name | Description | Default | | ------------------ | -------------------------------------------------------------------------- | ---------- | | TURBO_TOKENS | Comma separated list of turbo tokens that are allowed to access the cache. | "" | | BUCKET_NAME | Name of the bucket to store the cache in. | "cache" | | STORAGE_PROVIDER | Storage provider to use. s3, azure, gcs, file or memory | "memory" |

File Storage Provider

| Name | Description | Default | | --------- | --------------------------- | ----------- | | FS_PATH | Path to store the cache in. | os temp dir |

S3 Storage Provider

| Name | Description | Default | | ---------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------- | | AWS_ACCESS_KEY_ID | AWS access key id. | "" | | AWS_SECRET_ACCESS_KEY | AWS secret access key. | "" | | AWS_DEFAULT_REGION | AWS region. | "" | | AWS_ENDPOINT | AWS endpoint. | "" | | AWS_SESSION_TOKEN | AWS session token | "" | | AWS_CONTAINER_CREDENTIALS_RELATIVE_URI | AWS bucket endpoint. | "" | | AWS_ALLOW_HTTP | set to “true” to permit HTTP connections without TLS. | false | | AWS_PROFILE | set profile name, requires aws_profile feature enabled | "" |

Azure Storage Provider

| Name | Description | Default | | ----------------------------- | ------------------------------------------------- | ------- | | AZURE_STORAGE_ACCOUNT_NAME | storage account name. | "" | | AZURE_STORAGE_ACCOUNT_KEY | storage account master key | "" | | AZURE_STORAGE_ACCESS_KEY | alias for AZURE_STORAGE_ACCOUNT_KEY | "" | | AZURE_STORAGE_CLIENT_ID | client id for service principal authorization | "" | | AZURE_STORAGE_CLIENT_SECRET | client secret for service principal authorization | "" | | AZURE_STORAGE_TENANT_ID | tenant id used in oauth flows | "" |

GCS Storage Provider

| Name | Description | Default | | ----------------------------- | ---------------------------------------- | ------- | | GOOGLE_SERVICE_ACCOUNT | location of service account file | "" | | GOOGLE_SERVICE_ACCOUNT_PATH | (alias) location of service account file | "" | | SERVICE_ACCOUNT | (alias) location of service account file | "" | | GOOGLE_SERVICE_ACCOUNT_KEY | JSON serialized service account key | "" | | GOOGLE_BUCKET | bucket name | "" | | GOOGLE_BUCKET_NAME | (alias) bucket name | "" |

Todo

  • [ ] Support turbo headers x-artifact-duration, x-artifact-tag, x-artifact-client-ci and x-artifact-client-interactive right now those are ignored and they don't affect the cache.
  • [ ] Add nx cloud support.
  • [ ] Add more advanced authentication support.
  • [ ] Maybe having a dashboard to manage teams and projects would be nice.