Skip to content

Add an experiment to make prism server a singleton #34623

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

Merged
merged 4 commits into from
Apr 15, 2025

Conversation

shunping
Copy link
Collaborator

@shunping shunping commented Apr 14, 2025

Follow-up to #34616, addressing #33623.

Introduces an experimental feature for Prism Runner to maintain only a single background Prism server instance. This is beneficial in environments like Google Colab where long-lived Python processes may trigger Prism Runner multiple times across different pipeline executions.

@shunping shunping changed the title Make prism server a singleton [WIP] Make prism server a singleton Apr 14, 2025
@shunping shunping force-pushed the prism-server-singleton branch from 4ef3c57 to 94c9cb0 Compare April 14, 2025 03:34
@shunping shunping force-pushed the prism-server-singleton branch from 94c9cb0 to 4122723 Compare April 14, 2025 15:01
@shunping shunping changed the title [WIP] Make prism server a singleton Add an experiment to make prism server a singleton Apr 14, 2025
@shunping shunping force-pushed the prism-server-singleton branch from 4122723 to 3975e89 Compare April 14, 2025 15:08
@shunping shunping self-assigned this Apr 14, 2025
@shunping shunping force-pushed the prism-server-singleton branch from c670b1b to 892356d Compare April 14, 2025 18:12
@shunping shunping force-pushed the prism-server-singleton branch from 7c48491 to 0956a9d Compare April 14, 2025 18:56
@shunping shunping marked this pull request as ready for review April 14, 2025 19:26
Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @claudevdm for label python.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@shunping
Copy link
Collaborator Author

shunping commented Apr 14, 2025

Also cc'ed @lostluck and @liferoad

debug_options = options.view_as(pipeline_options.DebugOptions)
get_job_server = lambda: job_server.StopOnExitJobServer(
PrismJobServer(options))
if debug_options.lookup_experiment("enable_prism_server_singleton"):
Copy link
Contributor

Choose a reason for hiding this comment

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

when using this with Interactive Runner, does this need to be always a singleton?

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 can we detect or pass whether interactive runner is being used and if so use a singleton instead of requiring a flag?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We decided to make it an experiment for the coming release 2.65.0 (#33623 (comment)), so we don't introduce breaking change 2 weeks before branch cut and have more time to bake in.

After we make prism runner as the default local runner, we can probably choose to make singleton the default as well, but this will be upon further discussion.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it.

@liferoad liferoad added this to the 2.65.0 Release milestone Apr 15, 2025
Copy link
Contributor

R: @tvalentyn for final approval

@liferoad liferoad merged commit bebfcbc into apache:master Apr 15, 2025
91 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.

3 participants