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

Pieces of multiplatform support #696

Closed
wants to merge 6 commits into from

Conversation

jsoref
Copy link

@jsoref jsoref commented Jul 1, 2022

#431 asks for arm64 images

This is a draft of some changes that would go part of the way.

Admittedly, if the browsers are missing arm builds, then the images would fail...

I've left the commits as distinct layers.

I believe that one could pull in all 3 of the contributing changes w/o issue and probably the base w/o issue. It's likely that things wouldn't work so well at the browser step.

#695 asks for arm64 images as well. It seems like the simplest approach would be to try to install chrome and fall back to installing chromium. On debian that should work. For Firefox, the canonical repositories (for ubuntu) include an official firefox, and on debian there's a firefox-esr, so a bit of ||s should allow one to get one or the other.

It doesn't appear that there's any easy fix for edge today as there don't appear to be packages floating around.

The content of tagging the latest image has three actors:

* cypress-io (we) -- an entity that builds images
* consumers (formerly: you) -- an entity that uses images
* tagger (implicit you) -- an entity that is responsible for making new tags for images
* add article
* add subject
* add `:` before blob
Previously in order to create a tag, the actor had to download the image,
tag it locally, and then upload the new image.

Instead, introduce a way to create psuedo-tags for simple images that
obviates the requirement to download images.

Here we create a manifest containing a reference to the currently tagged image(s).
Default to building linux/amd64 and linux/arm64
Default to building linux/amd64 and linux/arm64
Default to building linux/amd64 and linux/arm64
@CLAassistant
Copy link

CLAassistant commented Jul 1, 2022

CLA assistant check
All committers have signed the CLA.

@rnunezil
Copy link

@jsoref, thank you for your pull request. I built a dockerfile from your generate-included-image.js on my Mac M1. Then I attempted to create an image from the dockerfile but I get the following error messages:
multiarch error: failed to find instance "buildx-multiarch": open /Users/<username>/.docker/buildx/instances/buildx-multiarch: no such file or directory buildx-multiarch Building cypress/included:10.3.0 .... code downloading and extracting .... => CANCELED [linux/arm64 2/2] RUN echo "whoami: $(whoami)" && npm config -g set user $(whoami) && id && npm install -g "cypress@10.3.0" && cypress ver 67.6s => ERROR [linux/amd64 2/2] RUN echo "whoami: $(whoami)" && npm config -g set user $(whoami) && id && npm install -g "cypress@10.3.0" && cypress verify 67.4s
Does it need to create the buildx-multiarch instance in previous lines?

@jsoref
Copy link
Author

jsoref commented Jul 11, 2022

There's a line:

docker context create multiarch 2> /dev/null || true

which should have created the instance... (you might want to get rid of the redirection to see if something exploded).

I'm using Rancher Desktop fwiw...

Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jsoref! Thanks for opening this PR, it looks like it sets a good foundation.

I was actually also working on this over the last couple weeks, and have a PR at #700 that adds a little more, like building+testing in CI and console warnings for the images that are missing browsers on arm64.

You're correct in that we will be missing browser binaries for now due to #695

We explored installing chromium instead of chrome as a fallback, but ended up not going that direction because users would have to type --browser chromium on M1, and --browser chrome everywhere else. It's difficult to grok and document, but "arm64 images don't have any browsers, use --browser electron" is a lot easier to explain, so we're going that direction.

Closing since #700 will cover the majority of this functionality - again, thank you for spending the time looking in to this issue.

}

unless (which('manifest-tool')) {
print STDERR "Please install manifest-tool <https://github.com/estesp/manifest-tool>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 hadn't seen this, I've only been messing with docker buildx and docker manifest, both of which have... limitations... I might pull this in after #700 to make it easier for us to add arm64 builds to existing tags.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm told one of these:

... might be a bit cleaner. But either way, downloading to just add a tag is silly (and potentially expensive use of bandwidth).

Copy link

@rnunezil rnunezil Jul 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsoref I noticed you removed the branch but I wanted to update you on what happened to my progress. I did remove the redirection and I then got passed that but then got the infamous qemu error that a lot of folks are getting with arm. Are you running your images on a Mac M1 or what machine are you using?

#0 64.71 [STARTED] Task without title.
#0 73.72 [FAILED] Cypress failed to start.
#0 73.72 [FAILED] 
#0 73.72 [FAILED] This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies
#0 73.72 [FAILED] 
#0 73.72 [FAILED] Please refer to the error below for more details.
#0 73.72 [FAILED] 
#0 73.72 [FAILED] ----------
#0 73.72 [FAILED] 
#0 73.72 [FAILED] qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
#0 73.72 [FAILED] qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
#0 73.72 [FAILED] qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#0 73.72 [FAILED] 
#0 73.72 [FAILED] ----------
#0 73.72 [FAILED] 
#0 73.72 [FAILED] Platform: linux-x64 (Debian - 10.11)
#0 73.72 [FAILED] Cypress Version: 10.3.0
#0 73.73 Cypress failed to start.
#0 73.73 
#0 73.73 This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies
#0 73.73 
#0 73.73 Please refer to the error below for more details.
#0 73.73 
#0 73.73 ----------
#0 73.73 
#0 73.73 qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
#0 73.73 qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
#0 73.73 qemu: uncaught target signal 11 (Segmentation fault) - core dumped

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can still access them, either by giving a new branch name to a thing, by visiting https://github.com/cypress-io/cypress-docker-images/commits/b3465b26da55d3c41febc56dab3f5364ae9dd78e and using the branch chooser.

or by doing something like git fetch origin refs/pull/696/head:my-new-branch

As for the error, the goal is to run the arm version of cypress on our M1s, not the x64 versions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rnunezil: if you point me to the specific shas you're using and commands you're running, I'm happy to try to help.

(This isn't my primary task, but we do use cypress, so I'm glad to try to help out.)

@flotwig flotwig closed this Jul 11, 2022
@jsoref jsoref deleted the multiplatform branch July 11, 2022 16:30
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

Successfully merging this pull request may close these issues.

4 participants