aws / aws/sagemaker-python-sdk
Support network_mode=host for local testing
- 主要语言
- Python
- 星标
- 2.3k
- 派生
- 1.3k
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 35
描述
**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.
贡献指南
调研方向
从 src/sagemaker/config/config_schema.py 中的容器配置定义开始,然后追踪该配置在何处变为本地 Docker Compose 容器。验证当前如何在生成的容器中处理 network_mode 和 ports。完成标准是将主机网络传递给每个容器,并在 network_mode="host" 时省略 ports。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- docker, python
- 领域
- devops, infrastructure
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 50/100