aws / aws/sagemaker-python-sdk

Sagemaker Local-Mode permission errors

Abierto
#4,764 2 comentarios 0 reacciones 1 asignado Reclamado por @pintaoz-aws Ver en GitHub
type: bug
Lenguaje dominante
Python
Estrellas
2.3k
Forks
1.3k
Merge medio
1 d 22 h
PR fusionados (30 d)
35

Descripción

**Describe the bug**
I keep running into issues trying to run bring your own container (BYOC) images, they either work in local model, or they work in "cloud mode" but not both. The issue is almost certainly docker permission problems but I cannot see a way of resolving.

**To reproduce**
I have a docker image

```
FROM continuumio/miniconda3

WORKDIR /opt/ml/code/
COPY src/ /opt/ml/code/

ENTRYPOINT ["bash", "/opt/ml/code/processor.sh"]
```

The `processor.sh` creates a conda venv, installs packages into it then runs `conda pack` with the output set to `/opt/ml/processing/output/pyenv.tar.gz`

In `local` mode this step fails on this line

https://github.com/aws/sagemaker-python-sdk/blob/0e3769ea70a9b4c471a2bfb3a0f6116b9958361e/src/sagemaker/local/utils.py#L84

Because the container user (root) writes the file with permissions that are too restrictive. Note there's a "fix" on line 99 for a similar issue but it doesn't help.

I tried to work around this by adding a non-root (gid/pid 1000) user to the container. This "fixed" the local issue - but now the contain fails when I run it normally. It appears to be the opposite issue, the container user doesn't have access to the volume ` /opt/ml/processing/output/` so the script fails.

**Expected behavior**
Need to be able to run pipelines in local and sagemaker mode without permission errors. It seems that in local mode, scripts need to run with the same pid as the host user, but in sagemaker mode they need to run as root? Is there some way they can work in both?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.