Gitpod: yarn: How to cache deps?

Created on 24 Jan 2020  路  3Comments  路  Source: gitpod-io/gitpod

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

question

Most helpful comment

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

All 3 comments

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

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

Solved

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mouse484 picture mouse484  路  3Comments

iksaif picture iksaif  路  3Comments

Kreyren picture Kreyren  路  3Comments

LezaiNiubi picture LezaiNiubi  路  3Comments

ColbyWTaylor picture ColbyWTaylor  路  3Comments