-
Notifications
You must be signed in to change notification settings - Fork 11
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
Extend template to install packages from lockfiles #106
base: master
Are you sure you want to change the base?
Conversation
hacks are no longer needed as hooks for DockerHub are no longer used
to expand later via profile.yaml.em
as requesting them is slow
@mikaelarguedas , I'm finding it a bit of a nuisance that not all meta packages exist for all "supported" platform architectures. ~/git/osrf/docker_images/ros$ ./create_dockerfolders.py dir -a -d .
Generating Dockerfile 'melodic/ubuntu/bionic/ros-core/Dockerfile':
Generating Dockerfile 'melodic/ubuntu/bionic/ros-base/Dockerfile':
Generating Dockerfile 'melodic/ubuntu/bionic/robot/Dockerfile':
Generating Dockerfile 'melodic/ubuntu/bionic/perception/Dockerfile':
Generating Dockerfile 'melodic/ubuntu/bionic/desktop/Dockerfile':
Generating Dockerfile 'melodic/ubuntu/bionic/desktop-full/Dockerfile':
Generating Dockerfile 'noetic/ubuntu/focal/ros-core/Dockerfile':
Generating Dockerfile 'noetic/ubuntu/focal/ros-base/Dockerfile':
Generating Dockerfile 'noetic/ubuntu/focal/robot/Dockerfile':
Generating Dockerfile 'noetic/ubuntu/focal/perception/Dockerfile':
Generating Dockerfile 'noetic/ubuntu/focal/desktop/Dockerfile':
Traceback (most recent call last):
File "/home/ruffsl/git/osrf/docker_images/ros/./create_dockerfolders.py", line 31, in <module>
main()
File "/home/ruffsl/git/osrf/docker_images/ros/./create_dockerfolders.py", line 27, in main
populate_paths(manifest, args, create_dockerfiles)
File "/home/ruffsl/git/osrf/docker_templates/docker_templates/folders.py", line 73, in populate_paths
create_dockerfiles.main(('dir', '-d' + dockerfolder_dir))
File "/home/ruffsl/git/osrf/docker_images/ros/create_dockerfiles.py", line 58, in main
expandPackages(data)
File "/home/ruffsl/git/osrf/docker_templates/docker_templates/packages.py", line 169, in expandPackages
package_versions = getPackageVersions(data, package_index, data[package_type], package_type)
File "/home/ruffsl/git/osrf/docker_templates/docker_templates/packages.py", line 126, in getPackageVersions
package_info = getPackageInfo(package_pattern, package_index)
File "/home/ruffsl/git/osrf/docker_templates/docker_templates/packages.py", line 91, in getPackageInfo
package_info = matchs.group(0)
AttributeError: 'NoneType' object has no attribute 'group' The current template config is not too accommodating for missing packages, as the list of supported platform architectures is indexed by distro, rather than by distro tag. Any suggestions? Would you like to add a few commits here as well? |
Signed-off-by: Mikael Arguedas <[email protected]>
Signed-off-by: Mikael Arguedas <[email protected]>
Cool initiative!
This will likely require adressing osrf/docker_images#530 to be effective
Just to confirm, the docker farm will have no way to know that the file changed automatically if a job is not triggered. So we would open a PR upstream every time we modify one of these lockfils and that will be what will trigger the rebuilds is that right ?
Yeah.. Unfortunately I don't know of a simple machine readable way to get this info. Only the buildfarm config knows about them and it doesnt seem convenient to retrieve Our best shot would be to hack the docker templates python to pass and not crash in case of unfound packages. But this comes with the drawback that then we wont get notified if packages that "should be there" are not found |
One way of skipping packages if not found: 4ed6033. We'll need to test in details what the implications are, we may end up with a building dockerfile but without the package in it that would mislead users if not caught by us ahead of time Also added 4b089c8 to support imaged with both ROS1 and ROS2 packages (ros1_bridge) |
to reduce the number of directories
to avoid polluting the /opt folder
so Dockerfile build fails for archs with no packages
Yea, although I commented over here on how we could use some GitHub actions to automate opening up the PR upstream: A question would be on how to connect the two automated PR pipelines. I was thinking of:
We could simplify this by shorcuruting the causal chain to creating PRs upstream, but I was thinking that the manual blocks would help avoid spamming the librarians incase we needed to manually intervene and make several commits to manifest files directly. |
I added 90aac73 to avoid writing to the lockfile if there are no packages listed for the platform architecture. This would ensure the same Dockerfile behavior, i.e. build time failure, for such cases:
There would still be the corner case for lockfiles with multiple packages then simply missing the package(s) that are also missing from the apt repo, but still allowing the Dockerfile build to succeed. Grr... |
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.
lgtm,
Independant of the automated PR, could we give a shot to merge this and corresponding docker_images PR to submit to the librarian and see is that's an acceptable way to go for them ?
I've just asked for their feedback over here, as I'd like to avoid reverting this many commits should this also get rebuffed. |
Extend template to install packages from lockfiles in an another attempt to fix:
This PR modifies the ROS Dockerfile templates to install apt packages from a copied text file. Importantly, the copy operation locates this file by checking the
TARGETARCH
, an automatic platformARG
in the global scope, supported with buildkit:https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
Lastly, these lockfiles also include the full package version identifier, now allowing for our automated CI over on osrf/docker_images to detect minor package updates and syncs, update these lockfiles via automated PRs, and subsequently trigger rebuilds upstream via controlled and selective busting of the docker build cache in the Docker Official Images