Start the pod with a custom command after the pod finishes startup
How can add I command that the pod will execute after it has finished starting up? I tried using
And replaced
sleep infinity
with apt install nano -y
The container starts but I am unable to access it using ssh or the web terminal.21 Replies
That is all the info it gives and doesnot start the terminal
you overwritten docker image start command so it's only executing what you do and then wait with bash
I found this here. How do add commands to execute after the pod has sucessfully started?
I am using the pytorch template
you would need to run start script
btw you do not need to do it for PyTorch template as it's already have ssh setup
What is the start script or how can I run it? Yes, but I want to run a few scripts as the pod starts rather than running them manually each time
From the template
How?
Hmm find the template and edit the file
Okay so where to find the template? On docker hub?
And I saw a start.sh script on the root of the container which I think is think is the startup script
So how can I add some scripts to run after start.sh?
Would this work?
No, because start.sh has
sleep infinity
so the commands after it would never be reachedcan I modify the start.sh?
How do I add my commands to run after it has finished executing?
Not sure, find it on Google or somewhere
What template are you using?
Its the pytorch template, its shown in the screenshot
Solution
You can try the other way around:
but you probably need bash -c
pytorch 2.2.0