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

[compression] Enable compression through ros2bag cli #263

Merged
merged 27 commits into from
Feb 7, 2020

Conversation

zmichaels11
Copy link
Contributor

@zmichaels11 zmichaels11 commented Jan 22, 2020

Changes

  • Add --compression-mode and --compression-format arguments for ros2bag
  • rosbag2_transport instantiates SequentialCompressionReader or SequentialCompressionWriter if both compression-mode and compression-format are specified.

Testing

  • Add e2e test to verify bagfiles are compressed
  • Add e2e test to verify compressed bagfiles can be read

@zmichaels11 zmichaels11 force-pushed the compression-cli branch 2 times, most recently from a6c2213 to db94ab0 Compare January 22, 2020 17:43
@zmichaels11 zmichaels11 marked this pull request as ready for review January 22, 2020 18:07
Copy link
Contributor

@piraka9011 piraka9011 left a comment

Choose a reason for hiding this comment

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

Some minor changes but LGTM.

Copy link
Contributor

@dabonnie dabonnie left a comment

Choose a reason for hiding this comment

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

Other than some nits seems fine.

@zmichaels11 zmichaels11 force-pushed the compression-cli branch 2 times, most recently from 96deb6d to 089c971 Compare January 24, 2020 00:30
@zmichaels11
Copy link
Contributor Author

Rebased onto master and resolved redundancy issue.

@zmichaels11
Copy link
Contributor Author

Any comments?
@Karsten1987
@thomas-moulard
@mm318
@emersonknapp

I'd like to merge this tonight if possible.

// TODO(zmichaels11): Remove when stop_execution properly SIGINT on Windows.
// This is required since stop_execution hard kills the proces on Windows,
// which prevents the metadata from being written.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean this feature is broken on Windows? Did we test this on this platform?

@thomas-moulard
Copy link
Contributor

Somehow I can't approve this PR, but this LGTM. Let's make sure we test rosbag2 on windows and OS X too. The TODO in the test is worrying.

Copy link
Contributor

@thomas-moulard thomas-moulard left a comment

Choose a reason for hiding this comment

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

See previous comment.

@zmichaels11
Copy link
Contributor Author

@ros2/aws-oncall - please run this CI job
Gist: https://gist.githubusercontent.com/zmichaels11/0f8a5a8cf63f22aced353085c523f9ef/raw/77155bc93aa546d2e8c8b901f8d13e98785a4e42/ros2.repos
BUILD args: --packages-up-to rosbag2_tests rosbag2_compression rosbag2_transport rosbag2_cpp
TEST args: --packages-select rosbag2_tests rosbag2_compression rosbag2_transport rosbag2_cpp
Job: ci_launcher

@zmichaels11
Copy link
Contributor Author

zmichaels11 commented Jan 24, 2020

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@zmichaels11
Copy link
Contributor Author

This was failing earlier due to me configuring the build wrong.
It looks like its passing now. I'm going to merge this tonight if all CI is green.

@zmichaels11
Copy link
Contributor Author

The e2e tests on windows are failing due to the SIGINT workaround for Windows.
The last bagfile is compressed in the dtor. Because of this, it gets skipped in record_end_to_end_test_with_zstd_file_compression. I'm going to rewrite that test to ensure the bagfile splits at least once and verify that the first bagfile is compressed properly.

Similarly, record_end_to_end_with_splitting_bagsize_split_is_at_least_specified_size is unable to pass since the last bagfile is not compressed. I'll relax this test and skip checking that the last bagfile is < uncompressed size.

Copy link
Collaborator

@Karsten1987 Karsten1987 left a comment

Choose a reason for hiding this comment

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

I do approve as I think the tests cover the new functionality (please make sure CI turns out to be green).
But I am getting a bit concerned about this windows workaround as well, as we copied this one all over the place now within the end to end tests.

@zmichaels11
Copy link
Contributor Author

zmichaels11 commented Jan 28, 2020

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@zmichaels11
Copy link
Contributor Author

zmichaels11 commented Feb 6, 2020

Ran successfully on local machine.

  • Windows Build Status
    Edit: fixed linters
  • Windows Build Status

Signed-off-by: Zachary Michaels <[email protected]>
@zmichaels11
Copy link
Contributor Author

zmichaels11 commented Feb 6, 2020

This is working now. I'm going to refactor the work done into single-focus PRs
Edit: Refactored into:

This PR should be rebased onto master once both of those PRs are merged in.

@piraka9011
Copy link
Contributor

piraka9011 commented Feb 7, 2020

Kicking off CI after rebase:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status
  • Windows-container Build Status

@zmichaels11
Copy link
Contributor Author

zmichaels11 commented Feb 7, 2020

It looks OSX test is failing due to the test fixture trying to access SQLite mid-compression.
Rewrote that test to not depend on querying SQLite while publishing.

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status

Edit: It looks like its passing. Rerunning CI on Linux only since the test is not included in Windows.

@piraka9011 piraka9011 merged commit 714d4c8 into ros2:master Feb 7, 2020
@zmichaels11 zmichaels11 deleted the compression-cli branch February 7, 2020 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants