How to auto start jupyter notebook with python create pod

As the title asks
37 Replies
nerdylive
nerdylive6mo ago
Well you simply start jupyter using the template
Asad Cognify
Asad CognifyOP6mo ago
Where is the option?
No description
nerdylive
nerdylive6mo ago
try browsing how to start jupyter i try not to spoonfeed
Madiator2011 (Work)
runpod pytorch template has it enabled
Asad Cognify
Asad CognifyOP6mo ago
It wont start for me. I am using runpod/pytorch:2.2.0-py3.10-cuda12.1.1-devel-ubuntu22.04 as container image
pod = runpod.create_pod(
name=task.bot_name,
image_name="runpod/pytorch:2.2.0-py3.10-cuda12.1.1-devel-ubuntu22.04",
gpu_count=1,
gpu_type_id='NVIDIA A40',
network_volume_id="123456",
volume_mount_path="/workspace",
ports= "8888/http,5000/http,22/tcp",
env={"PUBLIC_KEY": "ssh-ed25519 AAA"}, #
docker_args="/workspace/start_inference.sh",
)
pod = runpod.create_pod(
name=task.bot_name,
image_name="runpod/pytorch:2.2.0-py3.10-cuda12.1.1-devel-ubuntu22.04",
gpu_count=1,
gpu_type_id='NVIDIA A40',
network_volume_id="123456",
volume_mount_path="/workspace",
ports= "8888/http,5000/http,22/tcp",
env={"PUBLIC_KEY": "ssh-ed25519 AAA"}, #
docker_args="/workspace/start_inference.sh",
)
No description
nerdylive
nerdylive6mo ago
is docker_args cmd? is it working if you create from the UI?
digigoblin
digigoblin6mo ago
It doesn't work if you override the docker start command, it gets started in the docker start command
digigoblin
digigoblin6mo ago
GitHub
containers/container-template/start.sh at main · runpod/containers
🐳 | Dockerfiles for the RunPod container images used for our official templates. - runpod/containers
nerdylive
nerdylive6mo ago
its in /start.sh
digigoblin
digigoblin6mo ago
He overrode it
docker_args="/workspace/start_inference.sh"
docker_args="/workspace/start_inference.sh"
nerdylive
nerdylive6mo ago
does && works there? like maybe sh /start.sh && that command
digigoblin
digigoblin6mo ago
No start.sh has sleep infinity so anything after that will never run
nerdylive
nerdylive6mo ago
oh ya... maybe call that first, if it doesn't have sleep
digigoblin
digigoblin6mo ago
Have to either do it BEFORE or just include it in his override script
Asad Cognify
Asad CognifyOP6mo ago
The script I used for overriding is the same as start.sh I modified it to add a few commands such as install nano and screen
Asad Cognify
Asad CognifyOP6mo ago
No description
Asad Cognify
Asad CognifyOP6mo ago
yes. It works if I deploy a pod from UI console
digigoblin
digigoblin6mo ago
Show container logs
nerdylive
nerdylive6mo ago
So there is start jupyter command there in your script? Where's start jupyter function
Madiator2011 (Work)
I think he removed it
nerdylive
nerdylive6mo ago
I think so
Asad Cognify
Asad CognifyOP6mo ago
um.. its right there below setup_ssh below setup_ssh The variables are being exported, ssh web terminal is working
Asad Cognify
Asad CognifyOP6mo ago
No description
Asad Cognify
Asad CognifyOP6mo ago
Is there an issue with
if [[ $JUPYTER_PASSWORD ]]; then
echo "Starting Jupyter Lab..."
if [[ $JUPYTER_PASSWORD ]]; then
echo "Starting Jupyter Lab..."
I cannot see "Starting Jupyter Lab..." in the logs
digigoblin
digigoblin6mo ago
Yes, try adding JUPYTER_PASSWORD environment variable to your pod. It won't start unless the environment variable is present. Looks like start_jupyter may be missing from the Python SDK, seems to only have start_ssh and not start_jupyter to automatically inject the environment variable.
Asad Cognify
Asad CognifyOP6mo ago
How to get the password?
digigoblin
digigoblin6mo ago
Make up one and add it to the JUPYTER_PASSWORD environment variable on the pod.
nerdylive
nerdylive6mo ago
it is auto generated if you create via ui i think
digigoblin
digigoblin6mo ago
He created pod using SDK
nerdylive
nerdylive6mo ago
Yep
Asad Cognify
Asad CognifyOP6mo ago
Done. It is working now Yes. There was start_ssh as a boolean but no start_jupyter
digigoblin
digigoblin6mo ago
Grand, you may want to consider logging a GitHub issue to add support for start_jupyter https://github.com/runpod/runpod-python
GitHub
GitHub - runpod/runpod-python: 🐍 | Python library for RunPod API an...
🐍 | Python library for RunPod API and serverless worker SDK. - GitHub - runpod/runpod-python: 🐍 | Python library for RunPod API and serverless worker SDK.
Asad Cognify
Asad CognifyOP6mo ago
Okay, will do that
jjdademon
jjdademon5mo ago
There is already an issue for this: - https://github.com/runpod/runpod-python/issues/311 Also, I've just submitted a pull request with a fix for this: - https://github.com/runpod/runpod-python/pull/328 We'll wait for the maintainers to review, and if satisfactory, hopefully it'll be in the next release.
GitHub
Enable startJupyter in create_pod() · Issue #311 · runpod/runpod-py...
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] Currently it is only supported to pas...
GitHub
Add start_jupyter argument to create_pod argument, to launch a note...
This PR resolves Issue #311 . There is a design choice made here to be considered. It would be helpful to receive feedback on this, if another solution is preferred. For jupyter to launch, it req...
jjdademon
jjdademon5mo ago
@Asad Jamal Cognify
Madiator2011 (Work)
Jupiter is thing that needs to be first preinstalled on container level
Want results from more Discord servers?
Add your server