apache / apache/beam

Create a mechanism to run a custom worker intialization code on Python workers

Open
#20,321 2 comments 0 reactions 0 assignees View on GitHub
core new feature P3 python
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

A couple of Beam users mentioned a usecase where some initialization code needs to run on Python workers before pipeline processing starts.

Such code needs to be executed run early in the main() method of python worker[1].

Java SDK has provides this capability via JvmInitializer [2], BEAM-6872. Let's add such capability for Python users as well.

[1] https://github.com/apache/beam/blob/7ad4c4c8e601e39573aae7b4d778be2e908a0868/sdks/python/apache_beam/runners/worker/sdk_worker_main.py#L85
[2] https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/harness/JvmInitializer.java

Imported from Jira [BEAM-10039](https://issues.apache.org/jira/browse/BEAM-10039). Original Jira may contain additional context.
Reported by: tvalentyn.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.