How to auto start jupyter notebook with python create pod

As the title asks
37 Replies
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Asad Cognify
Asad CognifyOP17mo ago
Where is the option?
No description
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Madiator2011 (Work)
runpod pytorch template has it enabled
Asad Cognify
Asad CognifyOP17mo 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
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
digigoblin
digigoblin17mo ago
It doesn't work if you override the docker start command, it gets started in the docker start command
digigoblin
digigoblin17mo ago
GitHub
containers/container-template/start.sh at main · runpod/containers
🐳 | Dockerfiles for the RunPod container images used for our official templates. - runpod/containers
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
digigoblin
digigoblin17mo ago
He overrode it
docker_args="/workspace/start_inference.sh"
docker_args="/workspace/start_inference.sh"
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
digigoblin
digigoblin17mo ago
No start.sh has sleep infinity so anything after that will never run
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
digigoblin
digigoblin17mo ago
Have to either do it BEFORE or just include it in his override script
Asad Cognify
Asad CognifyOP17mo 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 CognifyOP17mo ago
No description
Asad Cognify
Asad CognifyOP17mo ago
yes. It works if I deploy a pod from UI console
digigoblin
digigoblin17mo ago
Show container logs
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Madiator2011 (Work)
I think he removed it
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Asad Cognify
Asad CognifyOP17mo ago
um.. its right there below setup_ssh below setup_ssh The variables are being exported, ssh web terminal is working
Asad Cognify
Asad CognifyOP17mo ago
No description
Asad Cognify
Asad CognifyOP17mo 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
digigoblin17mo 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 CognifyOP17mo ago
How to get the password?
digigoblin
digigoblin17mo ago
Make up one and add it to the JUPYTER_PASSWORD environment variable on the pod.
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
digigoblin
digigoblin17mo ago
He created pod using SDK
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Asad Cognify
Asad CognifyOP17mo ago
Done. It is working now Yes. There was start_ssh as a boolean but no start_jupyter
digigoblin
digigoblin17mo 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 CognifyOP17mo ago
Okay, will do that
jjdademon
jjdademon16mo 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
jjdademon16mo ago
@Asad Jamal Cognify
Madiator2011 (Work)
Jupiter is thing that needs to be first preinstalled on container level

Did you find this page helpful?