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

Pre-cache cypress binaries #41

Closed
kuceb opened this issue Apr 14, 2018 · 10 comments
Closed

Pre-cache cypress binaries #41

kuceb opened this issue Apr 14, 2018 · 10 comments

Comments

@kuceb
Copy link
Contributor

kuceb commented Apr 14, 2018

I imagine we would maintain multiple images, one for each Cypress release, so only one Cypress binary per image.

@bahmutov
Copy link
Contributor

bahmutov commented Apr 14, 2018 via email

@brian-mann
Copy link
Member

I'm thinking we would actually cache the last N number of releases.

@ianwalter
Copy link

So now that the above linked feature has been added to Cypress maybe a quick win would be to just add npm install -g cypress to the Dockerfiles so that the latest Cypress binary is baked in to the images?

@kuceb
Copy link
Contributor Author

kuceb commented Jun 27, 2018

@ianwalter that would have devastating effects since users have a package.json with a specific Cypress module version that is not compatible with the latest binary version

@ianwalter
Copy link

How so? It would simply cache the latest binary, and if the user is using the latest version, it will use that binary, if they are not, Cypress will download the other version since it's not cached right? If you cache a bunch of versions then you have to worry about the image size being a bit bloated and updating all of the Dockerfiles every time there is a new release. So I was just proposing a quick and easy solution that would benefit some users and not really affect other users because it would continue to function in the same way as it does now. Admittedly my team uses the latest version of Cypress though.

@kuceb
Copy link
Contributor Author

kuceb commented Jun 27, 2018

@ianwalter as soon as a project falls behind on a Cypress version, the build process would have to go out and download the large binary on every build, in addition to the next version of the binary unnecessarily. Without a project even knowing, their builds would become a lot slower, if not break if they are caching node_modules and not executing the postInstall script before cypress run

@ianwalter
Copy link

No, I think you're misunderstanding what I'm saying, if users aren't using the latest, they don't have to download 2 binaries as you are suggesting, they would only have to download their version (same way it works now) or 0 binaries if they are using the latest since the feature above should detect its presence. The latest binary would be built into the image so once you pull that image you don't have to download it again (and it's faster since you don't have to unzip, compile, etc). So this shouldn't slow down builds at all or break anything.

@kuceb
Copy link
Contributor Author

kuceb commented Jun 27, 2018

@ianwalter if users are relying on the docker image to include the binary, they require no caching of the binary at all on their end. Cool.
But if they fall behind the cypress version, their builds are not configured to cache this binary- so this download will happen every time.

@ianwalter
Copy link

You know what, it's not important :) Either long term solution, creating an image tag per version or installing the last N versions into the image, works for me. Thanks.

@bahmutov
Copy link
Contributor

I think this is not worth doing. Because you still need to install other NPM dependencies, and you still would like to cache them, thus caching Cypress binary (as described here https://docs.cypress.io/guides/guides/continuous-integration.html#Caching-the-Cypress-Binary). CIs do a really good job caching folders, for example https://circleci.com/gh/cypress-io/cypress-example-recipes/6999 restores cached modules in 11 seconds and installs NPM modules in 12 seconds

screen shot 2018-06-28 at 8 32 39 am

So I

  • don't see any performance gain from including Cypress binary in the docker image
  • might cause version clash
  • a lot of extra things to do and support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants