Turborepo remote caching#
This page provides detailed information about the Turborepo remote cache authentication system used in the Squareone monorepo. For setup instructions, see the Turborepo remote caching section of the Setting up a development environment guide.
Overview#
The Squareone monorepo uses a custom Turborepo cache server at https://roundtable.lsst.cloud/turborepo-cache to provide remote caching for faster builds.
The cache server is deployed on Roundtable and uses Gafaelfawr for authentication.
A wrapper script (scripts/turbo-wrapper.js) intelligently detects and uses available authentication methods, allowing the monorepo to support multiple workflows:
External contributors: No authentication needed, uses local cache only
CI/CD with injected secrets: Environment variables (
TURBO_API,TURBO_TOKEN,TURBO_TEAM) pre-set in environmentMaintainers with 1Password: Secure credential management via 1Password CLI
Maintainers or environments without 1Password: Plain
.envfile support
All pnpm scripts that use Turborepo (pnpm build, pnpm dev, pnpm test, etc.) automatically use the wrapper script, so authentication is transparent once configured.
Authentication priority#
The wrapper script checks for authentication in this order:
Environment variables (
TURBO_API,TURBO_TOKEN, andTURBO_TEAMall set in environment)1Password (
.env.opfile present +opCLI available)Plain .env file (
.envfile present)No authentication (fallback to local cache only)
This priority order ensures that:
CI/CD pipelines with secret injection work automatically without configuration files
Maintainers with 1Password get secure credential management
Other users can still access the remote cache via
.envfilesExternal contributors can work offline without any setup
Verifying remote cache#
When running Turborepo commands, you’ll see a message indicating which authentication method is active:
✅
🔑 Using environment variables for Turborepo remote cache authentication- Pre-set environment variables active✅
🔐 Using 1Password for Turborepo remote cache authentication- 1Password method active✅
🔑 Using .env for Turborepo remote cache authentication- Plain .env file method activeℹ️
ℹ️ Running Turborepo without remote cache (local cache only)- No authentication, local cache only
You can also verify remote cache hits in the Turborepo output. Look for messages like:
>>> FULL TURBO
>>> Remote caching enabled
And cache hit indicators for individual packages.
Obtaining access tokens#
To get a personal access token for the remote cache:
Log in with your credentials
Navigate to the token management page
Create a new token with the
write:git-lfsscopeStore it securely in 1Password or your
.envfile (never commit it to Git)
The token is a Gafaelfawr user access token that authorizes access to the Turborepo cache server.
Security notes#
Never commit .env or .env.op files - they are in
.gitignoreUse
.env.exampleand.env.op.exampleas templates1Password method is preferred for personal machines (unencrypted credentials never touch disk)
Plain
.envmethod is suitable for environments without the 1Password CLIExternal contributors can work effectively without any remote cache access
Troubleshooting#
1Password CLI not available#
If you see this warning but have 1Password installed:
# Verify installation
op --version
# If not installed
brew install 1password-cli
# Sign in
op signin lsstit.1password.com
Remote cache not working#
Verify your credentials are correct
Check network connectivity to https://roundtable.lsst.cloud
Ensure your token hasn’t expired
Try running with
TURBO_LOG_LEVEL=debugfor more information:TURBO_LOG_LEVEL=debug pnpm build
Want to temporarily disable remote cache#
Remove or rename .env or .env.op files, or run turbo directly:
npx turbo build # Bypasses wrapper, uses local cache only
You can also use the build:local script:
pnpm build:local # Uses local cache only
Infrastructure#
The Turborepo cache server is deployed as part of the Rubin Science Platform infrastructure. For more information about the cache server deployment, configuration, and operations, see the Phalanx turborepo-cache application documentation.
The cache server uses:
lsst-sqre/turborepo-cache-proxy as a proxy to exchange the Gafaelfawr token for the cache server’s internal authentication
ducktors/turborepo-remote-cache as the actual cache server implementation
Google Cloud Storage as the backend storage for cached artifacts