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

Docker upload CI is broken #2568

Closed
cooperlees opened this issue Oct 27, 2021 · 6 comments
Closed

Docker upload CI is broken #2568

cooperlees opened this issue Oct 27, 2021 · 6 comments
Labels
C: maintenance Related to project maintenance, e.g. CI, testing, policy changes, releases C: packaging Installation and packaging of Black T: bug Something isn't working

Comments

@cooperlees
Copy link
Collaborator

cooperlees commented Oct 27, 2021

Haven't debugged yet but seems a build level bug inside the container. Need to see if it can be reproduced locally.

error: failed to solve: process "/bin/sh -c pip install --no-cache-dir --upgrade pip setuptools wheel     && apt update && apt install -y git     && cd /src     && pip install --no-cache-dir .[colorama,d]     && rm -rf /src     && apt remove -y git     && apt autoremove -y     && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 1
Error: buildx failed with: error: failed to solve: process "/bin/sh -c pip install --no-cache-dir --upgrade pip setuptools wheel     && apt update && apt install -y git     && cd /src     && pip install --no-cache-dir .[colorama,d]     && rm -rf /src     && apt remove -y git     && apt autoremove -y     && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 1

Example fail: https://github.com/psf/black/actions/runs/1391464711

@cooperlees cooperlees added the T: bug Something isn't working label Oct 27, 2021
@vbarbaresi
Copy link
Contributor

The detailed error is actually Failed to build regex
Because it tries to build from source on linux/arm64 and fails with:

error: command 'gcc' failed: No such file or directory

It seems that regex did have some prebuilt wheels for arm64 in previous versions, but the latest doesn't have any aarch64 builds yet.

regex's CI might be broken: they have a travis-ci but I don't find any public interface where we could see the build status.

I see 3 possible solutions:

  • Wait for them to upload prebuilt wheels
  • Fallback on a pinned version (2021.10.8) that has prebuilt wheels
  • Install build tools in docker (gcc) and potentially other dependencies like python3-dev

@cooperlees
Copy link
Collaborator Author

Thanks for debugging further!

Lets try the following:

  • Install development packages into a builder image and have the ability to build our deps
    • Would like to keep the images as small as possible
  • If that's to hard, maybe we pin for now and somehow be alerted to when we get latest version wheels again

@ichard26 ichard26 added C: packaging Installation and packaging of Black C: maintenance Related to project maintenance, e.g. CI, testing, policy changes, releases labels Oct 28, 2021
@vbarbaresi
Copy link
Contributor

vbarbaresi commented Oct 31, 2021

I opened this issue on regex project: https://bitbucket.org/mrabarnett/mrab-regex/issues/434/aarch64-build-is-failing
I didn't find the Travis build logs last time, but now I finally found them: https://app.travis-ci.com/bitbucket/mrabarnett/mrab-regex/builds
Now that I see the logs I guess that it's probably a fluke in the aarch64 build. It doesn't seem fundamentally broken

I saw that you pinned regex and that it solved the issue for now.
I tried to build after installing build-essential and that was enough to solve the issue:

https://github.com/vbarbaresi/black/compare/7bf233a..bb86cd#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557

https://github.com/vbarbaresi/black/runs/4061992219?check_suite_focus=true
Though it took ~12 min to build instead of 4 min, so I don't think it's a good solution.
It would be good as a workaround in case some dependency is missing wheels again

@cooperlees
Copy link
Collaborator Author

Thanks for trying this. I think long term we should definitely support building from source but will probably need a multi stage build so we can keep the image size around the current ~50MB ...

If you/anyone have cycles I'd totally take a PR making us able to build from source via a multi stage build to keep our image size low.

vbarbaresi added a commit to vbarbaresi/black that referenced this issue Oct 31, 2021
- Install build-essential to avoid build issues like psf#2568 when dependencies don't have prebuilt wheels available
- Use multi-stage build instead of trying to purge packages and cache from the image
  Copying `/root/.local/` installs only black's built Python dependencies (< 20 MB).
  So the image is barely larger than python:3-slim base image
@vbarbaresi
Copy link
Contributor

I took a stab at it #2582

JelleZijlstra pushed a commit that referenced this issue Nov 1, 2021
…build (#2582)

- Install build-essential to avoid build issues like #2568 when dependencies don't have prebuilt wheels available
- Use multi-stage build instead of trying to purge packages and cache from the image
  Copying `/root/.local/` installs only black's built Python dependencies (< 20 MB).
  So the image is barely larger than python:3-slim base image
@cooperlees
Copy link
Collaborator Author

This is all fixed and was used to release 20.10b0 - Thanks for your help!

JelleZijlstra pushed a commit that referenced this issue Nov 16, 2021
…build (#2582)

- Install build-essential to avoid build issues like #2568 when dependencies don't have prebuilt wheels available
- Use multi-stage build instead of trying to purge packages and cache from the image
  Copying `/root/.local/` installs only black's built Python dependencies (< 20 MB).
  So the image is barely larger than python:3-slim base image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: maintenance Related to project maintenance, e.g. CI, testing, policy changes, releases C: packaging Installation and packaging of Black T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants