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

cloud_storage: Move s3_imposter to cloud_io #24945

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

Lazin
Copy link
Contributor

@Lazin Lazin commented Jan 27, 2025

The s3_imposter is used in several subsystems already (iceberg/datalake/cloud_storage/cloud_topics). It makes sense to move it into test_utils to make dependencies less confusing.

The PR just moves s3_imposter.h(cc) to test_utils and updates build files and include paths.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.3.x
  • v24.2.x
  • v24.1.x

Release Notes

  • none

Sorry, something went wrong.

Copy link
Member

@dotnwat dotnwat left a comment

Choose a reason for hiding this comment

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

in v::random, for example, we only keep generic random utilities. it's v::subsystem that will have subsystem specific random generators.

do we want to put all sub-system specific test utilities into a single place? i think the answer to that question determines if this change makes sense. the current trend seems to be have A depends_on B implies many times that A::test depends_on B::test_utils.

Copy link
Contributor

@andrwng andrwng left a comment

Choose a reason for hiding this comment

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

Just curious what the motivation for this change is. Also, did you consider putting this in, for example, cloud_io/tests? test_utils seems to generally contain things that might be useful for all tests with the exception of archival.h which seems like an outlier

"//src/v/bytes:iobuf",
"//src/v/bytes:iobuf_parser",
"//src/v/bytes:iostream",
"//src/v/cloud_storage",
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious in general why this couldn't have just moved the existing library definition from cloud_storage/BUILD. Like why does this depend on cloud_storage?

It's surprising this would depend on these too:

  • cluster
  • disk_log_builder

I think a lot of the boost deps would be better as implementation_deps

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I extracted this PR from the cloud topics branch, and there I think I just copied this stuff from one place to another. Will clean this up.

@Lazin
Copy link
Contributor Author

Lazin commented Jan 27, 2025

I think moving to v::cloud_io makes sense. I'm OK with this as long as it's not part of the cloud_storage. When it's in cloud_storage it's weird because tests for other subsystems depend on cloud_storage even though the actual subsystem doesn't.

@vbotbuildovich
Copy link
Collaborator

vbotbuildovich commented Jan 27, 2025

CI test results

test results on build#61228
test_id test_kind job_url test_status passed
rptest.tests.compaction_recovery_test.CompactionRecoveryUpgradeTest.test_index_recovery_after_upgrade ducktape https://buildkite.com/redpanda/redpanda/builds/61228#0194a90f-7d68-43cf-b18e-4e324d979213 FLAKY 1/2
test results on build#61249
test_id test_kind job_url test_status passed
gtest_raft_rpunit.gtest_raft_rpunit unit https://buildkite.com/redpanda/redpanda/builds/61249#0194a9ca-3fd7-42ca-8392-2cb6fbfcc8cc FLAKY 1/2
rptest.tests.delete_records_test.DeleteRecordsTest.test_delete_records_with_transactions.cloud_storage_enabled=True ducktape https://buildkite.com/redpanda/redpanda/builds/61249#0194aa25-d142-4430-8dbc-88c21aed2102 FLAKY 1/2
test results on build#61287
test_id test_kind job_url test_status passed
rptest.tests.compaction_recovery_test.CompactionRecoveryTest.test_index_recovery ducktape https://buildkite.com/redpanda/redpanda/builds/61287#0194aca7-2b75-4806-919b-f7d553388f4e FLAKY 1/2
rptest.tests.compaction_recovery_test.CompactionRecoveryTest.test_index_recovery ducktape https://buildkite.com/redpanda/redpanda/builds/61287#0194acc3-1f58-485a-a356-087206449889 FLAKY 1/2
rptest.tests.datalake.compaction_test.CompactionGapsTest.test_translation_no_gaps.cloud_storage_type=CloudStorageType.S3 ducktape https://buildkite.com/redpanda/redpanda/builds/61287#0194acc3-1f59-4955-9d85-6b15220b807d FLAKY 1/3
rptest.tests.raft_availability_test.RaftAvailabilityTest.test_leader_transfers_recovery.acks=-1 ducktape https://buildkite.com/redpanda/redpanda/builds/61287#0194aca7-2b74-4a4c-8b22-e4bd3a1a99a5 FLAKY 1/2
test_kafka_protocol_unit_rpunit.test_kafka_protocol_unit_rpunit unit https://buildkite.com/redpanda/redpanda/builds/61287#0194ac63-9f29-4fb7-93bb-64f206bc0c02 FLAKY 1/2
test results on build#61315
test_id test_kind job_url test_status passed
rptest.tests.scaling_up_test.ScalingUpTest.test_scaling_up_with_recovered_topic ducktape https://buildkite.com/redpanda/redpanda/builds/61315#0194ae9e-8fbb-46fc-b710-9c367976383f FLAKY 1/3

@Lazin Lazin force-pushed the pr/move-s3-imposter-to-utils branch from 79ad203 to 82f2217 Compare January 27, 2025 22:02
@Lazin Lazin requested review from andrwng and dotnwat January 27, 2025 22:02
@Lazin Lazin changed the title cloud_storage: Move s3_imposter to test_utils cloud_storage: Move s3_imposter to cloud_io Jan 27, 2025
@Lazin
Copy link
Contributor Author

Lazin commented Jan 27, 2025

Moved to cloud_io/tests

@dotnwat
Copy link
Member

dotnwat commented Jan 27, 2025

I think moving to v::cloud_io makes sense. I'm OK with this as long as it's not part of the cloud_storage. When it's in cloud_storage it's weird because tests for other subsystems depend on cloud_storage even though the actual subsystem doesn't.

+1 to rehoming into cloud_io

@dotnwat
Copy link
Member

dotnwat commented Jan 28, 2025

bazel build needs a few tweeks


ERROR: /var/lib/buildkite-agent/builds/buildkite-amd64-builders-i-04bdc3fc7bbed132d-1/redpanda/redpanda/src/v/datalake/coordinator/tests/BUILD:83:18: no such target '//src/v/cloud_storage/tests:s3_imposter': target 's3_imposter' not declared in package 'src/v/cloud_storage/tests' defined by /var/lib/buildkite-agent/builds/buildkite-amd64-builders-i-04bdc3fc7bbed132d-1/redpanda/redpanda/src/v/cloud_storage/tests/BUILD and referenced by '//src/v/datalake/coordinator/tests:iceberg_snapshot_remover_test'
--
  | Analyzing: 1724 targets (1415 packages loaded, 84344 targets configured)

@Lazin Lazin force-pushed the pr/move-s3-imposter-to-utils branch from 82f2217 to 4e06ec2 Compare January 28, 2025 10:07
],
include_prefix = "cloud_io/tests",
visibility = ["//visibility:public"],
deps = [
Copy link
Member

Choose a reason for hiding this comment

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

s3_imposter.{cc,h} didn't change, so why did implementation_deps change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andrwng pointed out that some of the deps are not used

Copy link
Contributor

Choose a reason for hiding this comment

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

Mm I don't think that's quite related though. I'd pointed out there are some unnecessary things in deps, but Noah's pointing out that the implementation_deps list was removed in this move.

IIUC the general guidance is that implementation_deps should include things that are in the cc file but not the header, and deps should include things required by the header.

Copy link
Member

@dotnwat dotnwat Jan 28, 2025

Choose a reason for hiding this comment

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

andrew is right. iobuf, for example, is included in .cc but not in .h so it at least looks to be a candidate for implementation_deps. similarily for other things in the deps = [] list, but i think at least not regressing on the list makes sense. i don't know which ones are unused, but that is separate.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
The s3_imposter is used in several subsystems already
(iceberg/datalake/cloud_storage/cloud_topics). It makes sense to move it
into cloud_io to make dependencies less confusing.

Signed-off-by: Evgeny Lazin <[email protected]>
@Lazin Lazin force-pushed the pr/move-s3-imposter-to-utils branch from 4e06ec2 to a11ae40 Compare January 28, 2025 19:12
@dotnwat dotnwat enabled auto-merge January 28, 2025 19:20
@dotnwat dotnwat merged commit 6529e28 into redpanda-data:dev Jan 29, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants