liferoad commented on code in PR #26753:
URL: https://github.com/apache/beam/pull/26753#discussion_r1197344472
##########
sdks/python/container/boot.go:
##########
@@ -157,15 +156,20 @@ func launchSDKProcess() error {
signalChannel := make(chan os.Signal, 1)
signal.Notify(signalChannel, syscall.SIGHUP, syscall.SIGINT,
syscall.SIGTERM)
- venvDir, err := setupVenv(ctx, logger, "/opt/apache/beam-venv", *id)
- if err != nil {
- return errors.New("failed to initialize Python venv")
- }
- cleanupFunc := func() {
- os.RemoveAll(venvDir)
- logger.Printf(ctx, "Cleaned up temporary venv for worker %v.",
*id)
+ // Create a separate virtual envirionment (with access to globally
installed packages), unless disabled by the user.
+ // This improves usability on runners that persit the execution
environment for the boot entrypoint between multiple pipeline executions.
+ if os.Getenv("RUN_PYTHON_SDK_IN_DEFAULT_ENVIRONMENT") == "" {
+ venvDir, err := setupVenv(ctx, logger, "/opt/apache/beam-venv",
*id)
+ if err != nil {
+ logger.Printf(ctx, "Using default environment, since
creating a virtual environment for the SDK harness didn't succeed:
"+err.Error())
Review Comment:
If my Go knowledge is correct, this will be still logged as INFO?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]