aws / aws/sagemaker-python-sdk

Support network_mode=host for local testing

Đang mở
#5,318 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
component: local mode type: feature request
Ngôn ngữ chính
Python
Star
2.3k
Fork
1.3k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
35

Mô tả

**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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với src/sagemaker/config/config_schema.py tại phần định nghĩa cấu hình container, sau đó truy vết nơi cấu hình đó trở thành các container Docker Compose cục bộ. Xác minh cách network_mode và ports hiện được xử lý trên các container được tạo. Hoàn tất khi kết nối mạng của host được truyền đến từng container và ports được bỏ qua khi network_mode="host".

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
docker, python
Lĩnh vực
devops, infrastructure
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
50/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.