-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
conda-env-kernel-image example is broken #22
Comments
I have a similar issue in my own conda container where the default conda env is always the base env, but I cannot switch to my conda env in the notebook.
|
I am also running into this issue. Were you able to fix it? |
I was able to make use of the example. But I also started mounting from /root, as I did not see any users within these images. This also the difference to @tom-mcclintock. config_app = {
"AppImageConfigName": "conda-env-kernel-config",
"KernelGatewayImageConfig": {
"KernelSpecs": [
{
"Name": "conda-env-venv-py",
"DisplayName": "Python [conda env: venv]"
}
],
"FileSystemConfig": {
--> "MountPath": "/root", <--
"DefaultUid": 0,
"DefaultGid": 0
}
}
} My domain update json looks like this config_domain = {
"DomainId": domain_id,
"DefaultUserSettings": {
"KernelGatewayAppSettings": {
"CustomImages": [
{
"ImageName": "conda",
"AppImageConfigName": "conda-env-kernel-config",
}
]
}
}
} With that, I'm able to import packages within Sagemaker Studio. In general the Docker files are not in line with Docker best practices |
Fix issue #22 - conda-env-kernel-image example is broken
Some observations from testing last/this week:
Additional experiments/notes:Kernel auto-detectionAuto-detection of non-base kernel envs does seem to work for me as the sample README describes: E.g. if I create a conda env I find we can also manually register conda envs as notebook kernels in the Dockerfile using something like the below - but it's a bit pointless because I just end up with 2 kernels visible in Studio: The manually created one and the auto-detected one. RUN bash -c 'source activate mycoolenv && python -m ipykernel install --name mycoolenv --display-name "Conda mycoolenv"' I do see the same issue as @tday that, when using this setup, image terminals are unable to switch conda envs, which I think is related to the user situation below: Using non-root user / switching envs in terminal
I did manage to get a notebook-user-editable (i.e. can Next stepsMaybe we could try to have 2 samples to capture both a simple, root+base-based configuration, and a complex, non-root/non-base option separately? As seems to me like it would over-complicate the initial getting started to dive straight into that? I think for this issue the initial bug itself seems resolved. |
docker build . -t ${IMAGE_NAME} -t ${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/smstudio-custom:${IMAGE_NAME}
|
After following the steps listed here exactly I began a SageMaker Studio session. After creating selecting the custom image and beginning a console I received the following error:
The
Dockerfile
andenvironment.yml
are identical to the example. Here is theapp-image-config-input.json
file:And here is the anonymized
create-domain-input.json
contents:I used
IMAGE_NAME=conda-test-kernel
throughout. Other things to note:aws sagemaker describe-image-version
shows"ImageVersionStatus": "CREATED"
aws sagemaker describe-app-image-config
gives back all the expected informationI believe the issue is that
conda
doesn't automatically follow the kernelspec. This quirk needs to be covered in the README for this example. Unfortunately I haven't figure out the solution yet. Any help is appreciated.The text was updated successfully, but these errors were encountered: