-
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
Add back examples for archiving binaries and assembling Docker images #10
Comments
I'm investigating using Bazel for some ROS builds and this repo has been extremely helpful! I've been able to get builds to work for interfaces, libraries, and launch-files, but I have not been able to get the container_image example to work. I just saw that you've started making updates to this repo again. Do you know if the examples for docker images will look similar to the previous examples using container_image, or do you think they'll use a different strategy like oci_image? Do you have a timeline when you think the examples will be re-added? I'm still learning Bazel, but let me know if there's anything I can do to help implement or test these changes. |
Hi, indeed, the idea is to use https://github.com/bazel-contrib/rules_oci . It should be fairly straightforward to set up an example for creating a ROS app deployment image using e.g. https://github.com/aspect-build/bazel-examples/tree/main/oci_python_image. I'll try to add this soon. If you manage to put together an example before me, please open a PR. It can be even simpler than that mentioned example: we don't need to split the layers (that's an optimization). We could create a single layer and point out how to split layers for more efficiency. |
I started looking into this. Looking at the example you reference, it appears as though each project would need to create a py_layer.bzl or similar in their project. Wouldn't it be nice to reduce that code duplication and include a function in this library to do all the heavy lifting for the users? |
I found a solution that works. A bit of a hack, but it works. Also, no layering with this solution either. I could not get rules_pkg:pkg_tar to package up the runfiles, they've removed (hidden private actually) the previously accessible but undocumented include_runfiles argument. I was hoping to be able to use that, plus their ability to create symlinks to package up my tar properly. But no. I found aspect_bazel_lib:tar includes the runfiles, but they are arranged in such a way that roslaunch will fail:
A symlink can fix the problem, but this rule does not have any provision to create the needed symlink. But this is easily fixed. I added a run.sh script to create the missing symlink, cd into the proper directory, then run the launch command.
Add the following to your MODULE.bazel
And then in your BUILD.bazel
To generate the image:
And to run that image locally:
Too much of an ugly hack to publish a PR with this, but hope this helps someone. |
No description provided.
The text was updated successfully, but these errors were encountered: