Skip to content

Commit 05bf6d7

Browse files
author
Verdi March
committed
FrameworkProcessor: runproc.sh to deal with possibly broken pip on some py3 containers
1 parent 3e531dd commit 05bf6d7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/sagemaker/processing.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ def __init__(
12301230
instance_type,
12311231
py_version="py3", # New kwarg
12321232
image_uri=None,
1233-
command=["python"],
1233+
command=["python3"],
12341234
volume_size_in_gb=30,
12351235
volume_kms_key=None,
12361236
output_kms_key=None,
@@ -1598,7 +1598,12 @@ def _generate_framework_script(self, user_script: str) -> str:
15981598
# Exit on any error. SageMaker uses error code to mark failed job.
15991599
set -e
16001600
1601-
[[ -f 'requirements.txt' ]] && pip install -r requirements.txt
1601+
if [[ -f 'requirements.txt' ]]; then
1602+
# Some py3 containers has typing, which may breaks pip install
1603+
pip uninstall --yes typing
1604+
1605+
pip install -r requirements.txt
1606+
fi
16021607
16031608
{entry_point_command} {entry_point} "$@"
16041609
"""

src/sagemaker/sklearn/processing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848
instance_type,
4949
py_version="py3", # New kwarg
5050
image_uri=None,
51-
command=["python"],
51+
command=["python3"],
5252
volume_size_in_gb=30,
5353
volume_kms_key=None,
5454
output_kms_key=None,

0 commit comments

Comments
 (0)