The launch_container.sh script is created on the fly by the Nodemanager for each task that is run. So you would need to modify the Nodemanager code to modify the launch_container.sh script.
The control flow is: Nodemanager -> container-executor -> launch_container.sh The nodemanager launches the container-executor, which is a setuid binary so that it can change users to the user that the process should be run as. Then the container-executor execs the launch_container.sh script. The container-executor waits around for the task to finish and reads its stdout/stderr. Once the task is done, the container-executor cleans up as well. The only way I know of to inject a pre-launch script would be to use the DockerLinuxContainerRuntime and create an image with an Entrypoint. You could set that Entrypoint as the script that you want to run and then the Entrypoint script could end by exec'ing into launch_container.sh. Hope this helps, Eric
