Skip to content
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

Migrate to GitHub Actions #69

Merged
merged 2 commits into from
Mar 23, 2021
Merged

Conversation

tylerjw
Copy link
Member

@tylerjw tylerjw commented Mar 19, 2021

This will rescue this repo out of the grasp of Travis. I'll post a link to a fork where it'll run so you can see it pass before merging.

Test is running here: tylerjw#1

@tylerjw tylerjw requested a review from JStech March 19, 2021 21:08
@tylerjw tylerjw force-pushed the add-github-actions branch 2 times, most recently from 983a8b8 to 8dc5488 Compare March 19, 2021 22:04
@tylerjw
Copy link
Member Author

tylerjw commented Mar 19, 2021

This failed catkin_lint with a wall of errors. I'm going to leave that out of this and it can be a separate PR if you'd like to enable it.

@tylerjw
Copy link
Member Author

tylerjw commented Mar 20, 2021

As you can see at the link these take 45min to complete. Merging this will atleast get you out of the Travis queue.

@gavanderhoorn
Copy link

gavanderhoorn commented Mar 20, 2021

As you can see at the link these take 45min to complete.

almost all time is spent building MoveIt from source.

I haven't checked, but is that necessary?

The build of the calibration packages takes about 2 minutes.


Edit: ccache is used. With the cache now populated, are subsequent build faster?

@tylerjw
Copy link
Member Author

tylerjw commented Mar 20, 2021

Edit: ccache is used. With the cache now populated, are subsequent build faster?

It should be, I can test this by restarting the CI run.

almost all time is spent building MoveIt from source.

I haven't checked, but is that necessary?

I'm not sure, it is also building a bunch of stuff from moveit's rosinstall file I'm sure is not needed (like tutorials). I can try configuring this to only build moveit (assuming it even needs that).

@tylerjw
Copy link
Member Author

tylerjw commented Mar 20, 2021

@tylerjw
Copy link
Member Author

tylerjw commented Mar 20, 2021

One thing interesting is the cache size it restored is 22 bytes which makes me think it isn't actually working.

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See below. Otherwise lgtm.

- {ROS_DISTRO: melodic, ROS_REPO: main}
env:
CCACHE_DIR: ~/.ccache
UPSTREAM_WORKSPACE: https://raw.githubusercontent.com/ros-planning/moveit/master/moveit.rosinstall
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of building against all MoveIt sources again, just reuse the melodic-source docker container.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can try that, I'm not sure if that docker container plays nice with industrial_ci, but it might. I'll update this with the fixes I now know for the ccache stuff and uploading any test failures.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylerjw so are you going to try it or do you want to have this merged before trying to change the container?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix this (and some other things I learned about last night) and then I'll post here when I think this is ready.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now fixed, we are using the moveit source docker (for now, melodic) to test this and rviz_visual_tools from source and it works.

@JStech JStech added the enhancement New feature or request label Mar 21, 2021
@JStech
Copy link
Contributor

JStech commented Mar 21, 2021

Thanks, everyone, for the input. I'm fine with leaving the catkin_lint fixes for later (#70).

I know in the past the source build was necessary for rviz_visual_tools and moveit_visual_tools (see #23). Building MoveIt from source might not be necessary. I can figure that out, but I don't have bandwidth for this right now. I suggest we just take advantage of ccache for now, and if I figure out that a source build actually is necessary, we can switch to the source container. (#71)

@tylerjw
Copy link
Member Author

tylerjw commented Mar 21, 2021

I just pushed changes with these changes:

  • ccache will work correctly now (this should speed up builds after the first one)
  • codecov reporting (does this repo have tests?)
  • black formatting added to pre-commit (future python files will be nicely formatted now)
  • uploading test result files (when they fail)

Copy link
Contributor

@JStech JStech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, although that's not saying much--not my expertise.

@@ -8,7 +8,6 @@ AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLoopsOnASingleLine: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was gonna say something about this, but decided to just open #72 instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know a better way to do this than copy-pasting it everywhere. This change is because we copy-pasted a yaml error everywhere, this is a duplicate of line 9 above it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do something like what ament_clang_format does from ament_lint and install our .clang-format file as a resource from the moveit_common package or some other similar package, release that as a debian, depend on it, and then change our clang_format commands to use the ros resource lookup commands to find the path to it and use it. That seems like a real hassle though it would solve the problem of this being copy-pasted everywhere.

@tylerjw
Copy link
Member Author

tylerjw commented Mar 21, 2021

Looks good to me, although that's not saying much--not my expertise.

Assuming this passes on my fork I'll merge it and you can get started using it.

@tylerjw
Copy link
Member Author

tylerjw commented Mar 21, 2021

I can't manually merge this (because travis, which no longer runs, is not reporting a status and the settings of this repo require all previous tests to pass). Could someone with the correct permissions in this repo push it?

Copy link

@v4hn v4hn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I did not participate in your herculean effort to migrate all the repos (thank you! 💐) and can't merge this without further questions.

I guess we should also disable the travis CI jobs in the config upon merging this request?

@@ -80,6 +80,6 @@ class HandEyeCalibrationGui : public rviz::Panel
rviz_visual_tools::TFVisualToolsPtr tf_tools_;
};

} // namedist moveit_rviz_plugin
} // namespace moveit_rviz_plugin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do all these patches come from? Afaics the clang-format version and config didn't change? 😕

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config changed because now we have a yaml syntax checker and our .clang-format file was invalid and causing clang-format to miss things.

- {ROS_DISTRO: melodic, ROS_REPO: main}
env:
CCACHE_DIR: ~/.ccache
UPSTREAM_WORKSPACE: https://raw.githubusercontent.com/ros-planning/moveit/master/moveit.rosinstall
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylerjw so are you going to try it or do you want to have this merged before trying to change the container?

@tylerjw
Copy link
Member Author

tylerjw commented Mar 22, 2021

@tylerjw so are you going to try it or do you want to have this merged before trying to change the container?

I don't mind doing it either way. For moveit itself I'm going to need to update the container and there are some other improvements I learned about last night I can apply here to make this more performant.

@tylerjw
Copy link
Member Author

tylerjw commented Mar 22, 2021

I guess we should also disable the travis CI jobs in the config upon merging this request?

Merging this will disable travis for this repo. The reason this can't be merged automatically is GitHub is trying to stop someone from merging things by deleting the ci config (which is exactly what I did). Someone with write access to master has to merge this manually.

@tylerjw tylerjw force-pushed the add-github-actions branch 3 times, most recently from 091f24d to 46bab1b Compare March 22, 2021 16:28
@codecov
Copy link

codecov bot commented Mar 22, 2021

Codecov Report

❗ No coverage uploaded for pull request base (master@fedd85b). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #69   +/-   ##
=========================================
  Coverage          ?   72.75%           
=========================================
  Files             ?       10           
  Lines             ?      554           
  Branches          ?        0           
=========================================
  Hits              ?      403           
  Misses            ?      151           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fedd85b...a222428. Read the comment docs.

@tylerjw tylerjw force-pushed the add-github-actions branch 2 times, most recently from f302f2f to 545436f Compare March 22, 2021 20:28
@tylerjw
Copy link
Member Author

tylerjw commented Mar 22, 2021

@rhaschke I believe this is now ready. I added the codecov badge to the readme (as I think it's a nice thing to have) but I resisted putting the large srv graph of it there. Thank you again for reviewing all these.

@tylerjw tylerjw requested a review from rhaschke March 22, 2021 20:29
@tylerjw
Copy link
Member Author

tylerjw commented Mar 22, 2021

With the combination of the moveit source docker image and upstream repo caching, the CI runs for this is ~4min. 🎉

@tylerjw tylerjw closed this Mar 22, 2021
@tylerjw tylerjw reopened this Mar 22, 2021
@tylerjw
Copy link
Member Author

tylerjw commented Mar 22, 2021

I closed and re-opened this to see if I could get rid of the TravisCI requirement. It didn't work.

industrial_ci:
env:
DOCKER_IMAGE: 'moveit/moveit:melodic-source'
UPSTREAM_WORKSPACE: 'upstream.rosinstall'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing as this is only a single package, something like should also work (and reduce the nr of files the configuration is spread across):

UPSTREAM_WORKSPACE='github:PickNikRobotics/rviz_visual_tools#master'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using a cache of that file to determine if I should re-use the cache of the upstream workspace. If I make this change I don't need that hash, but if someone changes this line then they could introduce confusing situations with the upstream cache.

Short story: that change would make this PR simpler as it is with the sideafect of if someone changes it later confusing things might happen. I could go either way.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't caching workspaces potentially problematic anyway? You run the risk of dependencies changing and your cache becoming invalid. The hash would not change, but you'd either still have to get additional packages installed, or you'd miss the missing dependencies and end up with failed builds.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm specifically caching the upstream_ws folder. If the repos are changed (by changing that file) the cache is invalidated and re-created. If instead the repos themselves have changes since the cache was created, the cache gets updated. This is done by the line AFTER_SETUP_UPSTREAM_WORKSPACE: 'vcs pull $BASEDIR/upstream_ws/src' and because the upstream_cache uses ${{ github.run_id }} at the end of the key (meaning that it'll overwrite the cache on each run at the end of the run).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only risk I see with this approach to caching the upstream if somehow incremental builds of the upstream workspace is problematic. In either case the rosdep step is called after the vcs pull so if there are changed binary dependencies that's handled nicely.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the industrial_ci builds attempts to update dependencies from the upstream_ws and build it in any case.
However, if the cached upstream_ws was loaded before, this is most of the time a noop.
Only if there are changes, they will be performed. If you change your dependencies (in upstream.install) the cache becomes invalid automatically. Gijs' approach should work as well - if you hash the industrial_ci_action.yml file.
However, this might invalidate the cache more often then needed (not all changes to this file will change the dependencies). Hence, Tyler's approach is perfectly fine and preferred from my side.

matrix:
- TEST=catkin_lint
- UPSTREAM_WORKSPACE=https://raw.githubusercontent.com/ros-planning/moveit/master/moveit.rosinstall
TEST_BLACKLIST=moveit_ros_perception
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to disable moveit_ros_perception tests anymore? Cool!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

industrial_ci isn't running the upstream tests... but I haven't seen any issues with them when running moveit itself either.

@rhaschke rhaschke merged commit 54e3a32 into moveit:master Mar 23, 2021
@tylerjw tylerjw deleted the add-github-actions branch March 23, 2021 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants