aws / aws/sagemaker-python-sdk
Support network_mode=host for local testing
- Langage dominant
- Python
- Étoiles
- 2.3k
- Forks
- 1.3k
- Merge moyen
- 1 j 22 h
- PR mergées (30 j)
- 35
Description
**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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par src/sagemaker/config/config_schema.py, au niveau de la définition de la configuration du conteneur, puis suivez l’endroit où cette configuration devient les conteneurs Docker Compose locaux. Vérifiez comment network_mode et ports sont actuellement gérés pour les conteneurs générés. Le travail est terminé lorsque le réseau de l’hôte est propagé à chaque conteneur et que ports est omis lorsque network_mode="host".
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- docker, python
- Domaine
- devops, infrastructure
- Type d'issue
- Fonctionnalité
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 50/100