aws / aws/sagemaker-python-sdk
Support network_mode=host for local testing
- Lenguaje dominante
- Python
- Estrellas
- 2.3k
- Forks
- 1.3k
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 35
Descripción
**Describe the feature you'd like**
Sagemaker local uses docker compose internal network to make containers communicate with each other.
For some tools, such as Snowflake, some companies may require login via SSO when testing locally.
However the login redirect (bringing back the access token) cannot be managed by the sagemaker container since it is not listening to the same localhost (docker internal network) as the user's browser (actual localhost).
**How would this feature be used? Please describe.**
Allow setting `network_mode="host"` in [container configuration](https://github.com/aws/sagemaker-python-sdk/blob/045798e893de09c76148ba95b17554b2db4bebc2/src/sagemaker/config/config_schema.py#L1240), so that browser redirects can be handled succesfully. This also helps with other random VPN issues not manging correctly docker traffic.
When set, the `network_mode` parameter should be propagated to each container and `ports` must be discarded (as `network_mode="host"` overrides `ports`, allowing traffic on any port).
**Describe alternatives you've considered**
None worked, no documentation about containers networking can be found in the official docs.
Guía de contribución
Línea de trabajo
Comienza con src/sagemaker/config/config_schema.py en la definición de la configuración del contenedor y, a continuación, sigue el recorrido de esa configuración hasta convertirse en los contenedores locales de Docker Compose. Verifica cómo se gestionan actualmente network_mode y ports en los contenedores generados. La tarea estará terminada cuando la red del host se propague a cada contenedor y se omita ports cuando network_mode="host".
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- docker, python
- Área
- devops, infrastructure
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 50/100