red-holiday-95178
08/16/2024, 8:57 PMflytekit
that asserts shared process namespace for the primary
and profiler
containers in the pod and adding some e.g. additional capabilities
◦ This ensures any sampling profiler can read the Task Python process' proc/$pid/maps
◦ Easy enough, that part is done!
• Knowing what PID
is the user task being run. This would entail e.g. pgrep -f <entrypoint_for_task>
My problem arises in that last bullet point -- what process name should I be attempting to get the PID
of?
• I first, naively, tried pgrep -f pyflyte-execute
given that this is the entrypoint into the lifecycle of a task. This likely spins off separate processes for the user code itself, though, and as such does not work
Once dispatch_execute
is called somewhere within pyflyte-execute
, what would be the appropriate process to grep for? Would it be simpler to attempt a different approach, such as a custom PythonFunctionTask
that dumps the task objects PID to a shared volume?freezing-airport-6809
red-holiday-95178
08/17/2024, 12:04 AMpstree
in container and see what I can seefreezing-airport-6809
red-holiday-95178
08/19/2024, 1:43 PMred-holiday-95178
08/19/2024, 1:43 PMpyflyte-execute
)high-accountant-32689
08/19/2024, 7:15 PMOncesince you're not fast registering, you'll find that there's only a single process in the invocation of dispatch_execute. keep in mind that we _do_ subprocess in the case of fast register. Can we take a few steps back and talk a bit about your use case? Double-clicking on Ketan's suggestion, why can't you invoke the profiler programmatically as part of the entrypoint setup?is called somewhere withindispatch_execute
pyflyte-execute
red-holiday-95178
08/20/2024, 10:54 PMtask
decorator's custom PodSpec
, and... yeah that is more or less it.
We could attach the profiler programmatically at entrypoint though I don't necessarily see the advantages. Other than filtering out some extra noise from the samples. By working at the `task`/`PodSpec` level we can multiple different internally wrapped tasks that our researchers can pick and choose from -- @mem_profile_task
, etc.careful-australia-19356
11/07/2024, 3:08 PMred-holiday-95178
11/07/2024, 3:27 PM