-
Notifications
You must be signed in to change notification settings - Fork 301
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
Setup CI #310
Setup CI #310
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.
Considering that ros1_bridge does not have CI from the ROS build farm, I think adding a GitHub action for CI could be useful. However, I think it would be better to reuse existing ROS actions if possible (see my comment below).
ros1_bridge/__init__.py
Outdated
@@ -860,12 +860,12 @@ def load_ros2_service(ros2_srv): | |||
|
|||
|
|||
# make field types hashable | |||
def FieldHash(self): | |||
def field_hash(self): |
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.
Why was this change necessary?
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.
To clarify, I'm a bit surprised that this is causing tests to fail considering it's been in the code for over 6 years. Perhaps we're running a different set of tests for our manually triggered CI?
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.
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.
reverted this change.
.github/workflows/main.yml
Outdated
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.CCACHE_DIR }} | ||
key: ccache-${{ matrix.distro }}-${{github.run_id}} | ||
restore-keys: | | ||
ccache-${{ matrix.distro }} |
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.
@nuclearsandwich @cottsay As we've had issues on the build farm related to ccache, could you comment as to if you think there's any issue with this? Perhaps it's better to avoid caching altogether and live with longer CI times.
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.
Part of the reason we disabled ccache on the buildfarm is that the implementation leveraged a shared ccache across packages, meaning that one package could poison the cache for everyone. Since this is a single ccache only for this package, I don't think that's a concern here. You may want to brush up on how to purge the cache and also determine the scope of the cache - for example, can someone open a PR with "bad" changes which poison the cache for normal runs.
I'd guess that the buildfarm concerns were rooted in security, and since the results of this job are discarded, it's less of a concern.
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.
You may want to brush up on how to purge the cache and also determine the scope of the cache - for example, can someone open a PR with "bad" changes which poison the cache for normal runs.
I think the cache is not uploaded for runs that are not successful. But I can check this again.
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.
To add to @cottsay's answer. A threat faced by the build farm is that ccache itself has no security model so in addition to ccache placing objects in its own database as part of regular operations. Any script with access to the underlying ccache directory can also place potentially malicious objects manually which would be picked up as cache hits on subsequent builds. One reason this matters on the build farm is that the binary artifacts are the primary output of (the binary package jobs, at least) that farm. Here the produced artifacts are not propagated beyond the action and are only used for in-context testing. So an "attack" on the ccache database for this action's primary impact is a sort of denial-of-service attack by pushing a malformed cache object which would cause subsequent builds to fail all tests until the object was purged either by a change in the sources or a full cache purge.
All that's to say, I think ccache in this context is fine. I'd want to explore further if this action produced artifacts.
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.
Interesting!
.github/workflows/main.yml
Outdated
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
distro: ["ros:rolling-ros1-bridge-focal", "ros:foxy-ros1-bridge-focal"] |
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.
The master
branch is not targeting Foxy, so I would only target Rolling for CI here. Later, we can port this PR to the foxy branch, making the necessary changes to target Foxy.
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.
now targets only rolling
56435b0
to
73b2231
Compare
ros2#310 (comment) Signed-off-by: Harsh Deshpande <harshavardhan.deshpande@ipa.fraunhofer.de>
The
If build times are not a major concern, we can leave out |
I don't think a 30min CI time is anything to worry about. We typically run this Jenkins job to test |
Signed-off-by: Harsh Deshpande <harshavardhan.deshpande@ipa.fraunhofer.de>
Signed-off-by: Harsh Deshpande <harshavardhan.deshpande@ipa.fraunhofer.de>
Signed-off-by: Harsh Deshpande <harshavardhan.deshpande@ipa.fraunhofer.de>
ros2#310 (comment) Signed-off-by: Harsh Deshpande <harshavardhan.deshpande@ipa.fraunhofer.de>
build times are not a concern and it is not significantly improved when using ros-tooling actions Signed-off-by: Harsh Deshpande <harshavardhan.deshpande@ipa.fraunhofer.de>
@jacobperron should be good to go. |
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
@ipa-hsd Thanks for the contribution!
This PR sets up CI using GIthub Actions. It builds and tests
ros1_bridge
forfoxy
(ros:foxy-ros1-bridge-focal
) androlling
(ros:rolling-ros1-bridge-focal
).It also sets up
ccache
which helps reduce the build times from ~18 minutes to ~2 minutes. Here are theccache stats
Finally a small fix (
FieldHash
inros1_bridge/__init__.py
to lowercase) for the tests to pass.Here is link for the
push
job.