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

yarn: How to cache deps? #1138

Closed
Kreyren opened this issue Jan 23, 2020 · 3 comments
Closed

yarn: How to cache deps? #1138

Kreyren opened this issue Jan 23, 2020 · 3 comments
Labels
type: question reporter has a general question

Comments

@Kreyren
Copy link

Kreyren commented Jan 23, 2020

I have this repo https://gitpod.io/#https://github.com/Kreyren/codesandbox-client/tree/rustlang_init which requires following commands yarn, yarn build, yarn start to have workable environment.

The issue is that this takes forever to finish -> How should i cache this in gitpod.Dockerfile assuming that /workspace is removed after the docker build and that these deps seems to be stored directly on the repository?

Using tasks in .gitpod.yml is not an option since it takes same amount of time on startup and does not cache the result

@Kreyren Kreyren changed the title How to cache yarn? yarn: How to cache deps? Jan 23, 2020
@JesterOrNot JesterOrNot added the type: question reporter has a general question label Jan 27, 2020
@svenefftinge
Copy link
Member

You should enable prebuilds on your projects. This would not cache it in the docker image, but as part of the /workspace.

@IstoraMandiri
Copy link

IstoraMandiri commented Apr 1, 2020

EDIT: This is somewhat mitigated in gatsby by using npm run build in the prebuild (duh!):

tasks:
  - init: npm install && npm run build
    command: npm start

@svenefftinge I have enabled prebuilds, but when opening the workspace, it will always re-run the npm run develop step without caching between builds, which is taking a long time. Is there a way to run npm run develop automatically as part of the prebuild and cache specific folders between builds?

Specifically, for gatsby projects, it will speed up builds significantly (and reduce load on gitpod) if we are able to specify folders to cache between updates; public and .cache. Otherwise, each commit will require the workspace to reprocess all of the thumbnail images (which can take a very long time with limited resrouces).

Here is a my config https://github.com/ethereumclassic/ethereumclassic.github.io/blob/develop/.gitpod.yml

@Kreyren
Copy link
Author

Kreyren commented May 31, 2020

Solved

@Kreyren Kreyren closed this as completed May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question reporter has a general question
Projects
None yet
Development

No branches or pull requests

4 participants