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

Fix base-files not being able to download because packages.debian.org is down #6763

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ColorfulRhino
Copy link
Collaborator

@ColorfulRhino ColorfulRhino commented Jun 19, 2024

Description

packages.debian.org has been down a lot lately, so builds could not finish since the build system wants to find out the package name and version for base-files.
Use Packages.xz from the mirrors as an alternative method to search for this information.

How Has This Been Tested?

  • Building works as normal even if packages.debian.org is down

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

@amazingfate
Copy link
Contributor

Package.xz is smaller and need less time to download.
And as @rpardini mentioned at #6653 (comment), this is not good for 400+ CI build.

@ColorfulRhino
Copy link
Collaborator Author

Package.xz is smaller and need less time to download.

I've been avoiding everything xz since the malicious takeover was uncovered (yes I know the known malicious code was ripped out). Do you know if xz decompress utils are available on every build host? gz is definitely used for other stuff in the builder which is why I have used it.

And as @rpardini mentioned at #6653 (comment), this is not good for 400+ CI build.

This method is only used if the original website can't be reached. I think it's definitely better than not being able to build at all :) And at least on my machine this was somehow cached, meaning on the second build it went through this step almost instantly.

@EvilOlaf
Copy link
Member

Do you know if xz decompress utils are available on every build host?

I guess then it would be an unsupported build host anyways. As for me I never had an issue with missing xz-utils on any host I did building.

@github-actions github-actions bot added the Framework Framework components label Jun 20, 2024
@ColorfulRhino
Copy link
Collaborator Author

As for me I never had an issue with missing xz-utils on any host I did building.

Thanks for sharing your experience!

I have changed it to xz since both of you are in favor of it 👍

@alexl83
Copy link
Contributor

alexl83 commented Jun 22, 2024

Hi @ColorfulRhino - a suggestion from top of my head: should you make it dependant on a global config variable (let's call it BASE_FILES_ALTERNATE it would make it trivial to define additional debian-derivates distros in the framework (e.g. Kali-rolling)

Whether to have it as an alternative backup method for downloading base-files seems reasonable from an end-user perspective, can't speak about CI builds.
Something available as user-level/user-choice might be useful to us during downtimes without impacting CI builds with additional overhead.

packages.debian.org has been down a lot lately, so builds could not finish since the build system wants to find out the package name and version for `base-files`.
Use `Packages.gz` from the mirrors as an alternative method to search for this information.
display_alert "Could not find package filename for '${sought_package_name}' in '${package_info_download_urls[*]}'" "Trying alternative method to get ${sought_package_name}" "warn"
# Try alternative method since packages.debian.org is down often
# Use -N with wget so it always downloads the latest file, overwriting the local one if it exists
run_host_command_logged wget --no-verbose -N https://${mirror_with_slash}/dists/${RELEASE}/main/binary-${ARCH}/Packages.xz
Copy link
Member

Choose a reason for hiding this comment

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

Yeah I'm pretty certain this will break under multiple simultaneous executions, as it writes to the "current directory", and that might be the same directory when run in the prepare json matrix pipeline job. Ideally this should be done without touching the disk, by using a series of pipes. Those parallel jobs are run with CONFIG_DEFS_ONLY and other wide-affecting flags too, so beware.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, the intricacies of the build scripts 😅
Maybe it would work if it's saved to the cache directory?

A solution in the line of what @alexl83 said would be possible as well, but would on the other hand add yet another build flag that probably not many people would even know of and use 😅
Also I think finding a solution that CI can use as well would be nice since build errors in CI triggered by Debian/Ubuntu website being down is bad, it distracts from the real errors.

Copy link
Member

Choose a reason for hiding this comment

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

The "real" solution to this is to move it out of band; implement the gathering of information (incl base-files version and references, but also other info about the RELEASE+ARCH) to a scheduled, frequent, GitHub Actions job. We'd get all the info required, massage and process it into a format for easy armbian/build consumption, and publish it in a git repo. Then armbian/build would only fetch from that repo -- a mechanism we already do for many of the packages.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rpardini Is the "real" solution something being planned / worked on at the moment ?

PS: As a image build user, I can't build anything when ubuntu / debian official sites act up and it has been a lot lately :-( and it is not armbian fault of course :-)

@igorpecovnik igorpecovnik added the Discussion Being discussed - Voice your opinions :) label Jun 30, 2024
@igorpecovnik igorpecovnik added the 11 Milestone: Fourth quarter release label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11 Milestone: Fourth quarter release Discussion Being discussed - Voice your opinions :) Framework Framework components size/small PR with less then 50 lines
Development

Successfully merging this pull request may close these issues.

7 participants