I'm trying to create a custom SageMaker image and launch a kernel from it, because I want to see if I can use black, the python code formatter, in SageMaker Studio via a custom SageMaker image.
So far, I've been able to attach the image to the SageMaker domain and start launching the kernel from the custom image, following these steps. However, as soon as the notebook opens, it displays this error in the notebook:
Failed to launch app [black-conda-ml-t3-medium-7123fdb901f81ab5]. ResourceNotFoundError: SageMaker is unable to launch the app using the image [123456789012.dkr.ecr.us-east-1.amazonaws.com/conda-sample@sha256:12345]. Ensure that the UID/GID provided in the AppImageConfig matches the default UID/GID defined in the image. (Context: RequestId: 21234b0f568, TimeStamp: 1677767016.2990377, Date: Thu Mar 2 14:23:36 2023)
Here are the relevant code snippets:Dockerfile:
FROM continuumio/miniconda3:4.9.2COPY environment.yml .RUN conda env update -f environment.yml --prune
environment.yml:
name: basechannels: - conda-forgedependencies: - python=3.9 - numpy - awscli - boto3 - ipykernel - black
and AppImageConfig:
{"AppImageConfigName": "conda-env-kernel-config","KernelGatewayImageConfig": {"KernelSpecs": [ {"Name": "python3","DisplayName": "Python [conda env: myenv]" } ],"FileSystemConfig": {"MountPath": "/root","DefaultUid": 0,"DefaultGid": 0 } }}
I tried following this troubleshooting guide, but it doesn't seem to address my issues because all of the diagnostics worked alright. For example, when I ran id -u
and id -g
inside my local container, the results 0
and 0
lined up with the AppImageConfig settings of "DefaultUid": 0, "DefaultGid": 0
.