-
Notifications
You must be signed in to change notification settings - Fork 163
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
bulk: allow prefetching binary packages from official repos #797
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks super helpful for incremental builds on cloud-based poudriere servers.
It would be nice if there was a way to specify a full URL rather than hardcoding pkg.freebsd.org. Supporting |
.It Fl b Ar name | ||
Specify the | ||
.Ar name | ||
of the binary package branch to use to prefetch packages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-b
doesn't make me think fetch at all. In bulk.sh it is -b branch
which makes me think 'branch' rather than 'binary'; I'm saying that at a quick glance of the manpage I might think this is saying which branch to build from rather than anything to do with fetching. I don't really have a better idea.
We're getting to the point of needing to use things like --fetch
. I had been thinking -s[eed]
but -f -F -S
are taken already and I had a plan to flip -S
into -s
IIRC.
Like Brooks comment I think this inevitably ends in someone asking for REPO_URL
to be configurable so this flag interface may need to forward think about that.
src/share/poudriere/common.sh
Outdated
if [ -n "${PACKAGE_BRANCH}" ]; then | ||
download_from_repo | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Need this to not run for non-build commands (like
pkgclean
) and to not run when resuming, and to still respect-c
and-C
. So I think it makes sense higher up (Github review won't let me comment on untouched lines.) :
if [ -n "${PACKAGE_BRANCH}" -a "${resuming_build}" -ne 1 ]; then
download_from_repo
fi
# existing code
if [ ${JAIL_NEEDS_CLEAN} -eq 1 ]; then
msg_n "Cleaning all packages due to newer version of the jail..."
rm -rf ${PACKAGES}/* ${cache_dir}
- Then there is the question of what should
-n
(dry run) do? Should it fetch so that a proper accounting of what will build is done or should it just say "will try fetching pkgA pkgB ..."? I have no opinion here.
src/share/poudriere/common.sh
Outdated
[ -f ${MASTERMNT}/packages/All/${pkgname}.${PKG_EXT} ] || echo ${pkgname} | ||
done | ||
)| JNETNAME="n" injail xargs env -i ASSUME_ALWAYS_YES=yes pkg fetch -o /packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine for now but ultimately we may want to inspect more what will be downloaded to avoid delete_old_pkg
from nuking the same packages every time for things like different options or flavors.
Remaining items I am fixing before merge:
Items for after:
|
As soon as we have the entire list of packages to build but before the sanity check, pre fetch all the binary packages that we can from the official repositories. The sanity check running after than will probably destroy some packages for which the confiration will be different or any reason suitable for the sanity check to destroy packages. When listing the packages to fetch only list the one not already existing to avoid pkg fetch to redownload and overwrite packages we have already customized
This is to allow things like HTTP_PROXY to passthrough.
A major pitfall is that local patches, overlays, I could auto detect |
For example this avoids downloading a package that uses base ssl while we want ports ssl. Issue #797
For example this avoids downloading a package that uses base ssl while we want ports ssl. Issue freebsd#797
Specifically the TRIM_ORPHANED_BUILD_DEPS feature can come into play after trimming IGNORED packages, where some build deps are missing but we don't actually need them as the packages requiring them are not queued and are present. Clean the queue after trimming ignored to handle this case which reduces unneeded fetches. This also means download_from_repo() should never come across a package that is NOT missing a package file, otherwise why is it queued? Issue #797
As soon as we have the entire list of packages to build but before
the sanity check, pre fetch all the binary packages that we can
from the official repositories.
The sanity check running after than will probably destroy some
packages for which the confiration will be different or any reason
suitable for the sanity check to destroy packages.
When listing the packages to fetch only list the one not already
existing to avoid pkg fetch to redownload and overwrite packages
we have already customized