diff --git a/sdks/python/container/Dockerfile b/sdks/python/container/Dockerfile index 7bea6229668f..00dadf7a75c5 100644 --- a/sdks/python/container/Dockerfile +++ b/sdks/python/container/Dockerfile @@ -45,7 +45,7 @@ RUN \ && \ rm -rf /var/lib/apt/lists/* && \ - pip install --upgrade pip setuptools wheel && \ + pip install --upgrade pip setuptools wheel memray && \ # Install required packages for Beam Python SDK and common dependencies used by users. # use --no-deps to ensure the list includes all transitive dependencies. diff --git a/sdks/python/container/boot.go b/sdks/python/container/boot.go index c59807c72a98..87fa888e3661 100644 --- a/sdks/python/container/boot.go +++ b/sdks/python/container/boot.go @@ -263,6 +263,8 @@ func launchSDKProcess() error { }() args := []string{ + "run", + // "--native" Add to track native (C/C++) stack frames as well. "-m", sdkHarnessEntrypoint, } @@ -282,7 +284,7 @@ func launchSDKProcess() error { return } logger.Printf(ctx, "Executing Python (worker %v): python %v", workerId, strings.Join(args, " ")) - cmd := StartCommandEnv(map[string]string{"WORKER_ID": workerId}, os.Stdin, bufLogger, bufLogger, "python", args...) + cmd := StartCommandEnv(map[string]string{"WORKER_ID": workerId}, os.Stdin, bufLogger, bufLogger, "memray", args...) childPids.v = append(childPids.v, cmd.Process.Pid) childPids.mu.Unlock()