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

apt-utils.sh: get base-files package version from GHA #7473

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

Conversation

amazingfate
Copy link
Contributor

@amazingfate amazingfate commented Nov 14, 2024

Description

I have written a python script running in Github workflow: https://github.com/amazingfate/deb-files-parser, which will generate all versions of base-files from debian and ubuntu in a json file: https://github.com/amazingfate/deb-files-parser/blob/master/base-files.json, and now we can get rid of the unstable packages.debian.org or packages.ubuntu.com.
If this change is fine, we can move the repo amazingfate/deb-files-parser to armbian.

Deprecating: #7286

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

  • ./compile.sh BOARD=rock-5b BRANCH=vendor BUILD_MINIMAL=yes DEB_COMPRESS=xz DOWNLOAD_MIRROR=china KERNEL_CONFIGURE=no RELEASE=jammy GITHUB_MIRROR=ghproxy KERNEL_GIT=shallow BUILD_DESKTOP=no ENABLE_EXTENSIONS=mesa-vpu DEBUG=yes. Build log:
--> (19) DEBUG: Calling artifact function [ artifact_armbian-base-files_prepare_version()  ]
--> (20) INFO: Found upstream base-files package filename [ base-files_12ubuntu4.7_arm64.deb ]
--> (20) DEBUG: Found package filename [ base-files_12ubuntu4.7_arm64.deb in url http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/pool/main/b/base-files/base-files_12ubuntu4.7_arm64.deb ]
--> (20) INFO: Found base-files upstream package version [ 12ubuntu4.7 ]
--> (20) DEBUG: Found package download url [ http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/pool/main/b/base-files/base-files_12ubuntu4.7_arm64.deb ]

Checklist:

Please delete options that are not relevant.

  • 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
  • Any dependent changes have been merged and published in downstream modules

@amazingfate amazingfate requested a review from a team as a code owner November 14, 2024 09:02
@github-actions github-actions bot added size/small PR with less then 50 lines Needs review Seeking for review Framework Framework components labels Nov 14, 2024
@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge 02 Milestone: First quarter release and removed Needs review Seeking for review labels Nov 15, 2024
@ColorfulRhino
Copy link
Collaborator

Cool!

If this change is fine, we can move the repo amazingfate/deb-files-parser to armbian.

Why not include this into the armbian/build repo instead of using a separate repo just for the script? Build could just run the parser on the fly and put the resulting json in the cache directory, what do you think?

@amazingfate
Copy link
Contributor Author

Cool!

If this change is fine, we can move the repo amazingfate/deb-files-parser to armbian.

Why not include this into the armbian/build repo instead of using a separate repo just for the script? Build could just run the parser on the fly and put the resulting json in the cache directory, what do you think?

The parser script is still querying pkg info from pacakges.debian.org or packages.ubuntu.com, if the site is down, build would still fall if there is no local cache.

@rpardini
Copy link
Member

Excellent, @amazingfate -- super thanks. A few nits:

I've reviewed https://github.com/amazingfate/deb-files-parser -- looks fine, only suggestions there would be

  1. use pretty-printed JSON for the output file, so when changes do happen, we can get better diffs.
  2. when moving that repo to the armbian org, one will possibly need to be explicit about the permissions: (GITHUB_TOKEN behaves slightly weird/different when used in a personal repo or a org repo, and the git push will most probably fail)

And to say the truth I can't follow where https://github.armbian.com/base-files.json is actually coming from in the end -- is it in ghpages in the armbian org? If so, where is the actual repo and GHA workflow that is publishing it there?

@igorpecovnik
Copy link
Member

igorpecovnik commented Nov 17, 2024

And to say the truth I can't follow where https://github.armbian.com/base-files.json is actually coming from in the end -- is it in ghpages in the armbian org? If so, where is the actual repo and GHA workflow that is publishing it there?

  1. https://github.com/armbian/armbian.github.io/blob/main/.github/workflows/generate-base-files-info-json.yml generates JSON and puts it into "data" repository
  2. this https://github.com/armbian/armbian.github.io/blob/main/.github/workflows/directory-listing.yml checks if something is pushed to data and generate website with index.

I expanded this to put here some other JSON files that are in use.

And, top level org pages has this (sub)domain: (normally armbian.github.io)
image

@rpardini
Copy link
Member

  1. armbian/armbian.github.io@main/.github/workflows/generate-base-files-info-json.yml generates JSON and puts it into "data" repository
  2. this armbian/armbian.github.io@main/.github/workflows/directory-listing.yml checks if something is pushed to data and generate website with index.

Nice this makes sense. I will send PRs down there in the future, thanks!

Copy link
Member

@rpardini rpardini left a comment

Choose a reason for hiding this comment

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

I've cherry-picked, built a large train, published to repo, everything seems to work fine.

@github-actions github-actions bot added Needs review Seeking for review and removed Ready to merge Reviewed, tested and ready for merge labels Nov 17, 2024
@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
02 Milestone: First quarter release Framework Framework components Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines
Development

Successfully merging this pull request may close these issues.

4 participants