-
Notifications
You must be signed in to change notification settings - Fork 170
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
WIP New approach for up-to-date images #376
Comments
Why do you need to check the SHA of the package? It is simple to check for updates and it would invalidate the cache.. |
It would be nicer indeed. The issue is that that version number includes the build timestamp that is specific to each deb so you would need a different version number for each architecture (amd64, armhf, etc). There is more context / history on #112 that explored a number of approaches for keeping the images up-to-date and we ended up on the approach described here as this was supposed to be the one creating the least number of invalid cache breaks without requiring us to have multiple dockerfiles. Although this issue description if definitely not complete enough as I dont remember how this was meant to handle the different sha for different debs of the same OS but using different architectures :| Edit: I guess the assumption was that as syncs happen for all architectures at once, we could use the sha of say amd64 and if that one changed that means that it changed for all platform as the packages was rebuilt for all arches |
Ah, I see :-/
Or the build version of amd64.. |
This is very human readable but could be misleading as snapshots have not been very consistent in the past and it could give the impression that the packages are coming from snapshots.ros.org which they will not be otherwise users would not be able to update to more recent versions without changing their sourcelist. One idea with the sha was that it was not explicitly tied to a specific deb (or source of debs) but more a black blob and would avoid confusing users and avoid questions like:
But to be fair I'm not very attached to the sha and am very happy someone is looking into it as it's been on my back burner forever 🙇♂️ . So if you have a clear preference for one, I'm fine with it (I'll let @ruffsl give a 2nd approval though) |
So we could name the label "sync date"? Instead of retrieving it from the snapshot server, we can ask Jenkins: http://build.ros.org/job/Mrel_sync-packages-to-main/ |
That sounds fine too. |
Remembering of corner cases the sha was also supposed to cover cases where:
|
Good points! The sync date could be just informational, and will updated after a SHA change was detected. I still have to dive into the (template) code to see how this could be done in a cron job. |
I have been playing around a bit. [...]
ENV ROS_DISTRO foxy
LABEL packages.ros-foxy-ros-core=0.9.2-1focal.20200826.181817
# install ros2 packages
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-foxy-ros-core=0.9.2-1* \
&& rm -rf /var/lib/apt/lists/*
[...] One label would be added per installed package. |
Or LABEL sha256.ros-foxy-ros-core=d5be9ef976036e621c7bcd8dd626af39da465c906a30585247537d3c987d557b Might be better for Gazebo, because package version do not have the build time appended. |
That's not too bad. A label is still a Dockerfile directive that can be used to break the build cache, but innocuous enough to include in the image env downstream. It'd only be indicative of changes from the amd64 architecture, but I think that's good enough.
If you add this sha label to the template code, then our current CI will automatically open a PR here with changes to the Dockerfile after a sync is released. We don't have any GH actions for opening a merged PR here to upstream, but that could be worked on separately. The template code of interest lives here, and I think you'd just need to modify this function here to include the sha inferred from the Then just extend the empy template to include the label from the value in the data dictionary, e.g. for ros2 For an example on generating dockerfiles with the templates, see the docs and Dockerfile for CI https://github.com/osrf/docker_images/blob/master/doc/generating_dockerfiles.md |
Addressed by osrf/docker_templates#90, example or resulting automatic PR: #459 |
Add a cron job to update Dockerfiles and submit upstream PR if new syncs require rebuild:
The text was updated successfully, but these errors were encountered: