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

"Unzipping Cypress" takes four minutes #3803

Closed
kevinburkenotion opened this issue Mar 22, 2019 · 19 comments · Fixed by #5851
Closed

"Unzipping Cypress" takes four minutes #3803

kevinburkenotion opened this issue Mar 22, 2019 · 19 comments · Fixed by #5851

Comments

@kevinburkenotion
Copy link

@kevinburkenotion kevinburkenotion commented Mar 22, 2019

I have a t2.xlarge instance in AWS. I am attempting to run npm install inside of a Docker container to install Cypress 3.1.5.

I noticed that 4 minutes elapse between the start of "Unzipping Cypress" and its completion.

[00:19:28]  Unzipping Cypress       [started]
[00:23:13]  Unzipping Cypress       [completed]

This seems like an awfully long time to spend unzipping a binary... any idea what is going on?

@bahmutov

This comment has been minimized.

Copy link
Contributor

@bahmutov bahmutov commented Mar 22, 2019

@kevinburkenotion

This comment has been minimized.

Copy link
Author

@kevinburkenotion kevinburkenotion commented Mar 22, 2019

It's inside of a npm install step in a Docker container, so we either get the cached image or nothing, I think, unless you have better ideas.

@kevinburkenotion

This comment has been minimized.

Copy link
Author

@kevinburkenotion kevinburkenotion commented Mar 22, 2019

Any reason why you are not using gunzip or tar or similar to unpack the binary?

@bahmutov

This comment has been minimized.

Copy link
Contributor

@bahmutov bahmutov commented Mar 22, 2019

@kevinburkenotion

This comment has been minimized.

Copy link
Author

@kevinburkenotion kevinburkenotion commented Mar 22, 2019

Understood, but 4 minute long unpacking on an AWS VM that's as powerful as a high end Macbook is not really great either.

@bahmutov

This comment has been minimized.

Copy link
Contributor

@bahmutov bahmutov commented Mar 22, 2019

@cvuorinen

This comment has been minimized.

Copy link

@cvuorinen cvuorinen commented Aug 21, 2019

Even though it does not take 4 min on my machine, after adding cypress to a project it makes switching branches just painful to always wait few minutes for downloading & unzipping cypress. Can't you cache it somewhere like other npm packages? I mean when switching branches where just one dep has changed, run npm ci and before cypress it was just few seconds since (almost) everything comes from cache, since adding cypress it's a waiting game that I try to avoid. I mean I just downloaded & unzipped the thing few minutes ago, such a waste (of bandwidth, cpu and most importantly my time).

@flotwig

This comment has been minimized.

Copy link
Member

@flotwig flotwig commented Aug 21, 2019

@cvuorinen If you're downloading the same version of Cypress, it is actually cached so it doesn't need to be downloaded multiple times. Check cypress cache for more info.

@cvuorinen

This comment has been minimized.

Copy link

@cvuorinen cvuorinen commented Aug 22, 2019

@flotwig thanks, seems things have improved. That project is not on v3.x yet. I'll look into upgrading it.

@goodliff

This comment has been minimized.

Copy link

@goodliff goodliff commented Dec 2, 2019

@cvuorinen did you manage to get this down at all?

We are waiting 3+ minutes for the extraction and as we are blowing the instance away after the build and tests we need to be able to install/ extract again once the next instance starts up. I've already been asked to remove cypress as it's the only thing taking this long in the build process. (trying to avoid that)

@flotwig

This comment has been minimized.

Copy link
Member

@flotwig flotwig commented Dec 2, 2019

@goodliff configure your CI to cache the ~/.cache/Cypress directory, you won't need to unzip it every time. More information: https://docs.cypress.io/guides/guides/continuous-integration.html#Advanced-setup


The code for unzipping is here:

const unzip = ({ zipFilePath, installDir, progress }) => {

The unzip speed could be greatly improved if code that uses the native unzip binary was added, in addition to the macOS-specific ditto code.

@flotwig

This comment has been minimized.

Copy link
Member

@flotwig flotwig commented Dec 2, 2019

Opened a PR to use the native unzip utility on Linux, which should be faster: #5851

@cypress-bot

This comment has been minimized.

Copy link

@cypress-bot cypress-bot bot commented Dec 3, 2019

The code for this is done in cypress-io/cypress#5851, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@goodliff

This comment has been minimized.

Copy link

@goodliff goodliff commented Dec 3, 2019

Nice, looking forward to seeing whether this changes anything for us. Still looking at the CI caching options, but this will help some.

@flotwig

This comment has been minimized.

Copy link
Member

@flotwig flotwig commented Dec 3, 2019

I've created a separate issue for improving the unzip time on Windows: #5861

@cypress-bot

This comment has been minimized.

Copy link

@cypress-bot cypress-bot bot commented Dec 12, 2019

Released in 3.8.0.

@mightyiam

This comment has been minimized.

Copy link

@mightyiam mightyiam commented Dec 13, 2019

Thank you!

@goodliff

This comment has been minimized.

Copy link

@goodliff goodliff commented Dec 13, 2019

Um.... "[14:09:00] Unzipping Cypress 200% -56s [title changed]"

Not entirely sure what happened here but I'm being told that cypress unzipped to 200% when building my docker image. This is with 3.8.0 which incorporated the zipping change I believe.

@mightyiam

This comment has been minimized.

Copy link

@mightyiam mightyiam commented Dec 13, 2019

@goodliff perhaps better to open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.