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

[dagster-pipes] Add key param to PipesS3MessageReader #24884

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danielgafni
Copy link
Contributor

@danielgafni danielgafni commented Sep 30, 2024

Summary & Motivation

This PR adds key parameter to PipesS3MessageReader.

Previously, it could only be used when paired with PipesS3MessageWriter on the external process side.

This change allows using PipesS3MessageReader in situations where we expect an external service to create an S3 object containing Pipes messages (typically by dumping stdout/stderr logs).

A new expect_s3_message_writer parameter is introduced to distinguish between these two operational modes (defaults to True).

A new key parameter can either be passed to the constructor or set later on via PipesSession.report_launched hook (if not known during MessageReader instantiation).

How I Tested These Changes

Added a unit test for the new functionality.

Changelog

Insert changelog entry or "NOCHANGELOG" here.

  • NEW (added new feature or capability)

Copy link
Contributor Author

danielgafni commented Sep 30, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @danielgafni and the rest of your teammates on Graphite Graphite

@danielgafni danielgafni force-pushed the 09-13-_dagster-pipes_add_threadedpipesmessagereader_with_extra_runtime_params branch from 271a6b7 to 7f7242b Compare September 30, 2024 10:44
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch 3 times, most recently from bdc9a6f to 3393f77 Compare October 1, 2024 08:14
@danielgafni danielgafni force-pushed the 09-13-_dagster-pipes_add_threadedpipesmessagereader_with_extra_runtime_params branch from 7f7242b to d63500e Compare October 1, 2024 15:29
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 3393f77 to 4c3ccd7 Compare October 1, 2024 15:29
@danielgafni danielgafni force-pushed the 09-13-_dagster-pipes_add_threadedpipesmessagereader_with_extra_runtime_params branch from d63500e to 672fbd0 Compare October 1, 2024 16:59
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 4c3ccd7 to f5b8973 Compare October 1, 2024 16:59
@danielgafni danielgafni force-pushed the 09-13-_dagster-pipes_add_threadedpipesmessagereader_with_extra_runtime_params branch from 672fbd0 to 9d2fae3 Compare October 1, 2024 17:07
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from f5b8973 to 9dd7a07 Compare October 1, 2024 17:07
@danielgafni danielgafni force-pushed the 09-13-_dagster-pipes_add_threadedpipesmessagereader_with_extra_runtime_params branch from 9d2fae3 to c002962 Compare October 1, 2024 19:39
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 9dd7a07 to 80c5521 Compare October 1, 2024 19:39
@danielgafni danielgafni force-pushed the 09-13-_dagster-pipes_add_threadedpipesmessagereader_with_extra_runtime_params branch 2 times, most recently from b02e92d to 2ebe652 Compare October 1, 2024 20:31
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 80c5521 to 1bd1bc8 Compare October 1, 2024 20:31
@danielgafni danielgafni force-pushed the 09-13-_dagster-pipes_add_threadedpipesmessagereader_with_extra_runtime_params branch from 2ebe652 to cf54202 Compare October 1, 2024 20:37
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch 2 times, most recently from 5726e76 to 2e0b789 Compare October 2, 2024 07:17
@danielgafni danielgafni marked this pull request as ready for review October 2, 2024 07:18
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 2e0b789 to 35bdb96 Compare October 2, 2024 07:58
@danielgafni danielgafni force-pushed the 09-13-_dagster-pipes_add_threadedpipesmessagereader_with_extra_runtime_params branch from cf54202 to c10d2ff Compare October 2, 2024 13:58
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 35bdb96 to 0ab0981 Compare October 2, 2024 13:58
@danielgafni danielgafni force-pushed the 09-13-_dagster-pipes_add_threadedpipesmessagereader_with_extra_runtime_params branch from c10d2ff to 681425a Compare October 2, 2024 14:28
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 0ab0981 to ff84c91 Compare October 2, 2024 14:33
@danielgafni danielgafni changed the base branch from dagster-pipes-mutable-logreaders to 10-03-_dagster-pipes_start_pipeslogreader_right_away October 9, 2024 08:55
@danielgafni
Copy link
Contributor Author

danielgafni commented Oct 9, 2024

I suspect it would be better to just have a separate class

I think we should spend some time discussing these options.


This will be a common pattern with all PipesMessageReaders. It should always be possible to create the message passing channel on Dagster's side (and require a matching PipesMessageWriter on the remote process side).

Let's consider our file-based message readers:

  • PipesFileMessageReader
  • PipesTempFileMessageReader

We have 2 classes for these 2 options. I my opinion, that's fine.

However, we do not follow the same naming/functionality mapping with other message readers. Consider the corresponding S3 message readers:

  • PipesFileMessageReader (reads from any file) -> ?
  • PipesTempFileMessageReader (reads from a file created by Dagster) -> PipesS3MessageReader.

The current PipesS3MessageReader actually acts as PipesTemp3MessageReader, because it's reading from objects created by Pipes.

That's why I didn't add a separate class - the logical decision would be to rename the existing PipesS3MessageReader to PipesTempS3MessageReader (or another name strongly indicating that it isn't supposed to be reading just any S3 objects) and add the new class as just PipesS3MessageReader, but this would mean breaking changes in Pipes.

So, I decided to make a parameter to switch between these 2 options instead.


We should have this naming/functionality consistent across different MessageReaders. If we decide to have 2 classes, we should have 2 classes everywhere (but this means breaking changes). If we decide to have an argument we should also have it everywhere (and it will be less confusing since it will be all over our docs and impossible to miss).

@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 735b5ac to 9c5e211 Compare October 9, 2024 09:37
@danielgafni danielgafni force-pushed the 10-03-_dagster-pipes_start_pipeslogreader_right_away branch from ed5bf00 to b620aad Compare October 10, 2024 09:20
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 9c5e211 to e14bfec Compare October 10, 2024 09:20
@danielgafni danielgafni force-pushed the 10-03-_dagster-pipes_start_pipeslogreader_right_away branch from b620aad to ff49809 Compare October 10, 2024 12:17
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from e14bfec to 92e3f11 Compare October 10, 2024 12:18
@danielgafni danielgafni force-pushed the 10-03-_dagster-pipes_start_pipeslogreader_right_away branch from ff49809 to 4c3849a Compare October 10, 2024 13:50
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 92e3f11 to 19d1a34 Compare October 10, 2024 13:50
@danielgafni danielgafni force-pushed the 10-03-_dagster-pipes_start_pipeslogreader_right_away branch from 4c3849a to 56c3559 Compare October 10, 2024 14:41
@danielgafni danielgafni changed the base branch from 10-03-_dagster-pipes_start_pipeslogreader_right_away to graphite-base/24884 October 10, 2024 14:42
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 19d1a34 to d949d88 Compare October 10, 2024 14:44
@danielgafni danielgafni changed the base branch from graphite-base/24884 to master October 10, 2024 14:44
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from d949d88 to 57055af Compare October 10, 2024 14:44
@smackesey
Copy link
Collaborator

We should have this naming/functionality consistent across different MessageReaders. If we decide to have 2 classes, we should have 2 classes everywhere (but this means breaking changes). If we decide to have an argument we should also have it everywhere (and it will be less confusing since it will be all over our docs and impossible to miss).

I agree and think you've hit on a rough area in the design of pipes. We should discuss with @schrockn. AFAICT the EMR client (the last one in the stack we aimed to merge this week) need not depend on this functionality, so please move that off of this one so we can merge it independently, then we can discuss this question of message readers dependence on a particular message writer next week.

@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from 57055af to b99096f Compare October 11, 2024 15:01
@danielgafni danielgafni changed the base branch from master to dagster-aws-PipesS3LogReader October 11, 2024 15:01
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from b99096f to 8699e73 Compare October 11, 2024 15:11
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch 2 times, most recently from 936c9d3 to c43b817 Compare October 11, 2024 15:26
@danielgafni danielgafni force-pushed the 09-30-_dagster-pipes_add_key_param_to_pipess3messagereader branch from c43b817 to c178540 Compare October 14, 2024 11:52
Base automatically changed from dagster-aws-PipesS3LogReader to master October 14, 2024 12:16
@danielgafni
Copy link
Contributor Author

@schrockn I believe this topic above needs your attention

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Related to documentation in general
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants