-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom images launched in SageMaker Studio use Python installation not present in uploaded image #9
Comments
So I did find a workaround by including a custom kernelspec in the Docker container that specifies the system python installation at The new kernelspec looks like: {
"argv": [
"/usr/local/bin/python",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3",
"language": "python"
} I wish this behavior was better documented in the SageMaker custom image tutorials. |
I have this same issue, and happy to find a workaround, but this is quite annoying. Not sure why it's necessary for SageMaker to install conda when I'm using a custom image? 🤔 |
Noticing similar issues. For me KernelGatewayApp picks the correct kernel(python3) but it also keeps complaining about conda :) as not found, and then I added |
I am using the poetry image, and am facing the similar issue, my image is not starting with file unhandled errror and here are my kernel logs: My python is installed in:
and my kernel is installed in
and this is my kernel.json Can some one tell how did you pint the system python installation at /usr/local/bin/python3 and how did you add the custom kernelspec? Would be great if you share the dockerfile? |
Could you share the dockerfile? |
Expected Behavior
/usr/local/bin
referencing packages installed at/usr/local/lib/python3.8/site-packages
Οbserved behavior
The SageMaker Studio notebook launches a kernel session using a python installation not present in the Docker container when uploaded to ECR found at
/opt/.sagemakerinternal/conda/bin/python
.This happens with Notebook and Console kernel sessions launched from the image.
Attempted debugging
I can confirm that the Notebook and Console sessions are launching the correct image because I can find my installed packages in
/usr/local/lib/python3.8/site-packages
from within the Notebook and the Console.I can confirm this doesn't happen if I launch an Image Terminal from the Studio Session. When I do this, the Docker container is launched as expected and executing
$ python
points to the expected installation in/usr/local/bin
I think this has something to do with how Jupyter sessions are launched within SageMaker Studio. When I look at the logs on CloudWatch, I see this:
I have a few concerns:
+ echo This is not a DLC/Studio image (found Custom), so not adding Python3 kernel.
This should be a SageMaker image. I make it copying theecho_kernel
example Dockerfile from this repo. SageMaker has no issues launching the Notebook session from the console.The text was updated successfully, but these errors were encountered: