Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo a local daemonized cache with turborepo #475

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
12 changes: 12 additions & 0 deletions .env.turbo
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PORT=12123
TURBO_TOKEN=example-token-for-turbo

# can also be s3
STORAGE_PROVIDER=local
STORAGE_PATH=/tmp/limber-turbo

# required of STORAGE_PROVIDER is s3
S3_ACCESS_KEY=
S3_SECRET_KEY=
S3_REGION=
S3_ENDPOINT=
5 changes: 5 additions & 0 deletions .turbo/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"teamId": "team_my-fake-but-local-team",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per the docs, the teamId must begin with team_

"apiUrl": "http://localhost:12123"
}

25 changes: 25 additions & 0 deletions launch-daemon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

# can also be ran without docker
# as the original project is written
# in typescript
# - node
# - Fastify: https://www.fastify.io/

# On my test system, I didn't feel like setting up docker
# docker run \
# --env-file=.env.turbo \
# -p 3000:13000 \
# fox1t/turborepo-remote-cache

# This runs directly from a git clone (node)
# Before running this,
# - clone the repo
# - npm install
# - npm run prebuild
# - npm run build
(\
set -a \
&& . ./.env.turbo \
&& ( cd ../turborepo-remote-cache && npm run start ) \
)
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"tests"
],
"scripts": {
"daemon": "pm2 start ./launch-daemon.sh",
"daemon:status": "pm2 ls",
"daemon:stop": "pm2 stop ./launch-daemon.sh",
"reset": "git clean -Xfd && pnpm install",
Copy link
Owner Author

@NullVoxPopuli NullVoxPopuli May 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reset, before I learned rm -rf node_modules/.cache was sufficient for testing turbo's cache

"predeploy": "turbo run build --filter=limber",
"build": "turbo run build --filter=limber^...",
"lint": "turbo run lint",
Expand All @@ -21,6 +25,7 @@
},
"devDependencies": {
"concurrently": "^7.0.0",
"pm2": "^5.2.0",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"turbo": "^1.2.5"
},
"resolutions": {
Expand Down
Loading