aws / aws/amazon-sagemaker-examples

Probable bug in MMS BYO example

Open
#2,894 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

The example on using `sagemaker-inference` toolkit for multi-model serving bring-your-own-container has some code which smells like a probable bug:

https://github.com/aws/amazon-sagemaker-examples/blob/cb28f5f09c536c8ce5db96c8cf06cd4913d762e9/advanced_functionality/multi_model_bring_your_own/container/dockerd-entrypoint.py#L27

The join-split done to `sys.argv[1:]` results in breaking up any arguments which contain whitespace into separate arguments; e.g. if one of the command-line arguments to the entry point is `"this is foobar"`, then `join` followed by `shlex.split` ends up splitting it into 3 separate arguments.

If this behavior is intentional, it would be excellent to have a comment above the referred line explaining why this is done, as this may reflect on how users should write their custom inference entry point scripts. If this behavior is not intentional, the code could be simplified and made less bug-prone by simply using `subprocess.check_call(sys.argv[1:])`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.