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

Git is missing from latest cypress/included (possibly also cypress/browsers & cypress/base) #642

Closed
oririner-wiz opened this issue Apr 12, 2022 · 16 comments

Comments

@oririner-wiz
Copy link

This is the result of locally running git --version in cypress/included:9.5.0 and cypress/included:9.5.4
cypress/included:9.5.0 reports the git version, whereas cypress/included:9.5.4 claims git is not found.
I don't know the exact version this happened in but it's only one of possible 4.

CleanShot 2022-04-12 at 23 03 58@2x

@oririner-wiz
Copy link
Author

@admah
I feel like git is a pretty essential tool to have in the image, can someone please look into it? 🙏

@wachri
Copy link

wachri commented Apr 13, 2022

We also need git in that image. In 9.5.1 it was still included.

@wachri
Copy link

wachri commented Apr 13, 2022

Hmm in the current version the -slim version is used instead of the "normal":
In 9.5.1 it was FROM cypress/browsers:node16.5.0-chrome97-ff96 and starting with 9.5.2 it gos with FROM cypress/browsers:node16.14.0-slim-chrome99-ff97

@admah
Copy link
Contributor

admah commented Apr 13, 2022

We recently updated our scripts to use slim node images for our base images (#597) . As a result of that, the images are about 40% smaller, but some packages may not be present. Everything was tested against Cypress itself so it has everything it needs to run and nothing more. You're going to need to add additional packages that you need in your CI pipeline.

@oririner-wiz
Copy link
Author

@admah Thanks for the info and context on this!

This is however, a breaking change and I wish it was communicated in a more explicit way.
Removing git (and possibly other essential tools) now means that we have to install them ourselves and the way I see it we have 2 options:

  1. Do it immediately after downloading the image but before executing cypress - this is unfortunate for CI as this can't be leveraged for caching very easily.
  2. Create our own images based on the official cypress ones - this creates a maintenance burden on us when an upgrade is needed.

Instead, I propose to have another type of image cypress/full (or a tag prefix, cypress/base:full-{version}if needed in other images) that follows the same versioning semantics as previous releases.
Granted, it would create larger images but the tradeoffs would be clear to people who download them. They can switch between types of images depending on their changing needs - if size becomes an issue, they can move to a slimmer image and add on top of that only what they need.
WDYT?

@oririner-wiz
Copy link
Author

@admah Looking at some other issues, it looks like other people have encountered this in #621 #617 #649

Can you consider the full docker image option?

@admah
Copy link
Contributor

admah commented Apr 18, 2022

@oririner-wiz I'm happy to leave this issue up for discussion around it. However, the decision to reduce the image size and the approach taken was done after much deliberation. Some of the related issues that I closed were well over a year old with plenty of comments around them. Doing what you have suggested would simply bring us back to the place that we just were. There is also the overhead to also manage an entire other set of images.

These images were never intended to be a "catch-all" that handled every CI need a user may have. They were intended to contain dependencies necessary to run Cypress. git is not currently a dependency of Cypress. As a representative of the DX team, we're more than willing to provide examples of adding custom dependencies and would encourage doing that in your CI workflow or leveraging the provided Dockerfiles to create your own images.

Some of the PRs you mentioned are related to missing dependencies that happened as a result of recent refactoring. Since we do not recreate and re-publish images, some recent images may be missing dependencies. PRs have been opened to address that (#647 and #648) and the next included image should include those as well.

@oririner-wiz
Copy link
Author

Doing what you have suggested would simply bring us back to the place that we just were.

Not exactly, previously, the default (and only) image was large. What I'm suggesting is to have 2 images, one large and one slim, where slim is the default one. For every release there would be two images published, the default one (which is smaller) and another one marked full that contains other peripheral tools that are not essential to running cypress but do help when needing to working inside that image. This would only supply an alternative for those who need more peripheral tools within this image, not going back to having only large images.

There is also the overhead to also manage an entire other set of images.

Agreed, however, glancing at the repo, there are a bunch of scripts that do most of the heavy lifting, I'm suggesting to add a small bit of code to them to support the full option.

These images were never intended to be a "catch-all" that handled every CI need a user may have.

Understood, and yet, the main use case for these images is in fact in CI, which requires some form of source control.
That's why I think that specifically git, and possibly other common source control management software should be included.

As a side note, one could argue that yarn (or npm) isn't required in order to run cypress, yet it's included in all images. My guess is because most users use one or the other (though yarn@1.x.x is in maintenance mode and people are encouraged to move to yarn2, there's also pnpm which is rather popular). But, in comparison, I believe there are more people who use this image and git as opposed to people who use this image and yarn (or npm), and it that case, git might be a more essential, non-required tool.

@bericp1
Copy link

bericp1 commented Jul 6, 2022

It definitely feels like git is an implicit dependency of cypress. The official docs make reference to collecting git information via usage of git for recording to the cypress dashboard and now this just doesn't work any more with the out of the box CI solutions like you'd expect it to.

For example we're using the official CircleCI orb (cypress-io/cypress@1.27.0) and we just upgraded to the official CircleCI docker image cypress/browsers:node14.17.6-chrome100-ff98 and now all of a sudden our git commit info disappeared from the Cypress Dashboard :/

@admah
Copy link
Contributor

admah commented Jul 6, 2022

@bericp1 this was fixed a while ago because of the reasons you mention. Sorry I didn’t close this out. Can you try a newer browser image? Thanks!

@admah admah closed this as completed Jul 6, 2022
@kylemh
Copy link

kylemh commented Jul 23, 2022

Hey @admah You mentioned trying a newer browser image, but there's a single browser image uploaded since you commented. Which PR resolved this? How far back can I look for images? I used cypress/browsers:node14.17.6-chrome100-ff98 and didn't realize this was a problem until I found this closed issue.

I can manually go and look at each Dockerfile, but the above info would help a lot!

@admah
Copy link
Contributor

admah commented Jul 23, 2022

@kylemh try cypress/browsers:node-16.14.2-slim-chrome100-ff99-edge. There are some newer images in PR status that I was waiting to merge until after we had arm images for them. Those should get out next week.

@kylemh
Copy link

kylemh commented Jul 23, 2022

I ended up doing the latest node 14 version I found with git inside the Dockerfile.

I only meant that discoverability on this issue is low and even discoverability on which images are good is low. Something that could be worth addressing somehow like - even a README mentioning which do not have git installed.

@admah
Copy link
Contributor

admah commented Jul 23, 2022

@kylemh that’s a great idea. I’ll make sure we get the affected images’ READMEs updated so that hopefully it’s a little more visible. It should just be a small number of images that were affected.

I’ll also put a list in this issue for future reference.

@anilanar
Copy link

anilanar commented Oct 9, 2022

Got here from Google and I still cannot figure out which images have git and which not. Zero links were shared here.

I tried cypress/base:18.6.0, for reference, which was apparently released 1 month ago (does docker website tell exact dates instead of relative dates?) which is many months later than last chatter in this thread.

@anilanar
Copy link

anilanar commented Oct 9, 2022

So cypress/base is still missing git. Use cypress/browsers instead.

cypress/included doesn't have node version specific tags so didn't even try it.

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

6 participants