Implement update lockfiles and manage pure-rpm containers - #71
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
not sure if https://gist.github.com/SeanMooney/9b4fa52de29e2f795443e7eb60cc3994 helps i tried to define the 3 things tha tupdate-souce can do and give them names https://gist.github.com/SeanMooney/9b4fa52de29e2f795443e7eb60cc3994#command-contracts |
Yep, good to descompose the use use cases. This patch implements update-lockfiles which is just intended to cover regeneration of lockfiles without any source update (neither upper-constraints.txt nor services sources in sources.txt). For the update-sources I still need to re-read your doc and find if we really need to decompose in two or we can live with one and predefined behavior (if anything is under src/ ignore sources.txt for that repo). In any case i want to also optimize update-sources to avoid full clones of repos. There are some caveats, i.e. we need git history for pbr to find the versions, but that's only required for build, so it should be fine to just pull selectively for update-sources as you are proposing. I'd like to go case by case and would appreciate reviews in this particular one while we keep working for the others. |
rebtoor
left a comment
There was a problem hiding this comment.
I'm generally ok with this but I'd like some clarifications before adding my +2 :)
| [[ -n "${_relock_projects_seen[$project]:-}" ]] && continue | ||
| _relock_projects_seen["${project}"]=1 | ||
|
|
||
| regenerate_requirements_lock "${project}" "${stream}" |
There was a problem hiding this comment.
regenerate_requirements_lock can return 1 (missing constraints or
missing lockfile), but the return value is not checked here. If one
project fails, the loop continues and the function returns 0, so the
caller never knows something went wrong.
We can consider to track failures somehow:
local rc=0
for img in "${targets[@]}"; do
...
regenerate_requirements_lock "${project}" "${stream}" || rc=1
done
return $rc
There was a problem hiding this comment.
We run the script with set -e so in case the regenerate_requirements_lock returns 1, the command fails immediately with rc 1.
=== Regenerating requirements.lock files ===
ERROR: No /home/amoralej/VMwareENG/cyborg/s2i-openstack-containers-upstream/containers/glance/upper-constraints.txt.master found for glance.
Run 'update-sources' first to fetch constraints.
update-lockfiles: exit 1 (0.16 seconds) /home/amoralej/VMwareENG/cyborg/s2i-openstack-containers-upstream> bash /home/amoralej/VMwareENG/cyborg/s2i-openstack-containers-upstream/build.sh update-lockfiles glance pid=760828
update-lockfiles: FAIL code 1 (0.29=setup[0.11]+cmd[0.01,0.00,0.16] seconds)
evaluation failed :( (0.31 seconds)
amoralej@fedora:~/VMwareENG/cyborg/s2i-openstack-containers-upstream$ echo $?
1
Which I think is an acceptable behavior at this point. We may refine to keep looping after error and returning 1 at the end, but that may left the messages hidden imo.
| - build.sh | ||
| - containers/** | ||
| - '!**/OWNERS' | ||
| - '!**/OWNERS_ALIASES' |
There was a problem hiding this comment.
Was removing the push intentional? If so, there is no longer any
post-merge verification that lockfiles are consistent on main after
a direct push or merge.
| - name: Regenerate lockfiles for changed services | ||
| if: steps.changes.outputs.services != '' | ||
| run: tox -e update-lockfiles -- ${{ steps.changes.outputs.services }} |
There was a problem hiding this comment.
The paths trigger includes build.sh, so a PR that only modifies
build.sh (without touching containers/**) will trigger this
workflow. However, detect-changed-services will return an empty
list and both steps will be skipped due to the if: guard, making
the job report green without verifying anything.
Consider either:
- removing
build.shfrom thepathstrigger, or - running lockfile regeneration for all services when no specific
changed services are detected butbuild.shchanged.
There was a problem hiding this comment.
I'm finally only slightly changing the existing test and keeping on push.
| setuptools==82.0.1 | ||
| setuptools==84.0.0 |
There was a problem hiding this comment.
Multiple packages appear twice with conflicting versions in this lockfile
(and all other service buildrequirements lockfiles):
flit-core==3.12.0
flit-core==4.0.2
...
setuptools==82.0.1
setuptools==84.0.0
Affected files: cinder, cyborg, glance, manila, watcher.
I suspect this is caused by the new --no-annotate + sed '/^#/d'
cleanup stripping the "# The following packages are considered to be
unsafe" section header that previously separated the "safe" and "unsafe"
package lists in pybuild-deps output. Without that header,
pybuild-deps may be emitting some packages in both sections and now
both entries survive the cleanup.
Could you check whether pybuild-deps compile --no-annotate is actually
producing this dual output, and if so, deduplicate (e.g. sort -u -t= -k1,1
keeping the latest version)?
…repos update-sources clones upstream repos to resolve hashes and generate lockfiles from scratch. When only pythondeps.txt or pythonbuilddeps.txt change, the full clone is unnecessary — the existing requirements.lock and upper-constraints.txt already contain the pinned upstream packages. The new update-lockfiles command regenerates requirements.lock and buildrequirements.lock using the existing lockfile plus pythondeps/ pythonbuilddeps files as inputs, constrained by upper-constraints.txt. It errors out if the prerequisite files are missing and suggests running update-sources first. The tox update-lockfiles environment now uses this command directly instead of running update-sources with SKIP_HASH_UPDATE. Also, to make lockfiles contents consistent throught update-sources and update-lockfiles we need to disable annotation generation. (cherry picked from commit 04b75f1) Assisted-By: Claude Signed-off-by: Alfredo Moralejo <amoralej@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There are some containerfiles which only install RPM packages as mariadb, rabbitmq, memcached, etc... We need that build.sh manage them properly. Assisted-By: Claude Signed-off-by: Alfredo Moralejo <amoralej@redhat.com>
Includes documentation for update-lockfiles and management of projects with only rpm packages. Assisted-By: Claude Signed-off-by: Alfredo Moralejo <amoralej@redhat.com>
Currently we were only checking that existing files were unmodified. This patch also checks that no new files are added. Signed-off-by: Alfredo Moralejo <amoralej@redhat.com>
3aceeb3 to
18d30d9
Compare
This PR introduces two improvements in build.sh: