-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add dependency caching to reduce build time #1973
base: reduce-docker-buildtime
Are you sure you want to change the base?
Conversation
I was able to get the frontend to cache & build. The backend is a whole other thing. @repo/backend:build: ../node_modules/@types/react/ts5.0/index.d.ts:4131:19 - error TS2320: Interface 'IntrinsicAttributes' cannot simultaneously extend types 'Attributes' and 'Attributes'.
@repo/backend:build: Named property 'key' of types 'Attributes' and 'Attributes' are not identical.
@repo/backend:build:
@repo/backend:build: 4131 interface IntrinsicAttributes extends React.Attributes {}
@repo/backend:build: ~~~~~~~~~~~~~~~~~~~
@repo/backend:build:
@repo/backend:build: ../node_modules/@types/react/ts5.0/index.d.ts:4132:19 - error TS2320: Interface 'IntrinsicClassAttributes<T>' cannot simultaneously extend types 'ClassAttributes<T>' and 'ClassAttributes<T>'.
@repo/backend:build: Named property 'key' of types 'ClassAttributes<T>' and 'ClassAttributes<T>' are not identical.
@repo/backend:build:
@repo/backend:build: 4132 interface IntrinsicClassAttributes<T> extends React.ClassAttributes<T> {}
@repo/backend:build: ~~~~~~~~~~~~~~~~~~~~~~~~
@repo/backend:build:
@repo/backend:build: ../node_modules/umzug/lib/umzug.d.ts:9:45 - error TS2315: Type 'ErrorWithCause' is not generic.
@repo/backend:build:
@repo/backend:build: 9 export declare class MigrationError extends errorCause.ErrorWithCause<unknown> {
@repo/backend:build: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@repo/backend:build:
@repo/backend:build:
@repo/backend:build: Found 189 errors in 6 files.
@repo/backend:build:
@repo/backend:build: Errors Files
@repo/backend:build: 2 src/lib/cache.ts:40
@repo/backend:build: 2 src/routes/admin/redis.ts:36
@repo/backend:build: 2 tests/utils/dbUtils.ts:60
@repo/backend:build: 176 ../node_modules/@types/react-dom/node_modules/@types/react/index.d.ts:3139
@repo/backend:build: 6 ../node_modules/@types/react/ts5.0/index.d.ts:4112
@repo/backend:build: 1 ../node_modules/umzug/lib/umzug.d.ts:9
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@repo/backend:build: ERROR: command finished with error: command (/Users/patrickdeutsch/repos/Head-Start-TTADP/backend) /opt/homebrew/bin/yarn run build exited (2)
@repo/backend#build: command (/Users/patrickdeutsch/repos/Head-Start-TTADP/backend) /opt/homebrew/bin/yarn run build exited (2)
Tasks: 1 successful, 2 total
Cached: 1 cached, 2 total
Time: 18.231s
Failed: @repo/backend#build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=> => # warning Workspaces can only be enabled in private projects.
LOLz. Yarn says its broken and this warning will pop up but to ignore it
yarnpkg/yarn#8580 (comment)
Struggling with dependency resolution with a monorepo, turbo & the backend. Straight docker caching can build & serve no issues. But there is a significant mismatch in installed dependencies 🤷 Which is what I suspect causes the issues for trying to do the backend caching. https://github.com/GoogleContainerTools/container-diff
|
Basically stuck with this error 🤷
|
First thought is that this appears to me like the kind of error you get when the bindings for your npm packages install doesn't match the bindings for your system... Could be wrong, but I don't think the |
Description of change
Should something like turbo build be used to cache packages for dev & ci/cd systems?
Has CircleCI integration 👍
The major benefits to this approach would be there would be a shared remote build cache of packages developers and CI can leverage cutting a lengthy node build install process down to a second or two.
(Caching Tasks)[https://turbo.build/repo/docs/core-concepts/caching] 👍
Every JavaScript or TypeScript codebase will need to run package.json scripts, like build, test and lint. Using Turborepo, we call these tasks. Turborepo can cache the results and logs of your tasks - leading to enormous speedups for slow tasks.
Since Turborepo only caches to the local filesystem by default, the same task (turbo run build) must be re-executed on each machine (by you, by your teammates, by your CI, by your PaaS, etc.) even when all of the task inputs are identical — which wastes time and resources. By working with providers like Vercel, Turborepo can securely communicate with a remote cache - a cloud server that stores the results of your tasks.
This can save enormous amounts of time by preventing duplicated work across the organization.
How to test
Issue(s)
Checklists
Every PR
Before merge to main
Production Deploy
After merge/deploy