aws / aws/sagemaker-distribution

Using a custom SM image based on sagemaker-distribution hangs and fails in SM studio

Open
#178 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
154
Forks
120
Avg merge
5d 4h
Merged PRs (30d)
27

Description

I am not quite sure where to report but since the docs outline how to build a custom image I will try here.

I am building this custom image and pushing it to ECR and adding to sagemaker images and creating app image config, like one would according to the docs.

I am defining my docker image like this

```
FROM --platform=linux/amd public.ecr.aws/sagemaker/sagemaker-distribution:latest-cpu
USER $ROOT
RUN apt-get clean
# dependencies for building python and having opencv
RUN apt-get update && \
apt-get install -y gcc g++ python3-dev ffmpeg libsm6 libxext6 && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean

USER $MAMBA_USER
# copy the environment.yml file into the container
COPY --chown=$MAMBA_USER:$MAMBA_USER processing/environment.yml /tmp/environment.yml

# Use micromamba to install the dependencies from the environment.yml file
RUN micromamba install -y -n base -f /tmp/environment.yml && \
micromamba clean --all --yes
```

The only difference I can see in the logs is this these two lines at 2024-02-09T10:23:34.006+01:00 and 2024-02-09T10:23:34.006+01:00
```

2024-02-09T10:23:34.006+01:00 [I 2024-02-09 09:23:33.875 ServerApp] Loading SageMaker Studio EMR server extension 0.1.9

2024-02-09T10:23:34.006+01:00 [I 2024-02-09 09:23:33.876 ServerApp] sagemaker_jupyterlab_emr_extension | extension was successfully loaded.

2024-02-09T10:23:34.006+01:00 [I 2024-02-09 09:23:33.876 ServerApp] Loading SageMaker JupyterLab server extension 0.2.0

2024-02-09T10:23:34.006+01:00 [I 2024-02-09 09:23:33.877 ServerApp] sagemaker_jupyterlab_extension | extension was successfully loaded.

2024-02-09T10:23:34.006+01:00 [I 2024-02-09 09:23:33.877 ServerApp] Loading SageMaker JupyterLab common server extension 0.1.9

2024-02-09T10:23:34.006+01:00 [I 2024-02-09 09:23:33.877 ServerApp] sagemaker_jupyterlab_extension_common | extension was successfully loaded.

2024-02-09T10:23:34.006+01:00 [I 2024-02-09 09:23:33.878 ServerApp] Serving notebooks from local directory: /home/sagemaker-user

this line -------> 2024-02-09T10:23:34.006+01:00 [I 2024-02-09 09:23:33.878 ServerApp] Jupyter Server 2.10.0 is running at: <-------- this line

2024-02-09T10:23:34.006+01:00 [I 2024-02-09 09:23:33.878 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

2024-02-09T10:23:34.006+01:00 [W 2024-02-09 09:23:33.882 ServerApp] No web browser found: Error('could not locate runnable browser').

this line -------> 2024-02-09T10:23:34.006+01:00 [C 2024-02-09 09:23:33.882 ServerApp] To access the server, open this file in a browser: file:///home/sagemaker-user/.local/share/jupyter/runtime/jpserver-1-open.html Or copy and paste one of these URLs: <------ and this line

2024-02-09T10:23:34.006+01:00 INFO: State start

2024-02-09T10:23:34.006+01:00 INFO: Scheduler at: inproc://169.255.254.1/1/1

2024-02-09T10:23:34.006+01:00 INFO: dashboard at: http://169.255.254.1:8787/status

2024-02-09T10:23:34.006+01:00 INFO: Registering Worker plugin shuffle

2024-02-09T10:23:34.006+01:00 INFO: Start worker at: inproc://169.255.254.1/1/4

2024-02-09T10:23:34.006+01:00 INFO: Listening to: inproc169.255.254.1

2024-02-09T10:23:34.006+01:00 INFO: Worker name: 0

2024-02-09T10:23:34.006+01:00 INFO: dashboard at: 169.255.254.1:39899

2024-02-09T10:23:34.006+01:00 INFO: Waiting to connect to: inproc://169.255.254.1/1/1

2024-02-09T10:23:34.006+01:00 INFO: -------------------------------------------------

2024-02-09T10:23:34.006+01:00 INFO: Threads: 2

2024-02-09T10:23:34.006+01:00 INFO: Memory: 3.78 GiB

2024-02-09T10:23:34.006+01:00 INFO: Local Directory: /tmp/dask-scratch-space/worker-ylr01t6j

2024-02-09T10:23:35.259+01:00 INFO: -------------------------------------------------

2024-02-09T10:23:35.260+01:00 INFO: Register worker

2024-02-09T10:23:35.260+01:00 INFO: Starting worker compute stream, inproc://169.255.254.1/1/4

2024-02-09T10:23:35.260+01:00 INFO: Starting established connection to inproc://169.255.254.1/1/5

2024-02-09T10:23:35.260+01:00 INFO: Starting Worker plugin shuffle

2024-02-09T10:23:35.260+01:00 INFO: Registered to: inproc://169.255.254.1/1/1

2024-02-09T10:23:35.260+01:00 INFO: -------------------------------------------------

2024-02-09T10:23:35.260+01:00 INFO: Starting established connection to inproc://169.255.254.1/1/1

2024-02-09T10:23:35.260+01:00 INFO: Receive client connection: Client-e58dc3c4-c72c-11ee-8001-6efbcde7e649

2024-02-09T10:23:35.510+01:00 INFO: Starting established connection to inproc://169.255.254.1/1/6

2024-02-09T10:23:39.515+01:00 [I 2024-02-09 09:23:35.316 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-
```

In the working images they have a URL that's configured correctly.

I am in VPC only mode for the domain,, but I dont see how that should change anything since the sagemaker-distribution image works fine.

Would appreciate any pointer

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the custom Dockerfile and image configuration in SageMaker Studio, then compare its startup logs and URL configuration with a working image. The issue is resolved when the custom image launches successfully and exposes the expected Studio URL in VPC-only mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, jupyter, python
Domain
cloud, devops, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.